ADOBE®MEDIA SERVER 5 Developer’s Guide
Last updated 7/19/2012
Legal notices
Legal notices
For legal notices, see http://help.adobe.com/en_US/legalnotices/index.html.
iii
Last updated 7/19/2012
Contents
Chapter 1: Getting started streaming media
Supported clients, encoders, codecs, and file formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Pre-built media players . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Stream live media (HTTP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Stream live media (RTMP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Stream on-demand media (HTTP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Stream on-demand media (RTMP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Stream on-demand encrypted media (pRTMP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Multicast media (RTMFP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Configuring content protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Configure HTTP Dynamic Streaming and HTTP Live Streaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
HTTP streaming configuration file reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Build custom media players . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Offline packaging for HLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Troubleshoot issues with streaming media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Chapter 2: Content protection
Configuring content protection for HDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Configuring content protection for HLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Chapter 3: Getting started developing applications
Application architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Set up a development environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Example: Hello World application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Overview of creating an application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Test an application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Deploy an application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Chapter 4: Developing streaming media applications
Connecting to the server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Managing connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Streaming media files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Checking video files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Handling errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Working with playlists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Dynamic streaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Reconnecting streams when a connection drops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Fast switching between streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Smart Seeking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Detecting bandwidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Detecting stream length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE iv
Contents
Last updated 7/19/2012
Chapter 5: Working with live video
Capturing live video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Adding DVR features to live video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Adding metadata to a live stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Capturing timecode sent from Flash Media Live Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Publishing live video in RAW file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Multi-point publishing between servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Chapter 6: Building peer-assisted networking applications
Real-Time Media Flow Protocol (RTMFP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
RTMFP groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Distribute peer introductions across servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Chapter 7: Developing social applications
About social applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
About shared objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Remote shared objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
SharedBall example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Broadcast messages to many users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Chapter 8: Securing applications
Allow or deny access to assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Authenticate clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Authenticate users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Chapter 9: Developing Plug-ins
What’s new with plug-ins in Adobe Media Server 4.5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
What’s new with plug-ins in Adobe Media Server 4.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Versioning, upgrading, and server editions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Working with plug-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
General development tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Developing an Access plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Developing an Authorization plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Developing a File plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
1
Last updated 7/19/2012
Chapter 1: Getting started streaming media
Supported clients, encoders, codecs, and file formats
Supported clients and servers for streaming services
Streaming services are pre-built Adobe Media Server applications. Use streaming services to stream media to Flash, AIR, and Apple (iOS and QuickTime) clients. The services are installed to rootinstall/applications/servicename.
The following table lists the streaming services and their earliest supported server versions, server editions, and client runtimes:
Streaming type
Service name
Server version
Server edition(earliest supported)
Client runtime (earliest supported)
On-demand streaming over RTMP.
See Stream on-demand media (RTMP).
vod
3
All
Flash Player 6
AIR 1
On-demand streaming over HTTP.
See “Stream on-demand media (HTTP)” on page 22.
None
4.5
All
Flash Player 10.1
AIR 2
iOS 3.0
QuickTime X
Live streaming over RTMP.
See “Stream on-demand media (RTMP)” on page 27.
live
3
All
Flash Player 6
AIR 1
Live streaming over HTTP.
See “Stream live media (HTTP)” on page 5.
livepkgr
4
4—Adobe Media Server Extended, Adobe Media Server Professional
4.5—All
4—Flash Player 10.1, AIR 2
4.5—Flash Player 10.1, AIR 2, iOS 3.0, QuickTime X
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 2
Getting started streaming media
Last updated 7/19/2012
Important: On Adobe Media Server 5 Standard, you cannot modify the server-side code in the streaming services. In all other editions of the server, you can modify the code.
Supported file formats and codecs
Adobe Flash Platform
For a complete list of supported file formats and codecs, see Supported file formats and codecs.
Live HTTP Dynamic Streaming supports the H.264, VP6, MP3, and AAC codecs.
For on-demand HTTP Dynamic Streaming, the just-in-time packager supports F4V/MP4 files. This document explains how to use the just-in-time packager. To package FLV files for HTTP Dynamic Streaming, use the offline File Packager tool. See File Packager reference.
In addition, see the following Flash Platform articles:
Smart phone and tablet video encoding recommendations for Flash Player and AIR by Adobe encoding evangelist, Maxim Levkov, and Adobe Product Manager, Tom Nguyen.
Video encoding and transcoding recommendations for HTTP Dynamic Streaming on the Flash Platform by Adobe encoding evangelist, Maxim Levkov.
Multicast streaming over RTMFP.
See “Multicast media (RTMFP)” on page 39.
multicast
4
Adobe Media Server Professional supports IP Multicast
Adobe Media Server Extended supports IP Multicast, Application-level Multicast, and Multicast Fusion. Multicast Fusion technology combines IP and Application-level Multicast.
The server editions have changed with server version 5. Adobe Flash Media Streaming Server is Adobe Media Server 5 Standard. Adobe Flash Media Interactive Server is Adobe Media Server 5 Professional. Adobe Flash Media Enterprise Server is Adobe Media Server 5 Extended. Adobe Flash Media Development Server is Adobe Media Server 5 Starter.
Flash Player 10.1
AIR 2
Streaming type Service
name
Server version Server
edition(earliest
supported)
Client runtime
(earliest supported)
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 3
Getting started streaming media
Last updated 7/19/2012
For a longer list of articles about encoding, see the Video Encoding page on Adobe Developer Connection.
Apple HTTP Live Streaming
Adobe Media Server support for Apple HTTP Live Streaming includes H.264 and AAC/HE-AAC for audio-video content and AAC/HE-AAC for audio-only content.
For more information, see Apple HTTP Live Streaming Overview – FAQ.
For recommended encoding settings, see Best Practices for Creating and Deploying HTTP Live Streaming Media for the iPhone and iPad and Recommended Encoding Settings for HTTP Live Streaming Media.
Supported encoders
Use the following encoders to publish a live stream to Adobe Media Server:
•Flash Media Live Encoder
•Server-side scripts running on Adobe Media Server Extended, Adobe Media Server Professional, and Adobe Media Server Starter. When you call the Server-side ActionScript method Stream.play(), the stream is considered “live”.
•A custom-built Flash Player or AIR application. See “Working with live video” on page 208.
•Third-party encoding solutions. See Adobe Media Server Solution Partners.
Pre-built media players
Flash and AIR media players
Media player
Supported protocols
Media player location
Flash Media Playback
RTMP/x, HTTP
Note: Flash Media Playback doesn’t support Set-level Manifest files.
www.adobe.com/products/flashmediaplayback/
Strobe Media Playback
RTMP/x, HTTP
osmf.org/developers.html
Adobe Media Server sample video player
The AMS sample video player is Strobe Media Playback in a wrapper. The wrapper includes sample and generates HTML embed code.
RTMP/x, HTTP
To use this player for multicast playback, use the multicast configurator to create a manifest file. Use the manifest file as the source.
rootinstall/samples/videoPlayer
Adobe Media Server multicast sample player
RTMFP
rootinstall/tools/multicast/multicastplayer
Flash FLVPlayback component
RTMP/x
fl.video.FLVPlayback
FLV playback 2.5 supports DVR
Flex components
RTMP/x
mx.controls.VideoDisplay
spark.components.VideoPlayer
spark.components.VideoDisplay
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 4
Getting started streaming media
Last updated 7/19/2012
Note: The previous table is not a complete list of supported media players. Many third parties have developed excellent media players. When using a third party media player, please check with the third party to verify which features the media player supports.
Play media in Flash Media Playback
Flash Media Playback is a compiled SWF file hosted on Adobe.com. Flash Media Playback is built on the
Open Source
Media Framework
(OSMF). Flash Media Playback is not open source, but it is fully configurable and supports
dynamically loaded plug-ins from third-party service providers. It runs in Flash Player 10.1 and AIR 2 and supports multi-bitrate streaming, Adobe HTTP Dynamic Streaming (streaming over HTTP), and DVR.
Note: Flash Media Playback does not support set-level manifest files; use Strobe Media Playback instead. Or, to use multi-bitrate HTTP Dynamic Streaming with Flash Media Playback, use a Manifest.xml file.
For more information about Flash Media Playback, see
www.adobe.com/products/flashmediaplayback
.
1
Load the Flash Media Playback Setup page in a web browser:
www.osmf.org/configurator/fmp/
.
2
Enter the Video Source.
3
Indicate whether the video uses HTTP Dynamic Streaming or Adobe Access.
4
To use DVR, click the Advanced tab and select Stream Type DVR.
5
Click Preview to update the embed code.
6
Click Play to test the code.
7
To use the player in your own HTML page, copy the embed code and paste it into your page.
Play media in Strobe Media Playback
Strobe Media Playback is built with the Open Source Media Framework (OSMF). It supports progressive download, RTMP streaming, HTTP Dynamic Streaming (including adaptive bitrate manifest files), multicast streaming, and content protection with Adobe® Flash® Access™. You must host Strobe Media Playback on your own server.
Download the latest Strobe Media Playback and its documentation from
osmf.org
.
Play media in the Adobe Media Server sample video player
The sample player that installs with Adobe Media Server to rootinstall/samples/videoPlayer is based on Strobe Media Playback. You can use the sample player to generate HTML embed code to use in your own HTML page.
Important: To play the sample F4M manifest files in the sample video player, enter a localhost address in the Stream URL box. For example, http://localhost/vod/hds_sample1_manifest.f4m.
Embed the Adobe Media Server sample video player in an HTML file
1
Browse to the sample video player and open it in a browser. The file is located at rootinstall/samples/videoPlayer/videoplayer.html.
2
Enter the URL of the video to play and click Stream. The sample player adds the URL of the video file to the embed code.
To play an on-demand file from the vod service, copy the file to the rootinstall/applications/vod/media folder. The URL is something like the following:
rtmp://localhost/vod/mp4:sample1_1500kbps.f4v
For more information, see
“URLs for playing on-demand media files over RTMP” on page
29
,
“URLs for publishing
and playing live streams over RTMP” on page
21
,
“URLs for publishing and playing live streams over HTTP” on
page
15
, and
“URLs for playing on-demand streams over HTTP” on page
26
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 5
Getting started streaming media
Last updated 7/19/2012
3
Find the section on the page labeled “Embed Code”.
4
Copy the code from the text field at the bottom of the page. The code begins and ends with
<object>
tags.
5
Create a new HTML page.
6
Paste the code from the sample video player into the HTML file between the
<body></body>
tags.
7
Save the HTML page to the rootinstall/webroot folder.
Important: Do not name the file “index.html”. The Adobe Media Server Start Screen is the index.html file in the webroot folder. If you save a file named index.html to the webroot folder, the file will overwrite the Start Screen.
The embed code looks for the StrobeMediaPlayback.swf file at swfs/StrobeMediaPlayback.swf. The StrobeMediaPlayback.swf is installed to this folder by default. To serve the HTML page from a different web server, use the same folder structure.
8
Open your HTML file in a browser.
Apple media players
Apple HTTP Live Streaming supports both live content and on-demand content.
For more information about Apple media players, see
Apple HTTP Live Streaming Overview
.
Stream live media (HTTP)
Prerequisites for live streaming over HTTP
To use HTTP Dynamic Streaming (HDS) and HTTP Live Streaming (HLS) to serve live streams to clients over HTTP, publish the streams to the HTTP Live Packager service on Adobe Media Server (rootinstall/applications/livepkgr). The livepkgr service ingests the streams, packages them into fragments, and delivers the fragments to Flash and iOS clients in real-time.
To complete these tutorials, use the following software:
•
Adobe Media Server 5
. See the video
Install Adobe Media Server 5 and verify HTTP streaming to Flash and iOS
.
•
Flash Media Live Encoder
Note: Flash Media Live Encoder on Windows doesn’t support AAC encoding. To add support for AAC, purchase the
MainConcept AAC Encoder
.
•
(Adobe HTTP Dynamic Streaming) Adobe Media Server sample video player (which uses
Strobe Media Playback
)
and
Flash Player 10.1
.
•
(Apple HTTP Live Streaming) iOS 3.0 or later device or Mac OS 10.6 with Safari 4.0 or QuickTime X.
For more information, see
“Supported clients, encoders, codecs, and file formats” on page
1
and
“Pre-built media
players” on page
3
.
Media player
Supported streaming type
Devices running iOS 3.0 and later include built-in client software.
On-demand and live (HTTP)
On Mac OS 10.6 and later, Safari 4.0 and QuickTime X.
On-demand and live (HTTP)
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 6
Getting started streaming media
Last updated 7/19/2012
Publish and play a single live stream over HTTP
1
Install Adobe Media Server 5 and choose to install Apache HTTP Server.
2
Install Flash Media Live Encoder and configure it to use absolute time.
a
Close Flash Media Live Encoder.
b
Open the Flash Media Live Encoder rootinstall\conf\config.xml file in a text editor.
The default installation location on Windows is C:\Program Files\Adobe\Flash Media Live Encoder 3.2.
The default installation location on Mac OS is Macintosh HD:Applications:Adobe:Flash Media Live Encoder 3.2.
c
Set the tag //flashmedialiveencoder_config/mbrconfig/streamsynchronization/enable to true:
<flashmedialiveencoder_config>
<mbrconfig>
<streamsynchronization>
<!– “true” to enable this feature, “false” to disable.–>
<enable>true</enable>
d
Save the file.
3
To publish a live stream to Adobe Media Server, start Flash Media Live Encoder and do the following:
a
In the Encoding Options panel, from the Preset pop-up menu, choose High Bandwidth (800 Kbps) — H.264. For Audio Format, choose AAC.
Note: Flash Media Live Encoder on Windows doesn’t support AAC encoding. To add support for AAC, purchase the
MainConcept AAC Encoder
.
Flash Media Live Encoder Encoding Options panel
b
Click the wrench next to Format to open Advanced Encoder Settings and do the following:
•
Profile—Main
•
Level—3.1
•
Keyframe Frequency—4 or a multiple of
<FragmentDuration>
in the applications/livepkgr/events/_definst_/liveevent/Event.xml file. The default value of
<FragmentDuration>
is 4000 milliseconds.
Note: For information about profile and level support, see
“Supported file formats and codecs” on page
2
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 7
Getting started streaming media
Last updated 7/19/2012
Flash Media Live Encoder Advanced Encoder Settings
c
In the AMS URL text box enter the following:
rtmp://localhost/livepkgr
Note: Use the RTMP protocol to stream the content to the livepkgr application on Adobe Media Server. You can substitute an IP address or a domain name for “localhost”.
d
In the Stream text box enter the following:
livestream?adbe-live-event=liveevent
Note: The applications/livepkgr/main.asc file expects this value.
e
Deselect Save to File.
f
Click Start.
4
(Adobe HTTP Dynamic Streaming) To play the media in Flash Media Playback, do the following:
a
Open Flash Media Playback in a web browser:
http://www.osmf.org/configurator/fmp/
Note: Flash Media Playback requires Flash Player 10.1 to support HTTP Dynamic Streaming.
b
In Video Source, enter:
http://localhost/hds-live/livepkgr/_definst_/liveevent/livestream.f4m
For information about the request URL, see
“URLs for publishing and playing live streams over HTTP” on
page
15
.
c
Select Yes under the question “Are you using HTTP Streaming or Adobe Access 2.0?”.
d
Click Preview. Click Play.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 8
Getting started streaming media
Last updated 7/19/2012
HDS live stream playing in Flash Media Playback
5
(Adobe HTTP Dynamic Streaming) To play the media in Strobe Media Playback, do the following:
a
Open the Adobe Media Server sample video player in a web browser. Browse to rootinstall/samples/videoPlayer/videoplayer.html
b
In STREAM URL, enter:
http://localhost/hds-live/livepkgr/_definst_/liveevent/livestream.f4m
For information about the request URL, see
“URLs for publishing and playing live streams over HTTP” on
page
15
.
c
Select LIVE and Click PLAY STREAM.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 9
Getting started streaming media
Last updated 7/19/2012
HDS live stream playing in the Adobe Media Server sample video player
6
(Apple HTTP Live Streaming) Use the following URL:
http://10.0.1.11/hls-live/livepkgr/_definst_/liveevent/livestream.m3u8
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 10
Getting started streaming media
Last updated 7/19/2012
HLS live stream playing in Safari on an iPad
For information about where to use the URL to serve various iOS devices, QuickTime, and Safari, see
HTTP Live
Streaming Overview
in the iOS Reference Library.
For information about the request URL, see
“URLs for publishing and playing live streams over HTTP” on page
15
.
Note: Replace “localhost” or “10.0.1.11” with the domain name or IP address of the computer hosting Adobe Media Server. If you’re using a Adobe Media Server hosting provider, they can give you this value.
More Help topics
“Troubleshoot issues with streaming media” on page
90
“Disk management” on page
61
“Content storage (HDS and HLS)” on page
47
“Configure HTTP Dynamic Streaming and HTTP Live Streaming” on page
42
“Stream live media (RTMP)” on page
19
Publish and play live multi-bitrate streams over HTTP
1
Install Adobe Media Server 5 and choose to install Apache HTTP Server.
2
Install Flash Media Live Encoder and configure it to use absolute time.
a
Close Flash Media Live Encoder.
b
Open the Flash Media Live Encoder rootinstall\Conf\config.xml file in a text editor.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 11
Getting started streaming media
Last updated 7/19/2012
c
Set the tag //flashmedialiveencoder_config/mbrconfig/streamsynchronization/enable to true:
<flashmedialiveencoder_config>
<mbrconfig>
<streamsynchronization>
<!– “true” to enable this feature, “false” to disable.–>
<enable>true</enable>
d
Save the file.
3
Browse to rootinstall/applications/livepkgr/events/_definst_/liveevent and do the following:
•
Edit the Event.xml file to look like the following:
<Event>
<EventID>liveevent</EventID>
<Recording>
<FragmentDuration>4000</FragmentDuration>
<SegmentDuration>16000</SegmentDuration>
<DiskManagementDuration>3</DiskManagementDuration>
</Recording>
</Event>
•
Remove the Manifest.xml file from the liveevent folder or rename it.
4
(Adobe HTTP Dynamic Streaming) For multi-bitrate streaming, Flash and AIR media players request an F4M manifest file that contains the location and bitrate of each live stream. This type of F4M file is called a set-level manifest. To create an set-level manifest, do the following:
a
Open rootinstall/tools/f4mconfig/configurator/f4mconfig.html in a browser.
b
Select the f4m file type.
c
Stream URIs can be absolute or relative to a Base URI. Enter the following for the Base URI:
http://localhost/hds-live/livepkgr/_definst_/liveevent
d
Enter the following for each stream and click Add:
e
To preview the file, click View Manifest. The manifest file looks like this:
<manifest xmlns=”http://ns.adobe.com/f4m/2.0″>
<baseURL>http://localhost/hds-live/livepkgr/_definst_/liveevent/</baseURL>
<media href=”livestream1.f4m” bitrate=”150″/>
<media href=”livestream2.f4m” bitrate=”500″/>
<media href=”livestream3.f4m” bitrate=”700″/>
</manifest>
f
Click Save Manifest and save the file as liveevent.f4m to rootinstall/webroot.
The media player requests this file from a web server. This tutorial saves the file to rootinstall/webroot, but the file can be served from any location on any webserver. This file does not need to live on Adobe Media Server. This file can also have any name.
Stream URI
Bitrate
livestream1.f4m
150
livestream2.f4m
500
livestream3.f4m
700
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 12
Getting started streaming media
Last updated 7/19/2012
5
(Apple HTTP Live Streaming) iOS devices request an M3U8 variant playlist file that contains the location, bitrate, and optionally the codec of each stream. To create an M3U8 file, do the following:
a
If the Set-level F4M/M3U8 File Generator tool isn’t open, double-click rootinstall/tools/f4mconfig/configurator/f4mconfig.html to open it in a browser.
b
Select m3u8.
c
Enter the Stream URI and bitrate for each stream. Stream URIs can be absolute or relative. If they are relative, they are relative to the m3u8 file.
Note: You can’t use a Base URI when generating an M3U8 file.
This tutorial uses the following Stream URI settings:
d
For m3u8 files, you can optionally add a codec for each stream.
If one stream is audio-only, specify an audio codec. Specify audio and video codecs for the other streams in the manifest. See
“Publish an audio-only stream (HLS)” on page
14
.
e
To view the file, click View Manifest. The m3u8 file looks like this:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=150000
http://localhost/hls-live/livepkgr/_definst_/liveevent/livestream1.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=500000
http://localhost/hls-live/livepkgr/_definst_/liveevent/livestream2.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=700000
http://localhost/hls-live/livepkgr/_definst_/liveevent/livestream3.m3u8
f
Save the file as liveevent.m3u8 to the folder rootinstall/webroot.
The media player requests this file from a web server. This tutorial saves the file to rootinstall/webroot, but the file can be served from any location on any webserver. This file does not need to live on Adobe Media Server.
6
To publish a live stream to Adobe Media Server, start Flash Media Live Encoder and do the following:
a
In the Encoding Options panel, from the Preset pop-up menu, choose Multi Bitrate – 3 Streams (1500 Kbps) – H.264. Choose Audio Format AAC.
Note: Flash Media Live Encoder on Windows doesn’t support AAC encoding. To add support for AAC, purchase the
MainConcept AAC Encoder
.
b
Click the wrench next to Format to open Advanced Encoder Settings. For Keyframe frequency, select 4 seconds.
Note: This value matches the
<FragmentDuration>
value in the applications/livepkgr/events/_definst_/liveevent/Event.xml file. The
<FragmentDuration>
value is in milliseconds.
c
For Bit Rate, choose 150, 500, and 700.
d
In the AMS URL text box, enter the following:
rtmp://localhost/livepkgr
Stream URI
Bitrate
http://localhost/hls-live/livepkgr/_definst_/liveevent/livestream1.m3u8
150
http://localhost/hls-live/livepkgr/_definst_/liveevent/livestream2.m3u8
500
http://localhost/hls-live/livepkgr/_definst_/liveevent/livestream3.m3u8
700
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 13
Getting started streaming media
Last updated 7/19/2012
Note: This application is installed with Adobe Media Server and contains a main.asc file and configuration files for live HTTP Dynamic Streaming.
e
In the Stream text box, enter the following:
livestream%i?adbe-live-event=liveevent
Note: The applications/livepkgr/main.asc file expects this value. Flash Media Live Encoder uses the variable %i to create multiple stream names: livestream1, livestream2, livestream3, and so on. To use another encoder, provide your own unique stream names, for example, livestream1?adbe-live-event=liveevent, livestream2?adbe-live-event=liveevent.
f
Deselect Save to File.
g
Click Start.
7
(Adobe HTTP Dynamic Streaming) Flash Media Playback does not support set-level manifest files. To play the media, use Strobe Media Playback. Strobe Media Playback is used in the sample video player that installs with Adobe Media Server.
a
Copy the videoPlayer directory from rootinstall/samples/videoPlayer to rootinstall/webroot.
b
Browse to the sample player in a web browser:
http://localhost/videoPlayer/videoplayer.html
c
In Video Source, enter the following:
http://localhost/liveevent.f4m
8
(Apple HTTP Live Streaming) In iOS, enter the following URL in Safari:
http://localhost/liveevent.m3u8
For information about where to use the URL to serve various iOS devices, QuickTime, and Safari, see
HTTP Live
Streaming Overview
in the iOS Reference Library.
Note: You can replace localhost with the domain name or IP address of the computer hosting Adobe Media Server. If you’re using a Adobe Media Server hosting provider, they can give you this value.
Setting the record option while publishing to livepkgr
You can define the record option by adding a query parameter string
adbe-record-mode
. The value of this string can be “record” or “append”. If the parameter is not specified, “append” will be used. In case of “record”, livepkgr overwrites the previous recording for the same stream and event name. In case of “append”, livepkgr application appends to the previous recording for the same stream and event name.
For example, to publish a stream in record mode, use:
livestream%i?adbe-live-event=liveevent&adbe-record-mode=record
To publish a stream in append mode (default case), use:
livestream%i?adbe-live-event=liveevent&adbe-record-mode=append
Packaging an audio-only stream (HLS)
To serve streams over a cellular network, one of the streams must be audio-only. For more information, see
HTTP Live
Streaming Overview
.
AAC-encoded audio files (MP4/F4V) are packaged as .aac file. Also, the M3U8 file will list the file names as .aac instead of .ts. An audio-only stream functionality will be available only if the M3U8 URL has the following query parameter:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 14
Getting started streaming media
Last updated 7/19/2012
“audio-only=true”
The following table describes the supported query parameters:
Here is an example of a valid M3U8 URL:
http://myserver/hls-vod/sample1_1500kbps.f4v.m3u8?audio-only=true&audio-codec=aac
Here is an example M3U8 file snippet:
#EXTM3U_
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1500000,CODECS=”avc1.42001e, mp4a.40.2″ http://myserver/hls-vod/sample1_1500kbps.f4v.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=150000,CODECS=”avc1.42001e, mp4a.40.2″ http://myserver/hls-vod/sample1_150kbps.f4v.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1000000,CODECS=”avc1.42001e, mp4a.40.2″ http://myserver/hls-vod/sample1_1000kbps.f4v.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=64000,CODECS=”mp4a.40.2″
http://myserver/hls-vod/sample1_1000kbps.f4v.m3u8?audio-only=true&audio-codec=aac
Publish an audio-only stream (HLS)
To publish an audio-only stream, enter the following in the Adobe Media Encoder Stream field:
livestream%i?adbe-live-event=liveevent&adbe-audio-stream-name=livestream1_audio_only&adbe-audio-stream-src=livestream1
If the encoder specifies individual query strings for each stream, use individual stream names instead of the variable
%i
:
livestream1?adbe-live-event=liveevent&adbe-audio-stream-name=livestream1_audio_only
livestream2?adbe-live-event=liveevent&adbe-audio-stream-name=livestream2_audio_only
Note: You can use the values in italics or replace them with your own values. The default live event is called “liveevent”.
To generate a set-level variant playlist when using an audio-only stream, specify the audio codec of the audio-only stream. Specify the audio and the video codec of the streams that contain audio and video. For more information about using the Set-level F4M/M3U8 File Generator, see
“Publish and play live multi-bitrate streams over HTTP” on page
10
.
Note: It is highly recommended to use the “Audio-only packaging” as mentioned in previous section rather than publishing audio-only streams.
Query parameter
Description
audio-only
Specifies whether the stream/file is audio-only. If the value is false, the audio-only stream will be extracted from the A/V stream.
audio-codec
Specifies the audio codec of the requested stream file. If the audio-only parameter is set to false, value of the audio-codec will be ignored and file/stream will be segmented in the normal way.
Parameter
Description
adbe-audio-stream-name
The name of the audio-only stream.
adbe-audio-stream-src
The name of the stream from which to extract the audio for the audio-only stream. If this parameter is not specified, the server uses the stream on which the
adbe-audio-stream-name
parameter was specified.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 15
Getting started streaming media
Last updated 7/19/2012
URLs for publishing and playing live streams over HTTP
Important: The format for HDS request URLs has changed in Adobe Media Server 5. The Apache httpd.conf file redirects requests in the 4.0 format to the 4.5 format. The path /live/events/livepkgr/events redirects to the path /hds-live/livepkgr.
Use the following URL to publish a single live stream to Adobe Media Server for streaming over HTTP:
rtmp://ams-ip-or-dns/livepkgr/livestream?adbe-live-event=liveevent
Use the following URL to publish multiple live streams to Adobe Media Server for adaptive bitrate streaming:
rtmp://ams-ip-or-dns/livepkgr/livestream%i?adbe-live-event=liveevent
Note: Publish the stream over RTMP. Clients play the stream over HTTP.
Use the following URLs to play live streams over HTTP:
Important: To play streaming media over HTTP, a media player requests a manifest file (F4M or M3U8). The server generates manifest files in real-time. The files are not written to disk; you cannot see them on the server.
The path /hds-live is a
<Location>
directive in the Apache httpd.conf file that tells the server to package the content for Adobe HTTP Dynamic Streaming (HDS).
The path /hls-live is a
<Location>
directive in the Apache httpd.conf file that tells the server to package the content for Apple HTTP Live Streaming (HLS).
For adaptive streaming, the client requests a set-level manifest. For HDS, this file is a .f4m file. For HLS, this file is a .m3u8 file. The set-level manifest can live on any web server. You can create multiple set-level manifest files for a single set of live streams.
The set-level manifest contains the paths to the F4M manifest files (HDS) and M3U8 variant playlists (HLS) of each live stream. The paths must begin with /hds-live or /hls-live to tell the server to package the streams for HTTP.
Note: Do not include /hds-live or /hls-live in the URL that requests the set-level manifest.
Client
Single stream or Adaptive Bitrate
Request URL
Adobe HDS
Single stream
http://<ams-dns-or-ip>/hds-live/livepkgr/<instname>/<eventname>/<streamname>.f4m
Apple HLS
Single stream
http://<ams-dns-or-ip>/hls-live/livepkgr/<instname>/<eventname>/<streamname>.m3u8
Adobe HDS
Adaptive bitrate
The media player requests a set-level manifest file:
http://<webserver-dns-or-ip>/<set-level-manifest>.f4m
The set-level manifest file contains URLs for each live stream in the following format:
http://<ams-dns-or-ip>/hds-live/livepkgr/<instname>/<eventname>/<streamname>.f4m
Apple HLS
Adaptive bitrate
The media player requests a set-level variant playlist file:
http://<webserver-dns-or-ip>/<set-level-variant-playlist>.m3u8
The set-level variant playlist contains URLs for each live stream in the following format:
http://<ams-dns-or-ip>/hls-live/livepkgr/<instname>/<eventname>/<streamname>.m3u8
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 16
Getting started streaming media
Last updated 7/19/2012
You can configure the
<Location>
directive settings and the content location in the Apache httpd.conf file. For more information, see
Content storage (HDS and HLS)
.
Differences in HTTP live URLs from Flash Media Server 4.0 to Adobe Media Server 5
The default URL to play a live stream over HTTP has changed in Adobe Media Server 5. In Flash Media Server 4.0, the URL to play a live stream was http://<servername>/live/events/livepkgr/events/<eventname>. The Adobe Media Server 5 Apache httpd.conf file uses a 301 redirect to redirect requests that use a 4.0 URL to the 4.5 URL.
For more differences, see
“Differences in HTTP Dynamic Streaming between Adobe Media Server 4.0 and 4.5” on
page
45
.
Configure DVR (HDS)
Configure DVR on the server
1
Open the Set-level F4M/M3U8 File Generator in a browser: rootinstall/tools/f4mconfig/configurator/f4mconfig.html.
2
In addition to entering values for Stream URI and Bitrate, enter a value for DVR Window Duration. This value sets the amount of viewable content, in minutes, before the live point.
Use the following guidelines to set a Window Duration:
•
Set Window Duration to a value greater than 0.
Setting the Window Duration to 0 can cause a bad user experience.
•
A value of -1 indicates that the available recorded content behind the live point is unlimited.
3
In the Event.xml file, configure the
DiskManagementDuration
element to specify the amount of content the server caches. By default, the server caches 3 hours of content. Use the following formula to determine the value of the Window Duration in relation to the value of
DiskManagementDuration
:
HDSWindowDuration <= (DiskManagementDuration – SegmentDuration)
For more information about disk managment, see
“Disk management” on page
61
.
Publish a DVR stream
To publish a DVR stream from Flash Media Live Encoder, do not click Record or check DVR Auto Record. Publish the stream just as you publish any live stream.
Play DVR streams
Strobe Media Playback supports DVR streams by default.
Note: Flash Media Playback does not support set-level manifest files. To use Flash Media Playback, configure a Manifest.xml file. See
“Manifest.xml” on page
76
.
Configure a sliding window (HLS)
Configure a sliding window on the server
A sliding window is the seekable portion of the stream for Apple HTTP Live Streaming. Clients cannot seek beyond the sliding window length. HTTP Live Streaming clients use the sliding window to configure the seek bar.
Configure a sliding window at the following levels:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 17
Getting started streaming media
Last updated 7/19/2012
Use the following parameters:
The time within the sliding window is:
HLSSlidingWindowLength * HLSMediaFileDuration
SlidingWindowLength * MediaFileDuration
By default,
HLSSlidingWindowLength
is set to 6 seconds and
HLSMediaFileDuration
is set to 8000 milliseconds. Therefore, by default, all HLS live events are seekable within a window that is 48 seconds wide.
The sliding window is relative to the current position of the live stream. For example, if sliding window is configured to have 15 minutes of data and the event starts at time 0, when the live stream is at 30, the last seek position possible is 15.
To make an entire live event seekable, set
SlidingWindowLength
or
HLSSlidingWindowLength
to 0. However, doing so may impact performance.
Configure the sliding window to be smaller than the duration of content cached on disk. In the Event.xml file, the
DiskManagementDuration
element specifies the amount of content the server caches. By default, the server caches 3 hours of content. The size of the HLS sliding window must be as follows:
HLSSlidingWindow <= (DiskManagementDuration – SegmentDuration)
For more information about disk managment, see
“Disk management” on page
61
.
Configure a sliding window at the event level
The following Event.xml file creates a 1 hour sliding window for a single HLS live event:
Level
Configuration file
Server
rootinstall/Apache2.2/conf/httpd.conf
Application
rootinstall/applications/livepkgr/Application.xml
The livepkgr application is the default application for HTTP streaming. You can duplicate and rename this application.
Event
rootinstall/applications/livepkgr/events/_definst_/liveevent/Event.xml
The liveevent folder is the default live event. You can create multiple live events within an application.
Parameter
Configuration file
Description
HLSSlidingWindowLength
httpd.conf
The number of TS files available for seeking in a sliding window.
SlidingWindowLength
Application.xml and Event.xml
The number of TS files available for seeking in a sliding window.
HLSMediaFileDuration
httpd.conf
The length of a TS file, in milliseconds.
MediaFileDuration
Application.xml and Event.xml
The length of a TS file, in milliseconds.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 18
Getting started streaming media
Last updated 7/19/2012
<Event>
<EventID>liveevent</EventID>
<Recording>
<FragmentDuration>4000</FragmentDuration>
<SegmentDuration>400000</SegmentDuration>
<DiskManagementDuration>3</DiskManagementDuration>
</Recording>
<HLS>
<MediaFileDuration>8000</MediaFileDuration>
<SlidingWindowLength>450</SlidingWindowLength>
</HLS>
</Event>
Configure a sliding window at the application level
The following Application.xml file creates a 1 hour sliding window for all HLS live events within the livepkgr application:
<Application>
<StreamManager>
<Live>
<AssumeAbsoluteTime>true</AssumeAbsoluteTime>
</Live>
</StreamManager>
<HLS>
<MediaFileDuration>8000</MediaFileDuration>
<SlidingWindowLength>450</SlidingWindowLength>
</HLS>
</Application>
Reload the livepkgr application.
Configure a sliding window at the server level
The following Apache configuration sets
HLSSlidingWindowLength
to
450
. This configuraiton creates a 1 hour sliding window for all HLS live events on the server:
…
<IfModule hlshttp_module>
<Location /hls-live>
HLSHttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications”
HttpStreamingContentPath “../applications”
HLSMediaFileDuration 8000
HLSSlidingWindowLength 450
HLSFmsDirPath “..”
HLSM3U8MaxAge 2
HLSTSSegmentMaxAge -1
Options -Indexes FollowSymLinks
</Location>
Restart Apache HTTP Server.
Publish streams with a sliding window
You don’t need to configure any encoder settings to publish a stream with a sliding window.
Play streams with a sliding window
Devices that support HTTP Live Streaming support the sliding window feature by default.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 19
Getting started streaming media
Last updated 7/19/2012
Duplicate the livepkgr service
The server supports an unlimited number of instances of the livepkgr service.
❖
Duplicate the rootinstall/applications/livepkgr folder in the applications folder and give it a new name, for example, livepkgr2. In this case, the new livepkgr service is located at rootinstall/applications/livepkgr2.
You can create as many instances of the livepkgr service as you need.
Modify server-side code in the livepkgr service
Note: You cannot modify server-side code on Adobe Media Server Standard.
❖
Remove the rootinstall/applications/livepkgr/main.far file and replace it with the rootinstall/samples/applications/livepkgr/main.asc file.
Removing all HDS segments
To remove all the existing HDS segments when the application unloads, you can use the
clearOnAppStop
tag as shown below:
<ScriptEngine>
<ApplicationObject>
<config>
<clearOnAppStop>true</clearOnAppStop>
</config>
</ApplicationObject>
</ScriptEngine>
Stream live media (RTMP)
Tutorial: stream live media (RTMP)
To complete this tutorial, install the following software:
•
Flash Media Live Encoder
Flash Media Live Encoder captures live audio and video, encodes it, and streams it to Adobe Media Server. Flash Media Live Encoder is free so it’s a good idea to download the latest version.
•
Adobe Media Server
You can use any edition of Adobe Media Server to stream live media, including the free developer edition. For information about installing the server, see
Installing the server
.
•
Flash Player
This tutorial uses a video player that requires Flash Player 10.
For more information, see
“Supported clients, encoders, codecs, and file formats” on page
1
and
“Pre-built media
players” on page
3
.
Publish a live stream to Adobe Media Server
1
Connect a camera to the computer.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 20
Getting started streaming media
Last updated 7/19/2012
2
Open Flash Media Live Encoder and do the following in the Encoding Options panel:
a
From the Preset menu, choose High Bandwidth (300 Kbps) – H.264.
You can choose any of the single stream options (not Multi Bitrate) from the Preset menu. The information on the left side of the panel is filled in when you choose a preset.
b
Select Stream to Adobe Media Server.
c
For AMS URL, enter rtmp://localhost/live.
Use localhost for testing when Flash Media Live Encoder and Adobe Media Server are on the same computer. In a production environment, use the domain name or IP address of the computer hosting Adobe Media Server, for example, rtmp://ams.mycompany.com/live.
If you’re using a Adobe Media Server hosting provider, they can give you the domain name or IP address of the server.
You must use the name live in the AMS URL unless you duplicate and rename the live service. The live service is a pre-built application on Adobe Media Server installed to rootinstall/applications/live. For more information, see
“Duplicate the live service” on page
21
.
d
For Stream, enter livestream.
e
To save a recording of the stream on your hard drive, select Save to File, click Browse, and choose a location. If you chose an H.264 preset, use an .f4v filename extension. If you chose a VP6 preset, use an .flv filename extension.
Note that the server is not recording the file; Flash Media Live Encoder is recording the file. To serve the file on-demand when the live event is over, copy the file to the local disk of the server. For more information, see
“Stream on-demand media (RTMP)” on page
27
.
To play an F4V file recorded by Flash Media Live Encoder without streaming it from the server, use the
F4V
Flattener tool
to flatten the file. You can play FLV files without flattening them.
f
Click Start to connect to the server and start streaming.
Use the Adobe Media Server sample player to play a live stream
1
Double-click the rootinstall/samples/videoPlayer/videoplayer.html file to open the sample video player in a browser.
Note: Substitute the Adobe Media Server installation directory for rootinstall.
2
In the sample video player, do one of the following:
•
In the list of videos, click “livestream”.
•
Enter rtmp://localhost/live/livestream, check the LIVE checkbox, and click PLAY STREAM.
If the media player isn’t on the same computer as Adobe Media Server, replace localhost with the domain name or IP address of the computer hosting Adobe Media Server.
Use this URL to play this stream from any compatible video player, including Flash Media Playback and Strobe Media Playback. For more information about the sample video player and other video players, see
“Pre-built
media players” on page
3
.
Use Flash Media Playback to play a live stream
1
Load the Flash Media Playback Setup page in a web browser:
www.osmf.org/configurator/fmp/
.
2
Enter the Video Source:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 21
Getting started streaming media
Last updated 7/19/2012
rtmp://localhost/live/livestream
You can replace localhost with the domain name or IP address of the server.
3
Click Preview to update the embed code.
4
Click Play to test the code.
5
To use the player in your own HTML page, copy the embed code and paste it into your page. Flash Media Playback is a compiled SWF file hosted by Adobe.
More Help topics
“Troubleshoot issues with streaming media” on page
90
“Stream live media (HTTP)” on page
5
URLs for publishing and playing live streams over RTMP
Use the following values to publish a single live stream to Adobe Media Server for streaming over RTMP:
AMS URL: rtmp://ams-ip-or-dns/live
Stream: streamname
Use the following URL to play a live stream:
rtmp://ams-ip-or-dns/live/streamname
Duplicate the live service
You can create as many instances of the live service as you need.
1
Create a folder in the rootinstall/applications folder, for example, rootinstall/applications/live2
2
Copy the main.far, Application.xml, allowedHTMLdomains.txt, and allowedSWFdomains.txt files from the rootinstall/applications/live folder to the live2 folder.
3
Open the ams.ini file (located in rootinstall/conf) and add a parameter to set the content path for the new service, for example:
LIVE2_DIR = C:\Program Files\Adobe\Adobe Media Server 5\applications\live2
4
Open the Application.xml file in the rootinstall/applications/live2 folder and edit the virtual directory to the following:
<Streams>/;${LIVE2_DIR}</Streams>
5
Restart the server.
6
Clients can connect to the new publishing point at the URL:
rtmp://ams-ip-or-dns/live2
Modify server-side code in the live service
Note: You cannot modify server-side code in the live service on Adobe Media Server Standard.
❖
Remove the rootinstall/applications/live/main.far file and replace it with the rootinstall/samples/applications/live/main.asc file.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 22
Getting started streaming media
Last updated 7/19/2012
Disable live services
❖
Move any live services folders out of the applications folder.
Stream on-demand media (HTTP)
Prerequisites for streaming on-demand media (HTTP)
To complete these tutorials, use the following software:
•
Adobe Media Server 5
. See the video
Install Adobe Media Server 5 and verify HTTP streaming to Flash and iOS
.
•
(Adobe HTTP Dynamic Streaming)
Adobe Media Server sample video player (which uses Strobe Media Playback)
and
Flash Player 10.1
•
(Apple HTTP Live Streaming) iOS 3.0 or later device or Mac OS 10.6 with Safari 4.0 or QuickTime X
For more information, see
“Supported clients, encoders, codecs, and file formats” on page
1
and
“Pre-built media
players” on page
3
.
Play a single on-demand media file over HTTP
A community member has created a screencast that walks you through similar steps:
Stream on-demand video to
Flash and iOS over HTTP
.
1
Install Adobe Media Server 5 and choose to install Apache HTTP Server.
2
Copy an F4V/MP4 file to the following location:
rootinstall/webroot/vod
Note: Replace rootinstall with the Adobe Media Server installation folder.
This tutorial uses the file sample2_1000kbps.f4v which installs with Adobe Media Server to the rootinstall/webroot/vod folder.
3
(Adobe HTTP Dynamic Streaming) To play the media in Flash Media Playback, do the following:
a
Open Flash Media Playback in a web browser:
http://www.osmf.org/configurator/fmp/
Note: Flash Media Playback requires Flash Player 10.1 to support HTTP Dynamic Streaming. To see which version of Flash Player is installed on your computer, go to
Adobe Flash Player.
b
In Video Source, enter:
http://localhost/hds-vod/sample2_1000kbps.f4v.f4m
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 23
Getting started streaming media
Last updated 7/19/2012
HDS on-demand streaming in Flash Media Playback
Although the media file lives in the /webroot/vod directory, the URL request is /hds-vod. The path /hds-vod is a
<Location>
directive in the Apache httpd.conf file. When a request URL begins with /hds-vod, the server looks for media in the /webroot/vod folder and packages it for HTTP Dynamic Streaming. For information about the request URL syntax, see
“URLs for playing on-demand streams over HTTP” on page
26
.
c
Select Yes under the question “Are you using HTTP Streaming or Adobe Access 2.0?”.
d
Clear the text from the Poster frame file location text box.
e
Click Preview to update the embed code.
f
Click the Play button to test the code.
g
To use the player in your own HTML page, copy the embed code and paste it into the body of the page. Flash Media Playback is a compiled SWF file hosted by Adobe. For more information, see
Flash Media Playback
.
4
(Adobe HTTP Dynamic Streaming) To play the media in Strobe Media Playback, do the following:
a
Open the Adobe Media Server sample video player in a web browser. Double-click rootinstall/samples/videoPlayer/videoplayer.html.
b
In STREAM URL, enter:
http://localhost/hds-vod/sample2_1000kbps.f4v.f4m
c
Select VOD and click PLAY STREAM.
d
To use the player in your own HTML page, copy the embed code and paste it into the body of the page.
5
(Apple HTTP Live Streaming) On iOS, enter the following URL in the Safari address bar:
http://10.0.1.11/hls-vod/sample2_1000kbps.f4v.m3u8
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 24
Getting started streaming media
Last updated 7/19/2012
HLS on-demand streaming in Safari on an iPad
To test in Safari on Mac OS 10.6, use the following HTML code:
<video src=”http://10.0.1.11/hls-vod/sample2_1000kbps.f4v.m3u8″ controls=”controls”></video>
Note: You can replace “localhost” and “10.0.1.11” with the domain name or IP address of the computer hosting Adobe Media Server. If you’re using a Adobe Media Server hosting provider, they can give you this value.
More Help topics
“Troubleshoot issues with streaming media” on page
90
“Supported file formats and codecs” on page
2
“Content storage (HDS and HLS)” on page
47
“Configure HTTP Dynamic Streaming and HTTP Live Streaming” on page
42
“Stream on-demand media (RTMP)” on page
27
Play on-demand multi-bitrate media files over HTTP
A community member, Jody Bleyle has created a screencast that walks you through similar steps:
HTTP adaptive
bitrate streaming to Flash and iOS
.
1
Install Adobe Media Server 5 and choose to install Apache HTTP Server.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 25
Getting started streaming media
Last updated 7/19/2012
2
Do one of the following:
•
Encode an F4V/MP4 file at 3 different bitrates.
•
Use the multi-bitrate sample files that install with Adobe Media Server to the rootinstall/webroot/vod folder.
This tutorial uses the following files installed to the webroot/vod folder:
rootinstall/webroot/vod/sample1_150kbps.f4v
rootinstall/webroot/vod/sample1_700kbps.f4v
rootinstall/webroot/vod/sample1_1500kbps.f4v
3
(Adobe HTTP Dyanmic Streaming) To stream multi-bitrate content, Flash and AIR media players request a set-level manifest file. This is a .f4m file that contains the location and bitrate of each stream. To create a set-level F4M file, do the following:
a
Open rootinstall/Adobe Media Server/tools/f4mconfig/configurator/f4mconfig.html in a browser.
b
Select the f4m file type.
c
Stream URIs can be absolute or relative to a Base URI. Enter the following for the Base URI:
http://localhost/hds-vod/
d
Enter the following for each stream and click Add:
e
To view the file, click View Manifest. The manifest file looks like this:
<manifest xmlns=”http://ns.adobe.com/f4m/2.0″>
<media href=”http://localhost/hds-vod/sample1_150kbps.f4v.f4m” bitrate=”150″/>
<media href=”http://localhost/hds-vod/sample1_700kbps.f4v.f4m” bitrate=”700″/>
<media href=”http://localhost/hds-vod/sample1_1500kbps.f4v.f4m” bitrate=”1500″/>
</manifest>
f
Click Save Manifest to save the file as sample1.f4m to rootinstall/webroot.
The media player requests this file from a web server. This tutorial saves the file to rootinstall/webroot, but the file can be served from any location on any webserver. This file does not need to live on Adobe Media Server. This file can have any name.
4
(Apple HTTP Live Streaming)For multi-bitrate streaming, iOS devices request a set-level M3U8 variant playlist file that contains the location, bitrate, and optionally the codec of each stream. To create a set-level M3U8 file, do the following:
a
If the File Generator tool isn’t open, double-click rootinstall/Adobe Media Server/tools/f4mconfig/configurator/f4mconfig.html to open it in a browser.
b
Select the m3u8 file type.
c
Enter the Stream URI, bitrate, program-ID, and optionally a resolution and codec for each stream. Stream URIs can be absolute or relative. If they are relative, they are relative to the m3u8 file. The program-ID must be the same for each stream.
Note: For information about supported codecs, see
Apple HTTP Live Streaming Overview
.
Stream URI
Bitrate
sample1_150kbps.f4v.f4m
150
sample1_700kbps.f4v.f4m
700
sample1_1500kbps.f4v.f4m
1500
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 26
Getting started streaming media
Last updated 7/19/2012
This tutorial uses the following Stream URI settings:
d
To view the file, click View Manifest. The m3u8 file looks like this:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=150000
http://10.0.1.11/hls-vod/sample1_150kbps.f4v.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=700000
http://10.0.1.11/hls-vod/sample1_700kbps.f4v.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1500000
http://10.0.1.11/hls-vod/sample1_1500kbps.f4v.m3u8
e
Click Save Manifest and save the file as sample1.m3u8 to the folder rootinstall/webroot.
The media player requests this file from a web server. This tutorial saves the file to rootinstall/webroot, but the file can be served from any location on any webserver. This file does not need to live on Adobe Media Server.
5
(Adobe HTTP Dynamic Streaming) Flash Media Playback does not support set-level manifest files. To play the media, use Strobe Media Playback. Strobe Media Playback is used in the sample video player that installs with Adobe Media Server.
a
Double-click rootinstall/samples/videoPlayer/videoplayer.html to open it in a browser.
b
In Video Source, enter the following:
http://localhost/sample1.f4m
6
(Apple HTTP Live Streaming) On iOS, enter the following URL in the Safari address bar:
http://10.0.1.11/sample1.m3u8
To test in Safari on Mac OS 10.6, use the following HTML code:
<video src=”http://10.0.1.11/sample1.m3u8″ controls=”controls”></video>
For more information, see
HTTP Live Streaming Overview
in the iOS Reference Library.
URLs for playing on-demand streams over HTTP
Use the following URLs to play on-demand streams over HTTP:
Stream URI
Bitrate
http://10.0.1.11/hls-vod/sample1_150kbps.f4v
150
http://10.0.1.11/hls-vod/sample1_700kbps.f4v
700
http://10.0.1.11/hls-vod/sample1_1500kbps.f4v
1500
Client
Live or VOD
Single stream or Adaptive Bitrate
Request URL
Adobe HTTP Dynamic Streaming
VOD
Single stream
http://<ams-dns-or-ip>/hds-vod/<streamname>.<fileextension>.f4m
Apple HTTP Live Streaming
VOD
Single stream
http://<ams-dns-or-ip>/hls-vod/<streamname>.<fileextension>.m3u8
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 27
Getting started streaming media
Last updated 7/19/2012
The path /hds-vod is a
<Location>
directive in the Apache httpd.conf file. The directive tells the server to look for the content in the rootinstall/webroot/vod folder. It also tells the server to package the content for delivery to Flash and AIR over HTTP (called HTTP Dynamic Streaming or HDS).
The path /hls-vod is a
<Location>
directive in the Apache httpd.conf file. The directive tells the server to look for the content in the rootinstall/webroot/vod folder. It also tells the server to package the content for delivery to Apple HTTP Live Streaming.
Note: Apple HTTP Live Streaming supports live and on-demand streaming.
For adaptive bitrate streaming, the client requests a set-level manifest file. For HDS, this file is an .f4m file. For HLS, this file is a .m3u8 file. Set-level manifest files contain the paths to the physical locations of the media files. The paths to the media files must begin with /hds-vod or /hls-vod to tell the server to package them for HTTP.
More information
“Content storage (HDS and HLS)” on page
47
Stream on-demand media (RTMP)
Tutorial: Stream on-demand media (RTMP)
Prerequisites
To complete this tutorial, install the following software:
•
Adobe Media Server
You can use any edition of Adobe Media Server to stream on-demand media, including the free developer edition. For information about installing the server, see
Installing the server
.
•
Flash Player
This tutorial uses a video player that requires Flash Player 10.
To see which version of Flash Player is installed in a browser, go to
www.adobe.com/software/flash/about/
.
Adobe HTTP Dynamic Streaming
VOD
Adaptive bitrate
The media player requests a set-level manifest file:
http://<webserver-dns-or-ip>/<set-level-manifest>.f4m
The URLs in the set-level manifest point to the individual streams and use the following URL:
http://<ams-dns-or-ip>/hds-vod/<streamname>.<fileextension>.f4m
Apple HTTP Live Streaming
VOD
Adaptive bitrate
The media player requests a set-level variant playlist file:
http://<webserver-dns-or-ip>/<set-level-variant-playlist>.m3u8
The URLs in the set-level variant playlist point to the individual streams and use the following URL:
http://<ams-dns-or-ip>/hls-vod/<streamname>.<fileextension>.m3u8
Client Live or
VOD
Single stream or
Adaptive Bitrate
Request URL
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 28
Getting started streaming media
Last updated 7/19/2012
Copy on-demand files to Adobe Media Server
Use the vod (video on demand) service on Adobe Media Server to stream recorded media to clients. Simply copy recorded media files to the server and clients can stream them. The vod service streams files to media players from the following two folders:
rootinstall/applications/vod/media
rootinstall/webroot/vod
You can also create subfolders of these folders to hold media files. This tutorial creates a subfolder and copies a file to the subfolder to stream.
1
Browse to the following folder:
rootinstall/applications/vod/media
Note: Replace rootinstall with the Adobe Media Server installation folder. For example, on Windows the default installation folder is C:\Program Files\Adobe\Adobe Media Server 5.
2
Create the folder “tests” in the “media” folder, as follows:
rootinstall/applications/vod/media/tests
3
Copy an F4V/MP4 or FLV file to the /tests folder.
This tutorial uses the following file:
rootinstall/applications/vod/media/tests/polymorphics.f4v
If you don’t have a video file, you can download a file from the Moving Images Archive at
www.archive.org/details/movies
. You can also use a sample file included with the server. For learning purposes,
copy a sample file from rootinstall/applications/vod/media to rootinstall/applications/vod/media/tests.
For information about supported file formats and codecs, see
Supported file formats
.
Use the Adobe Media Server sample player to play an on-demand file
1
To open the sample video player in a browser, double-click the rootinstall/samples/videoPlayer/videoplayer.html file.
2
Enter the address of the video in the STREAM URL textbox, check VOD, and click PLAY STREAM. This tutorial plays the following file:
rtmp://localhost/vod/mp4:tests/polymorphics.f4v
If you’re using a Adobe Media Server hosting provider, replace localhost with the domain name or IP address of the server that they provided.
Important: Although you copy the media file to the vod/media folder, you do not need to specify /media in the path when you play the file. The server is configured by default to look for media files in the vod/media folder. If you specify /media in the path, the server looks in the /vod/media/media folder.
Begin paths to F4V/MP4 files with the prefix
mp4:
. Use the filename extension of the file, whether it’s F4V, MP4, MOV, and so on.
Use Flash Media Playback to play an on-demand stream
1
Load the Flash Media Playback Setup page in a web browser:
www.osmf.org/configurator/fmp/
.
2
Enter the Video Source:
rtmp://localhost/vod/mp4:tests/polymorphics.f4v
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 29
Getting started streaming media
Last updated 7/19/2012
You can replace localhost with the domain name or IP address of the server.
3
Click Preview to update the embed code.
4
Click the Play button to test the code.
5
To use the player in your own HTML page, copy the embed code and paste it into the body of the page. Flash Media Playback is a compiled SWF file hosted by Adobe. For more information, see
“Play media in Flash Media Playback”
on page
4
.
More Help topics
“Supported file formats and codecs” on page
2
“Troubleshoot issues with streaming media” on page
90
“Stream on-demand media (HTTP)” on page
22
URLs for playing on-demand media files over RTMP
After completing the tutorial once, learn more about how to build a URL that requests a file from the server. Run through the tutorial again using different files and different paths.
The syntax for requesting a file from Adobe Media Server is as follows:
protocol://server-domain-or-IP/ams-app-name/[ams-app-instance-name/][codec-prefix:]file-path[filename-extension]
Element
Required
Description
protocol
Yes
The protocol for media delivery. For information about the protocols Adobe Media Server supports, see
RTMP, RTMFP, and
HTTP
in the Technical Overview.
server-domain-or-IP
Yes
The domain name or IP address of the computer hosting Adobe Media Server. If the client is on the same computer as Adobe Media Server, you can use localhost for testing purposes.
ams-app-name
Yes
The Adobe Media Server application that the client connects to. The default folder that holds Adobe Media Server applications is rootinstall/applications. This tutorial uses the application rootinstall/applications/vod.
ams-app-instance-name
No
Applications can have an unlimited number of instances. For example, you could have clients connect to rtmp://localhost/vod/instance1, rtmp://localhost/vod/instance2, and so on.
codec-prefix
Required for F4V/MP4 and MP3 files
The F4V/MP4 and MP3 file formats require a codec prefix in the request URL. For F4V/MP4 files, use the prefix
mp4:
. For MP3 files, use the prefix
mp3:
. FLV files do not require a codec prefix.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 30
Getting started streaming media
Last updated 7/19/2012
Use the following addresses to stream on-demand media files over RTMP:
To download a file progressively over HTTP from the Apache web server installed with Adobe Media Server, use a standard HTTP address. The following file is in the rootinstall/webroot/vod folder:
http://server-domain-or-IP/vod/filename.xxx
Note: To use localhost over HTTP, append the port number 8134, for example, http://localhost:8134/vod/video.f4v. The server uses port 8134 internally for HTTP.
Configure the location of media files
Two parameters in the rootinstall/conf/ams.ini file determine the locations of the folders in which the vod application looks for media files:
VOD_COMMON_DIR = C:\Program Files\Adobe\Adobe Media Server 5\webroot\vod
VOD_DIR = C:\Program Files\Adobe\Adobe Media Server 5\applications\vod\media
When a client connects to the vod application and plays a file, the server looks for the file in these two folders.
Files in the folder specified in the
VOD_DIR
parameter can stream over RTMP only.
Files in the folder specified in the
VOD_COMMON_DIR
parameter can stream over RTMP and can download progressively over HTTP. Write code in the client that checks for a successful NetConnection to the server over RTMP. If the client doesn’t connect successfully, write code that requests the file over HTTP. The server does not automatically fall back to HTTP.
file-path
Yes
The path from the folder configured to hold media files to the media file. For the vod application, the following folders are configured to hold media files:
rootinstall/applications/vod/media
rootinstall/webroot/vod
In the tutorial, the request URL is: rtmp://localhost/vod/mp4:tests/polymorphics.f4v. The file-path is tests/polymorphics.
If the file polymorphics.f4v were in the /vod/media folder instead of in the /vod/media/tests folder, the full request URL would be rtmp://localhost/vod/mp4:polymorphics.f4v. The file-path would be polymorphics.
Configure the folders to hold media files in the rootinstall/conf/ams.ini file.
filename-extension
Required for F4V/MP4 and MP3 files.
Use the filename extension of the file you want to play. For example, if the file is an F4V file, use .f4v. If the file is an MOV file, use .mov.
File format
Address
F4V
rtmp://server-domain-or-IP/vod/mp4:filename
rtmp://server-domain-or-IP/vod/mp4:filename.f4v
rtmp://server-domain-or-IP/vod/mp4:subfolder/fileName.f4v
FLV
rtmp://server-domain-or-IP/vod/filename
rtmp://server-domain-or-IP/vod/filename.flv
Element Required Description
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 31
Getting started streaming media
Last updated 7/19/2012
Important: Although you copy media to the vod/media folder, do not specify /media in the path when you play the file. The server is configured by default to look for media in the vod/media folder. If you specify /media in the path, the server looks in the /vod/media/media folder.
Change the storage location of media files
1
Open the rootinstall/conf/ams.ini file in a text editor.
2
Edit the
VOD_DIR
and
VOD_COMMON_DIR
parameters.
3
Restart Adobe Media Server.
Add new media storage locations
1
Open the rootinstall/conf/ams.ini file in a text editor.
2
Add a new parameter and point it to the desired location, for example:
VOD_DIR_2 = C:\hrvideos
3
Open the rootinstall/applications/vod/Application.xml file in a text editor.
The parameters in the ams.ini file are used in the Application.xml configuration file.
<Application>
<StreamManager>
<VirtualDirectory>
<Streams>/;${VOD_COMMON_DIR}</Streams>
<Streams>/;${VOD_DIR}</Streams>
</VirtualDirectory>
</StreamManager>
4
Add a
<Streams>
tag with the new parameter, for example:
<Streams>/hr;${VOD_DIR_2}</Streams>
To play streams stored in this folder, use the following address:
rtmp://localhost/vod/hr/mp4:somefilename.f4v
The
<Streams>
tag tells the server to look for media in the location specified in the
VOD_DIR_2
parameter if the media path starts with /hr.
5
Restart Adobe Media Server.
Duplicate the vod service
The server supports an unlimited number of instances of the vod service.
1
Duplicate the rootinstall/applications/vod folder in the applications folder and give it a new name, for example, vod2. In this case, the new vod service is located at rootinstall/applications/vod2.
You can create as many instances of the vod service as you need.
2
Clients can connect to the vod service at the URL
rtmp://
adobemediaserver
/vod2
.
3
Open the ams.ini file (located in rootinstall/conf) and do the following:
•
Add a parameter to set the content path for the new service, for example:
VOD2_DIR = C:\Program Files\Adobe\Adobe Media Server 5\applications\vod2\media
.
•
If you installed Apache and want the media files to be available over HTTP, add a new
VOD2_COMMON_DIR
parameter:
VOD2_COMMON_DIR = C:\Program Files\Adobe\Adobe Media Server 5\webroot\vod2
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 32
Getting started streaming media
Last updated 7/19/2012
4
Open the Application.xml file in the rootinstall/applications/vod2 folder and do the following:
•
Edit the virtual directory to the following:
<Streams>/;${VOD2_DIR}</Streams>
.
•
Edit the virtual directory to the following:
<Streams>/;${VOD2_COMMON_DIR}</Streams>
.
5
Place recorded media files into the following locations:
•
Place files that stream only over RTMP in the C:\Program Files\Adobe\Adobe Media Server 5\applications\vod\media folder.
•
Place files that stream over RTMP or HTTP in the C:\Program Files\Adobe\Adobe Media Server 5\webroot\vod2.
Note: You do not have to specify the media folder in the URL; the media folder is specified in the path you set in the ams.ini file.
Modify server-side code in the vod service
Note: You cannot modify server-side code in the live service on Adobe Media Server Standard.
❖
Remove the rootinstall/applications/vod/main.far file and replace it with the rootinstall/samples/applications/vod/main.asc file.
Disable the vod service
❖
Move any vod service folders out of the rootinstall/applications folder.
Stream on-demand encrypted media (pRTMP)
Use protected RTMP (pRTMP) to encrypt and deliver on-demand content to Flash Player and AIR.
Note: Protected RTMP isn’t a protocol. It delivers encrypted content over the RTMP protocol.
System requirements
Protected RTMP is supported in origin-only configurations. Unlike RTMPE, pRTMP does not work in an edge-origin configuration.
Applications that share media files must use the same protected RTMP configuration settings for the shared files.
Flash Player 11.0 and AIR 3.0 are required to play protected RTMP content. Protected RTMP supports all the on-demand
file formats and codecs
that RTMP supports except F4M, RAW, and F4F.
Note: In Adobe Media Server 5, protected RTMP is supported for VOD streaming, it is not supported for live streaming.
About protected RTMP
Adobe Media Server encrypts on-demand media files and embeds a Adobe Access 3.0 license in the DRM metadata of the content. Flash Player and AIR clients communicate with Adobe Media Server to play the media. Protected RTMP does not require a license server; the license is embedded in the content metadata and a client receives it along with the media.
Protected RTMP is more secure than RTMPE because it uses Adobe Access 3.0 DRM content protection. Protected RTMP encrypts the content whereas RTMPE protects the communication channel.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 33
Getting started streaming media
Last updated 7/19/2012
Because the content is encrypted, unauthorized replay is impossible. Protected RTMP content can be decrypted only by Flash Player and AIR clients that have the Protected Streaming private key.
There is no way to use an RTMPE connection between servers and decrypt the content on Adobe Media Server. Different applications that access common media files must have consistent setup with respect to Protected RTMP. That is, you should not access the same media file over both protected and unprotected RTMP.
Separate applications that include common media files must have consistent settings with respect to Protected RTMP. When AMS receives requests for media file playback (VOD) it applies the application-specified protection to the media and then caches it in memory. Each time the server receives a new request for an already cached media file it compares the protection settings of the cached media with the settings of the application in the new request. If those settings are inconsistent AMS replaces the cached media with content processed according to the settings of the application of the current request and then sends the media to the client. AMS generates an error log entry every time it identifies inconsistency between cached media settings and requested media settings.
Protected RTMP simplifies deployment and increases security because:
•
Adobe Media Server is the only server required.
•
No license server is required.
•
No domain server is required.
•
All media can be packaged with the same common key.
•
Content is encrypted with Adobe Access 3.0 DRM protection.
•
Protected RTMP uses 128-bit AES encryption. RTMPE uses 128-bit RC4.
Configure protected RTMP at the vhost, application, or application instance level. Use the Application.xml file, Server-Side ActionScript, and the Authorization Plug-in to configure protected RTMP.
Note: The DRM used for Protected RTMP is the same DRM used for Protected HTTP streaming..
Quick start: Use protected RTMP to play on-demand media
To complete this tutorial, install the following software:
•
Adobe Media Server 5
For information about installing the server, see
Installing the server
.
•
Flash Player 11
This tutorial requires Flash Player 11.
Configure protected RTMP on Adobe Media Server
1
Configure protected RTMP for the VOD application.
2
Open amsrootinstall/applications/vod/Application.xml in a text editor.
3
Add the
<ProtectedRTMP enabled=”true”></ProtectedRTMP>
element. The Application.xml file looks like this:
<Application>
<ProtectedRTMP enabled=”true”></ProtectedRTMP>
…
</Application>
4
Save and close the file.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 34
Getting started streaming media
Last updated 7/19/2012
5
If the VOD application is running, close it to reload the Application.xml file. If the Adobe Media Server Start Screen is open, the VOD application is running. Closing the Start Screen closes the VOD application (unless another client is also connected to the VOD application).
Play on-demand media
1
Double-click the Adobe Media Server Sample Video Player to open it in a browser: amsrootinstall/samples/videoPlayer/videoplayer.html.
2
Click any link in the /applications/vod/media list. Every file that the VOD application streams uses protected RTMP.
Configure protected RTMP
You can configure protected RTMP in the following locations:
•
Application.xml file:
•
Configure the Application.xml file in an application folder to configure pRTMP for a single application.
•
Configure the Application.xml file in a vhost folder to configure pRTMP for all applications in a virtual host.
•
Server-Side ActionScript:
•
Set properties on the application object.
•
Authorization plug-in:
•
Set fields in the in the
E_APPSTART
event of the Authorization plug-in.
Use the Application.xml file to configure protected RTMP
To configure protected RTMP, add a
<ProtectedRTMP>
section to the Application.xml file at the application level or at the vhost level and set the enabled attribute to
“true”
. The other pRTMP parameters have default values. You can use the default values or set the parameters to new values. The following is a sample
<ProtectedRTMP>
section:
<Application>
<ProtectedRTMP enabled=”true”>
<CommonKeyFile>creds/common-key.bin</CommonKeyFile>
<UpdateInterval>60</UpdateInterval>
<SWFVerification enabled=”true”>
<WhiteListFolder>whitelists</WhiteListFolder>
</SWFVerification>
</ProtectedRTMP>
</Application>
Use the following parameters in an Application.xml file to configure protected RTMP:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 35
Getting started streaming media
Last updated 7/19/2012
Use the Authorization plug-in to configure protected RTMP
To configure protected RTMP at the plug-in level, write code in the
E_APPSTART
event to set the
F_APP_PRTMP
field to true. The other pRTMP fields have default values. You can use the default values or set the fields to new values. Protected RTMP settings in the Application.xml file are overridden in the Authorization plug-in.
The
E_APPSTART
event is an application-level event that supports reading all application-level fields, including the following:
The
E_APPSTART
event supports the following new fields for protected RTMP:
Parameter
Description
Default
CommonKeyFile
A relative path to a file containing a base key. The path is relative to the folder that contains the Application.xml file.
The server generates the base key file during installation. The server uses the base key (along with the content ID) to generate the final content encryption key. The key data is scrambled and Base64 encoded using the scramble tool. The server generates the content ID automatically.
rootinstall/creds/common-key.bin
UpdateInterval
Optional configuration that specifies how often (in minutes) the server updates the DRM metadata.
60
SWFVerification
Container for SWFVerification. To enable SWF verification, set the
enabled
attribute to
“true”
.
“false”
WhiteListFolder
The folder that contains the SWF whitelist for SWF verification. The folder can contain more than one whitelist file. Relative paths are relative to the application folder.
The folder containing the application folder.
Field
Description
Read/Write
F_APP_URI
The URI of the application to which the client connected. The value does not include the server name or port information.
Read-only
F_APP_NAME
The application name.
Read-only
F_APP_NAME
The application instance name.
Read-only
Field
Description
Read/Write
F_APP_PRTMP
A Boolean value indicating whether RTMP streaming is protected.
Read/Write
F_APP_PRTMP_COMMON_KEY_FILE
A string to specify the path to the common key file. The path can be absolute or relative. Relative paths are relative to the location of the application folder.
Read/Write
F_APP_PRTMP_UPDATE_INTERVAL
A number to specify how often (in minutes) the DRM metadata will be updated.
Read/Write
F_APP_PRTMP_SWF_VERIFICATION
A Boolean value indicating whether SWF Verification is enabled.
Read/Write
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 36
Getting started streaming media
Last updated 7/19/2012
The
E_PRTMP_WHITELIST
event is an application-level event that AMS calls every n minutes (according to the update interval), enabling you to update the SWF/AIR whitelists through the
F_APP_PRTMP_SWF_WHITELIST
and
F_APP_PRTMP_AIR_WHITELIST
fields.
Use Server-side ActionScript to configure protected RTMP
Use the following Server-side ActionScript properties to configure protected RTMP:
Note: The
prtmpCommonKeyFile
and
prtmpSwfWhitelistFolder
properties specify a path to a file or folder. The server resolves relative paths to an application directory.
These properties are filled in by values retrieved from configuration files during the
application.onAppStart()
event. You can also set values in this event, as follows:
F_APP_PRTMP_SWF_WHITELIST_FOLDER
A string to specify the path to the whitelist folder for SWF verification.
The path can be absolute or relative. Relative paths are relative to the location of the application folder.
Read/Write
F_APP_PRTMP_SWF_WHITELIST
A string containing one or more SWF digests, separated by ‘\n’. SWF digests are sha256 hashes of the SWF, base64 encoded. You generate a whitelist using the whitelist tool that ships with AMS. This string can also contain the comments and empty lines that are in the whitelist generated by the tool, which are ignored.
Read/Write
F_APP_PRTMP_AIR_WHITELIST
A string containing one or more AIR identifiers, separated by ‘\n’. AIR identifiers are derived from the signature.xml file that is used to sign an AIR app. You generate a whitelist using the whitelist tool that ships with AMS. This string can also contain the comments and empty lines that are in the whitelist generated by the tool, which are ignored.
Read/Write
Property
Data type
application.prtmpEnabled
Boolean
application.prtmpCommonKeyFile
String
application.prtmpUpdateInterval
Int
application.prtmpSWFVEnabled
Boolean
application.prtmpSwfWhitelistFolder
String
Field Description Read/Write
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 37
Getting started streaming media
Last updated 7/19/2012
application.onAppStart = function()
{
trace (“———-prtmp on start———-“);
trac e(“prtmp ” + application.prtmpEnabled);
trace(“prtmpCommonKeyFile ” + application.prtmpCommonKeyFile);
trace(“prtmpUpdateInterval ” + application.prtmpUpdateInterval);
trace(“prtmpSwfVerification ” + application.prtmpSWFVEnabled);
trace(“prtmpSwfWhitelist ” + application.prtmpSwfWhitelistFolder);
trace (“————prtmp on start——- -“);
application.prtmpEnabled = false;
application.prtmpCommonKeyFile = “TEST “;
application.prtmpUpdateInterval = 12000 ;
application.prtmpSWFVEnabled = true;
application.prtmpSwfWhitelistFolder = “”;
}
Trace the new values in the
application.onConnect()
event:
{
trace(“———-prtmp on connect———-“);
trace(“prtmp ” + application.prtmpEnabled);
trace(“prtmpCommonKeyFile ” + application.prtmpCommonKeyFile);
trace(“prtmpUpdateInterval ” + application.prtmpUpdateInterval);
trace(“prtmpSwfVerification ” + application.prtmpSWFVEnabled);
trace(“prtmpSwfWhitelist ” + application.prtmpSwfWhitelistFolder);
trace(“————prtmp on connect——–“);
}
The previous code prints an application.log file similar to the following:
#Version: 1.0
#Start-Date: 2011-10-19 12:20:41
#Software: Adobe Media Server 5 d430 x64
#Date: 2011-10-19
#Fields: date time x-pid x-status x-ctx x-comment
2011-10-19 12:20:41 7832 (s)2641173 ———-prtmp on start———- –
2011-10-19 12:20:41 7832 (s)2641173 prtmp true –
2011-10-19 12:20:41 7832 (s)2641173 prtmpCommonKeyFile c:\Program Files\Adobe\Adobe Media Server 5\conf\_defaultRoot_\_defaultVHost_\streamtest\creds\common-key.bin –
2011-10-19 12:20:41 7832 (s)2641173 prtmpUpdateInterval 3600000 –
2011-10-19 12:20:41 7832 (s)2641173 prtmpSwfVerification false –
2011-10-19 12:20:41 7832 (s)2641173 prtmpSwfWhitelist c:\Program Files\Adobe\Adobe Media Server 5\conf\_defaultRoot_\_defaultVHost_\streamtest –
2011-10-19 12:20:41 7832 (s)2641173 ————prtmp on start——– –
2011-10-19 12:20:41 7832 (s)2641173 ———-prtmp on connect———- –
2011-10-19 12:20:41 7832 (s)2641173 prtmp false –
2011-10-19 12:20:42 7832 (s)2641173 prtmpCommonKeyFile c: \Program Files\Adobe\Adobe Media Server 5\conf\_defaultRoot_\_defaultVHost_\streamtest\TEST –
2011-10-19 12:20:42 7832 (s)2641173 prtmpUpdateInterval 12000 –
2011-10-19 12:20:42 7832 (s)2641173 prtmpSwfVerification true –
2011-10-19 12:20:42 7832 (s)2641173 prtmpSwfWhitelist c:\Program Files\Adobe\Adobe Media Server 5\WhiteListFolder –
2011-10-19 12:20:42 7832 (s)2641173 ————prtmp on connect——– –
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 38
Getting started streaming media
Last updated 7/19/2012
Tune server performance
The pRTMP operations that use the most CPU power are generating the DRM metadata and generating a license. Adobe Media Server generates DRM metadata the first time a client requests a media file. The server caches the metadata and reuses it for subsequent request for the same media file.
The media license in the DRM metadata imposes a 24-hour time limit on media playback from the point at which the license was generated. Therefore, the server refreshes the license periodically and generates new DRM metadata with a new time-stamp. Configure the
<UpdateInterval>
parameter to control how often the server generates DRM metadata. The default value is 60 minutes. To use less CPU power, generate the license less frequently.
Certificates and policy files
All certificates and the policy file for protected RTMP are installed to the Adobe Media Server rootinstall/creds folder.
Add Protected Streaming certificates
Adobe Media Server uses Protected Streaming certificates (.cer files) for protected RTMP. The server installs with three Protected Streaming certificates. It uses different certificates for desktop, mobile, and set-top.
In the event of a security breach, Adobe will release a security alert telling you to download new Protected Streaming certificates.
To add a Protected Streaming certificate, copy it to the
rootinstall/creds/sd
folder.
Understand static security files
The following files are installed with Adobe Media Server to the
rootinstall/creds/static
folder. Do not replace or modify these files.
Policy file
Adobe Media Server installs with the policy file rootinstall/creds/static/creds_24hr_policy.pol. The policy is set as:
anonymous; not use license chaining; 24 hours limited license caching; and Protected Streaming is permitted.
This policy file lets clients start playing content within 24 hours from when the server generated the DRM metadata. Users can continue watching the content until the end, even if that time is beyond the 24 hour window. The 24 hour window starts when the server generates the DRM metadata and stores it in a cache. The
<UpdateInterval>
parameter in the Application.xml file determines the frequency at which the server generates DRM metadata. The default value is 60 minutes.
License server certificate
An Adobe-issued DER-encoded license server certificate. The license server certificate specifies the private key used to sign the license.
Transport certificate
An Adobe-issued DER-encoded X.509 transport certificate file. The transport certificate file is used when the client communicates with a server (for example, an authentication server). This feature is not supported in Adobe Media Server 5 but the certificate is still required.
Packager credential
An Adobe-issued packager server credential (a certificate and its associated key) PFX file. The server uses this file to apply a signature to the metadata while encrypting content files.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 39
Getting started streaming media
Last updated 7/19/2012
Multicast media (RTMFP)
About the multicast service
Adobe Media Server 4.0, Flash Player 10.1
Important: The Multicast service (rootinstall/applications/multicast) does not run on Adobe Media Server Standard.
The multicast service is part of the Adobe Media Server multicast solution. The multicast solution is an end-to-end solution for live, corporate, multicast events. The multicast solution delivers a single, live stream to Flash Player clients over IP multicast, P2P multicast, and the combination of both (called fusion multicast).
The multicast solution consists of the following components:
•
The multicast config tool (rootinstall/tools/multicast/configurator)
Collects information to describe and configure a multicast event. Generates a live stream name to copy and paste into Flash Media Live Encoder that embeds required multicast event settings as parameters within the stream name’s query string. Generates a manifest.f4m file that you copy to the same folder as the multicast player.
•
Flash Media Live Encoder
Captures, encodes, and publishes the live video to the multicast service on the Adobe Media Server.
•
The multicast service (rootinstall/applications/multicast)
A server-side Adobe Media Server application that republishes the live stream as a multicast stream into a target RTMFP Group.
•
The multicast player (rootinstall/tools/multicast/multicastplayer)
A client-side Flash Player application that connects to the multicast service, joins the group, and plays the live stream.
Configure the multicast event
Do the following to configure the multicast event:
1
Open rootinstall/tools/multicast/configurator/configurator.html in a browser.
2
Select one of the following multicast types:
•
Fusion (simultaneous, cooperative IP and P2P multicast)
•
IP Multicast
•
Peer to Peer
•
Peer to Peer with Peer Discovery
Note: The tool contains descriptions of each type.
3
For Fusion and Peer to Peer, enter the server name (or IP address) and the full path to the multicast application, for example, rtmfp://ams.example.com/multicast. If the server is configured to use a port other than 1935, specify the port, for example, rtmfp://ams.example.com:1940/multicast.
Note: IP Multicast events do not require a connection URI. IP Multicast events use the URI
rtmfp:
which puts the NetConnection object in “connectionless” mode.
4
Enter the name of the live stream, for example, CorpAllHandsQ2_2010, or livestream.
5
Enter a publish password.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 40
Getting started streaming media
Last updated 7/19/2012
The password ensures that only the multicast server can publish a multicast stream into the group. Other peers do not have the publish password and can only play the stream, not publish a stream.
6
Enter a name for the group. To make the group name unique, select Make Unique.
Use unique group names for streaming events occuring at the same time.
7
For IP Multicast and Fusion, enter an IP multicast address and port to use for the live event. This is the address and port to which the live stream is broadcast.
Note: Get the IP multicast address from your IT department. The IT department sets up the multicast router and multicast address. The multicast address delivers data to all members of the group on the network.
8
(Optional) If the server hosting Adobe Media Server has more than one network interface card (NIC), enter the IP address for one NIC in the Interface Address text box. Adobe Media Server uses this IP address to determine the appropriate interface to use when publishing.
9
(Optional) To use
source-specific multicast
, enter an IP address and port in the Source-specific Multicast Address
text box. For more information, see
“Source-specific IP multicast” on page
239
.
10
Click Generate. The multicast config tool generates the following:
•
A name for the live stream. To publish a stream, you’ll click Copy and paste this value into the Flash Media Live Encoder Stream field.
•
An F4M file to use with the client multicast player. To view the F4M file, click View Manifest File.
This tutorial uses the following settings:
11
To use the Multicast Sample Player, do the following:
a
Click Save Manifest File.
b
Save the manifest.f4m file to the same location as the multicastplayer.html and multicastplayer.swf files. By default, this location is rootinstall/tools/multicast/multicastplayer.
12
To use Strobe Media Playback, leave the Configurator open. After you set up Strobe Media Playback, you will return to the Configurator and save the manifest.f4m file to the same folder as Strobe Media Playback.
Publish a stream from Flash Media Live Encoder
1
Launch Flash Media Live Encoder 3.1 or later and do the following:
2
From the Preset menu, select a single stream preset. The multicast solution does not support multi-bitrate streaming.
3
For AMS URL, enter the URL of the multicast service. If you’re testing on the same computer that Adobe Media Server is running on, enter rtmp://localhost/multicast.
Note: Flash Media Live Encoder connects to Adobe Media Server over the RTMP protocol, not over the RTMFP protocol.
4
Paste the Publisher Stream Name you copied from the Multicast Config Tool to the Stream field.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 41
Getting started streaming media
Last updated 7/19/2012
Flash Media Live Encoder configured to stream to the multicast application
5
Click Start to connect to the multicast service and start streaming.
6
Launch the Adobe Media Server Administration Console and click on View Applications > Clients. The RTMP client is the connection from FMLE to the server. The RTMFP client is a server-side peer established by the multicast service to republish the live stream into the target RTMFP Group.
Play a multicast stream
Play a stream in the multicast sample player:
1
Open rootinstall/tools/multicast/multicastplayer/multicastplayer.html in a browser.
2
To run Flash Player from the local file system, right-click on the screen, choose Global Settings, and do one of the following:
•
On the Flash Player Help page, from the list in the top left, choose Global Security Settings panel. Click Edit locations > Add location > Browse for folder. Select folder containing the multicastplayer.swf file (rootinstall/tools/multicast/multicastplayer).
•
In the Flash Player Settings Manager, choose Advanced and click Trusted Location Settings. Click Add, browse to the folder containing the multicastplayer.swf file (rootinstall/tools/multicast/multicastplayer). Click Confirm.
3
Reload the multicastplayer.html file in the browser. The Adobe Flash Player Settings manager displays a Peer Assisted Networking dialog. Click Allow to allow the peer-to-peer connection.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 42
Getting started streaming media
Last updated 7/19/2012
The multicastplayer plays the stream that Flash Media Live Encoder is publishing.
4
Open the Adobe Media Administration Console to see the new client connection.
Play a stream in the Adobe Media Server sample video player
1
Double-click rootinstall/samples/videoPlayer/videoplayer.html to open the sample video player in a browser.
The Adobe Media Server sample video player is built on OSMF Strobe Media Player 1.6.
2
Copy the manifest.f4m file you generated using the Multicast Config Tool from the rootinstall/tools/multicast/configurator folder to the rootinstall/samples/videoPlayer folder. Both the multicast sample player and the Adobe Media Server sample player must use the same manifest file.
3
In the sample video player, in the Stream URL text box, enter manifest.f4m. Click Play.
4
Open the Adobe Media Administration Console to see the new client connection. There are now 4 connections: 1 from Flash Media Live Encoder (RTMP), 1 from the multicast application publishing into the group (RTMFP), 1 from the multicast sample player, (RMTFP), and 1 from the Adobe Media Server sample video player (RTMFP).
More Help topics
“Building peer-assisted networking applications” on page
230
“Troubleshoot issues with streaming media” on page
90
Configuring content protection
See
“Content protection” on page
94
.
Configure HTTP Dynamic Streaming and HTTP Live Streaming
Overview of HTTP Dynamic Streaming and HTTP Live Streaming
Streaming media over HTTP
Delivering content over HTTP is usually called “progressive download”. The content must transfer from the server to the client in a progression from the beginning to the end of a file. A client cannot seek to a forward location until that location and all the data before it has downloaded.
Delivering content over RTMP is called “streaming”. The client creates a socket connection to the server (such as Adobe Media Server) over which the content is sent in a continuous stream. The client can seek to any point in the content instantly, regardless of how much data has been transferred.
Adobe HTTP Dynamic Streaming combines these approaches to introduce HTTP streaming to the Flash Platform. HTTP Dynamic Streaming packages media files into fragments that Flash Player clients can access instantly without downloading the entire file. Adobe HTTP Dynamic Streaming contains several components that work together to package media and stream it over HTTP to Flash Player and AIR. HTTP Dynamic Streaming supports multi-bitrate streaming, DVR, and Adobe® Flash® Access™ protection.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 43
Getting started streaming media
Last updated 7/19/2012
In Adobe Media Server 5, Adobe HTTP Dynamic Streaming adds support for Apple HTTP Live Streaming. Use the same HTTP Dynamic Streaming workflow to package and stream live and on-demand content to all devices that support Apple HTTP Live Streaming. Apple HTTP Live Streaming includes live and on-demand media.
Note: Adobe Media Server does not support adding Timed Metadata for HTTP Live Streaming.
HTTP Dynamic Streaming components
The Adobe HTTP Streaming solution contains the following components:
Live Packager
Live Packager is a Adobe Media Server application installed to rootinstall/applications/livepkgr. The server ingests a live stream over RTMP and the Live Packager translates it into F4F files and MPEG-2 TS files in real-time.
F4F HTTP Module
An Apache HTTP Server module that serves files to Flash Player and AIR. The F4F module (also known as the HTTP Origin Module), serves live content. It also serves on-demand content that was packaged offline with the File Packager tool.
The F4F HTTP Module installs with Adobe Media Server 4 and later to rootinstall/Apache2.2/modules/mod_f4fhttp.so. The module is also available from
adobe.com
as a stand-alone Apache
module.
HLS HTTP Module
An Apache HTTP Server module that serves files to iOS devices and Mac OS.
The HTTP HLS Module installs with Adobe Media Server 5 and later to rootinstall/Apache2.2/modules/mod_hlshttp.so. It is not available as a stand-alone Apache module.
JIT HTTP Module
An Apache HTTP Server module that packages on-demand files just-in-time and serves them to Flash Player and AIR. “Just-in-time” means that media files are packaged in real-time when clients request them.
The JIT HTTP Module installs with Adobe Media Server 5 and later to rootinstall/Apache2.2/modules/mod_jithttp.so. It is not available as a stand-alone Apache module.
File Packager
A command-line, offline tool that translates on-demand media into F4F fragments. The File Packager is located in the rootinstall/tools/f4fpackager folder and is available from
adobe.com
.
OSMF media players
There are several media players built on the Open Source Media Framework (OSMF) that support HTTP Dynamic Streaming to Flash Player and AIR. See
“Pre-built media players” on page
3
.
F4F File Format Specification
The F4F file format describes how to divide media content into segments and fragments. The Live Packager, the File Packager, and the JIT HTTP module output content based on this specification. Each fragment has its own bootstrap information that provides cache management and fast seeking. For more information, see
F4F File Format Specification
.
F4M File Format Specification
The Adobe Media Manifest file format contains information about a package of files that the HTTP Origin Module can serve. Manifest information includes codecs, resolutions, and the availability of files encoded at multiple bit rates. Manifest information also includes DRM data. The media player uses the F4M file to play a piece of media. For more information, see
F4M File Format Specification
.
Adobe Access
Adobe Access delivers protected media to Flash Player. To use HTTP Dynamic Streaming with Adobe Access, use the File Packager and Adobe Media Server to both package and encrypt content. For more information, see
Protecting content with Adobe Access
.
Adobe Media Server 5 adds support for Adobe Access level protection without using a Adobe Access server.
Workflow for streaming live media over HTTP
The best way to experience the workflow for live HTTP streaming is to complete a tutorial. See
“Stream live media
(HTTP)” on page
5
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 44
Getting started streaming media
Last updated 7/19/2012
The following is the workflow for all Adobe HTTP Dynamic Streaming and Apple HTTP Live Streaming use cases:
1
Use the default live event or create a live event.
The default live event is rootinstall/applications/livepkgr/events/_definst_/liveevent. Each live event contains configuration settings for one set of content. For more information, see
“Create and configure live events” on
page
45
.
2
(Optional) To configure multi-bitrate streaming, use the Set-level F4M/M3U8 File Generator tool to generate an set-level manifest file. The set-level manifest file contains information about each stream. See
“Publish and play live
multi-bitrate streams over HTTP” on page
10
.
3
(Optional) To configure DVR for Adobe HTTP Dynamic Streaming, create a set-level manifest file.
To configure a Sliding Window for Apple HTTP Live Streaming, configure the httpd.conf, Application.xml, or Event.xml file.
See
“Configure DVR (HDS)” on page
16
and
“Configure a sliding window (HLS)” on page
16
.
4
(Optional—Adobe HTTP Dynamic Streaming) To encrypt content for protected HDS, see
“Configuring content
protection for HDS” on page
94
.
To encrypt content for use with Adobe Access, edit the Event.xml file. See
“Encrypt content for Adobe Access
protection” on page
63
.
5
(Optional—Apple HTTP Live Streaming) To encrypt content for Apple HTTP Live Streaming, see
Configuring
content protection for HLS
.
6
Create a crossdomain.xml file and copy it to the rootinstall\webroot folder.
A crossdomain.xml file allows Flash Player clients hosted on other domains to access data from this domain. For more information, see
Website controls (policy files)
in the ActionScript 3.0 Developer’s Guide.
7
Publish a stream to the server.
8
(Adobe HTTP Dynamic Streaming) Use Strobe Media Playback to play media. Strobe Media Playback is installed with Adobe Media Server.
9
(Apple HTTP Live Streaming) Play the content on iOS or MacOS.
For supported devices, see
Apple HTTP Live Streaming documentation
.
Workflow for streaming on-demand media over HTTP
The best way to experience the workflow for on-demand HTTP streaming is to complete a tutorial. See
“Stream on-
demand media (HTTP)” on page
22
.
The following is the workflow for Adobe HTTP Dynamic Streaming and Apple HTTP Live Streaming use cases:
1
Encode media files and copy them to the rootinstall/webroot/vod directory on Adobe Media Server.
To configure this location, see
Configure the location of content (HDS and HLS).
2
(Optional) To configure multi-bitrate streaming, use the Set-level F4M/M3U8 File Generator tool to generate a set-level manifest file. See
“Play on-demand multi-bitrate media files over HTTP” on page
24
.
3
(Optional—Adobe HTTP Dynamic Streaming) To encrypt content for protected HDS (without Adobe Access), see
“Configuring content protection for HDS” on page
94
.
To encrypt content for use with Adobe Access, edit the jit.conf file. See
“Encrypt content for Adobe Access
protection” on page
63
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 45
Getting started streaming media
Last updated 7/19/2012
4
(Optional—Apple HTTP Live Streaming) To encrypt content for Apple HTTP Live Streaming, configure the jit.conf file or the Apache httpd.conf file. See
Protect content for Apple HLS
.
5
Create a crossdomain.xml file and copy it to the rootinstall\webroot folder.
A crossdomain.xml file allows Flash Player clients hosted on other domains to access data from this domain. For more information, see
Website controls (policy files)
in the ActionScript 3.0 Developer’s Guide.
6
(Adobe HTTP Dynamic Streaming) Use Strobe Media Playback to play media. Strobe Media Playback is installed with Adobe Media Server.
7
(Apple HTTP Live Streaming) Play the content on an iOS device or on MacOS.
For supported devices, see
Apple HTTP Live Streaming documentation
.
Differences in HTTP Dynamic Streaming between Adobe Media Server 4.0 and 4.5
The following are differences in HTTP Dynamic Streaming (HDS) between Adobe Media Server 4.0 and 4.5:
•
Simplified request URLs for live streaming.
See
“Differences in HTTP live URLs from Flash Media Server 4.0 to Adobe Media Server 5” on page
16
.
•
Support for just-in-time on-demand packaging.
When a media player requests an on-demand media files from the rootinstall/webroot/vod folder using HDS, Apache packages the stream in real-time. You do not need to pre-package the media files for HTTP streaming as you did with Adobe Media Server 4.0. See
“Stream on-demand media (HTTP)” on page
22
.
•
Use a jit.conf file to configure on-demand streaming at the stream-level. Copy the jit.conf file to the same folder as the media. See
“Configure on-demand HTTP streaming” on page
78
.
•
Use set-level F4M and M3U8 files to configure a set of streams for adaptive bitrate streaming.
The set-level files describe the bitrates of the media. The live and just-in-time packagers generate stream-level F4M and M3U8 files to describe the individual pieces of media. The set-level files can live on any webserver. See
“Publish
and play live multi-bitrate streams over HTTP” on page
10
and
“Play on-demand multi-bitrate media files over
HTTP” on page
24
.
Create and configure live events
You can use the livepkgr application to serve an unlimited number of live streaming events over HTTP (for example, a debate, a sporting event, and a town hall meeting). Each live streaming event requires its own configuration settings for multi-bitrate streaming, DVR, and content protection.
A live event is a configuration level within the livepkgr application. Like a Adobe Media Server application, a live event is a folder on the server. The folder contains two configuration files: Manifest.xml and Event.xml. Use these configuration files to configure a set of streams.
Also like a Adobe Media Server application, the name of the live event folder is the name of the live event. The Adobe Media Server application that packages live content for HTTP streaming is called “livepkgr”. The livepkgr application contains a live event called “liveevent”:
rootinstall/applications/livepkgr/events/_definst_/liveevent
Note: You can configure the location of the “applications” folder. You can also configure virtual directory mappings for the “streams” folder. However, you cannot configure virtual directory mappings for the “events” folders.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 46
Getting started streaming media
Last updated 7/19/2012
Streams in a live event are packaged as fragments and written to disk. A live event (the stream content and the metadata) exists until you delete it. A media player can access the content after the source stream has stopped publishing.
Create a live event
For each live streaming event, create a live event folder.
1
Create the following “events” folder structure in the livepkgr application folder:
rootinstall/applications/livepkgr/events/applicationinstancename/liveeventname
The following is a new live event called “liveevent2”:
rootinstall/applications/livepkgr/events/_definst_/liveevent2
You can also create a live event for a different instance of the livepkgr application, as in the following:
rootinstall/applications/livepkgr/events/anotherappinstance/liveevent
2
Copy the Events.xml file from the default liveevent folder to the new folder:
rootinstall/applications/livepkgr/events/_definst_/liveevent2/Events.xml
3
Copy the Manifest.xml file from the default liveevent folder to the new folder:
rootinstall/applications/livepkgr/events/_definst_/liveevent2/Manifest.xml
4
Open the Events.xml file in a text editor and change the event name:
<Event>
<EventID>liveevent2</EventID>
<Recording>
<FragmentDuration>4000</FragmentDuration>
<SegmentDuration>400000</SegmentDuration>
<DiskManagementDuration>3</DiskManagementDuration>
<Recording>
</Event>
Configure a live event
For information about the features you can configure in the Event.xml file, see
“Configure live HTTP streaming at the
event level (Event.xml)” on page
72
.
Write server-side code to assign a stream to a live event
Important: You do not need to write server-side code for HTTP Dynamic Streaming. The livepkgr application has a Server-Side ActionScript file that assigns streams to a live event. To see the code, open rootinstall/applications/livepkgr/main.asc in a text editor. Read this section to understand the code.
The Live Packager processes streams that are prefixed with
f4f:
. Flash Media Live Encoder doesn’t support the
f4f:
prefix so you must add it to the stream name in a server-side script or in a Adobe Media Server Authorization Plug-in.
An application can contain more than one live event. For that reason, a stream published to an application is not associated with a live event by default. Use a server-side script or the Adobe Media Server Authorization Plug-in (not both) to associate a live stream with a live event. You can associate a live stream with only one live event.
Associate a stream during the publish event. When the stream is published and associated, the server creates a stream record file (.stream) for the stream in the event directory:
applications/appname/events/appinstancename/liveeventname/livestream.stream
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 47
Getting started streaming media
Last updated 7/19/2012
The stream record file contains information about the location of the packaged stream files. The HTTP Origin Module uses this information to generate an .f4m manifest file. For more information, see
“Understanding the application flow
for live HTTP Dynamic Streaming” on page
84
.
Use Server-Side ActionScript
To see an example of this code, open rootinstall/applications/livepkgr/main.asc in a text editor.
❖
In the Server-Side ActionScript code, use the
application.onPublish
event to do the following:
•
Use the
Stream.liveEvent
property to associate a live stream with a live event before the server starts recording.
•
Add the
f4f:
prefix to the stream name. This tells the server to package the stream.
•
Call
Stream.record()
to record the stream.
Use an Authorization Plug-in
To perform these tasks with an Authorization plug-in, you must write the plug-in code.
❖
In the Authorization Plug-in code, use the
E_PUBLISH
event to do the following:
•
Set the
F_STREAM_TYPE
field to
“f4f”
.
•
Set the
F_STREAM_LIVE_EVENT
field to
“liveeventname”
. This example uses “liveevent”.
•
Set the
F_STREAM_PUBLISH_TYPE
field to
0
which means “record”.
The following is sample C++ code that handles the
E_PUBLISH
event:
case IFmsAuthEvent::E_PUBLISH:
{
// The name of the FMS app to which the live stream is published.
char* pLiveApp = “livepkgr”;
// The stream type used for HTTP Dynamic Streaming.
char* pStreamType = “f4f”;
// The name of the live event defined in the livepkgr app.
char* pLiveEvent = “liveevent”;
// The Auth Plug-in affects all apps on the server.
// We only want to process streams published to the livehttp app.
char* pAppName = getStringField(m_pAev, IFmsAuthEvent::F_APP_NAME);
if (pAppName && !strncmp(pAppName, pLiveApp, strlen(pLiveApp)))
{
// Set the stream type.
setStringField(m_pAev, IFmsAuthEvent::F_STREAM_TYPE, pStreamType);
// Set the publish type to record.
//0 record, 1 append, -1 live
setI32Field(m_pAev, IFmsAuthEvent::F_STREAM_PUBLISH_TYPE, 0);
// Associate the stream with a live event.
setStringField(m_pAev, IFmsAuthEvent::F_STREAM_LIVE_EVENT, pLiveEvent);
}
}
Content storage (HDS and HLS)
Configure the beginning of the request URL
When a media player requests content from the server, it passes the server a request URL. The section of the request URL following the server name (and optional port number) is defined in the
Location
directive path in the Apache httpd.conf file. For example, the following is the Location directive for HDS on-demand streaming:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 48
Getting started streaming media
Last updated 7/19/2012
<IfModule jithttp_module>
<Location /hds-vod>
HttpStreamingJITPEnabled true
HttpStreamingContentPath “../webroot/vod”
JitFmsDirPath “..”
Options -Indexes FollowSymLinks
</Location>
</IfModule>
When Apache receives a request with the path /hds-vod, it uses the jithttp_module (just-in-time) to process the request. The jithttp_module uses the values of the directives nested within the
Location
directive.
To configure HTTP streaming for multiple tenants, or for multiple applications, add
Location
directives with different paths. The following table lists the syntax for request URLs, the
Location
directive paths are in bold:
Add a Location directive
Note: This task uses HDS on demand, but the steps apply to all types of HTTP streaming.
1
Open rootinstall/Apache2.2/conf/httpd.conf in a text editor.
2
Location the
Location
directive for the streaming type you want to edit, copy it, and paste it.
3
For example, to create a
Location
for HDS on-demand streaming, copy the /hds-vod section and paste it underneath the existing section.
<IfModule jithttp_module>
<Location /hds-vod>
HttpStreamingJITPEnabled true
HttpStreamingContentPath “../webroot/vod”
JitFmsDirPath “..”
Options -Indexes FollowSymLinks
# Uncomment the following directives to enable encryption
# for this location.
# EncryptionScope server
# ProtectionScheme phds
</Location>
</IfModule>
4
In the copied section, change the
Location
path to /flash-vod. You can also edit the
HttpStreamingContentPath
directive to change the location of the on-demand media on disk.
Streaming type
Request URL syntax
Adobe HDS live
http://<fms-dns-or-ip>/hds-live/livepkgr/<appinstname>/<eventname>/<streamname>.f4m
Apple HLS live
http://<fms-dns-or-ip>/hls-live/livepkgr/<appinstname>/<eventname>/<streamname>.m3u8
Adobe HDS on-demand with just-in-time packaging
http://<fms-dns-or-ip>/hds-vod/<streamname>.<fileextension>.f4m
Apple HLS on-demand
http://<fms-dns-or-ip>/hls-vod/<streamname>.<fileextension>.m3u8
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 49
Getting started streaming media
Last updated 7/19/2012
<IfModule jithttp_module>
<Location /flash-vod>
HttpStreamingJITPEnabled true
HttpStreamingContentPath “../webroot/vod2”
JitFmsDirPath “..”
Options -Indexes FollowSymLinks
# Uncomment the following directives to enable encryption
# for this location.
# EncryptionScope server
# ProtectionScheme phds
</Location>
</IfModule>
Note: To change the location of content for live streaming, see
“Configure the location of live HDS and HLS content”
on page
50
.
5
Create the rootinstall/webroot/vod2 folder and copy the sample1_1500kbps.f4v file to it from the /webroot/vod folder.
6
Restart Apache HTTP Server. The service name is FMSHttpd.
7
Double-click rootinstall/samples/videoPlayer/videoplayer.html to open the Adobe Media Server sample video player.
8
Enter the following in the Stream URL text box:
http://localhost/flash-vod/sample1_1500kbps.f4v.f4m
You can play any file from the /webroot/vod2 folder.
Configure the location of on-demand HDS and HLS content
To configure the location of on-demand content on disk, edit the Apache httpd.conf file. Use the following directives:
1
Open rootinstall/Apache2.2/conf/httpd.conf
2
To change the location on the server where media is stored for on-demand streaming, edit the
HttpStreamingContentPath
directive. For example, the following changes the location to c:\hds_vod_content:
Directive
Description
HttpStreamingContentPath
The root location of the streams. This value can be absolute or relative to the Apache root folder.
By default, the location for on-demand HDS and HLS is
“../webroot/vod”
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 50
Getting started streaming media
Last updated 7/19/2012
<IfModule jithttp_module>
<Location /hds-vod>
HttpStreamingJITPEnabled true
#HttpStreamingContentPath “../webroot/vod”
HttpStreamingContentPath “C:\hds_vod_content”
JitFmsDirPath “..”
Options -Indexes FollowSymLinks
# Uncomment the following directives to enable encryption
# for this location.
# EncryptionScope server
# ProtectionScheme phds
</Location>
</IfModule>
<Location /hls-vod>
HLSHttpStreamingEnabled true
HLSMediaFileDuration 8000
#HttpStreamingContentPath “../webroot/vod”
HttpStreamingContentPath “C:\hds_vod_content”
HLSFmsDirPath “..”
# Uncomment the following directives to enable encryption
# for this location.
# HLSEncryptionScope server
# HLSEncryptCipherKeyFile “../creds/vodkey.bin”
# HLSEncryptKeyURI “https://<ServerName>/hls-key/vodkey.bin”
Options -Indexes FollowSymLinks</Location>
3
Restart the Apache HTTP Server. The service name is FMSHttpd.
4
Copy a sample file from /webroot/vod to c:\hds_vod_content. This task uses sample1_1500kbps.f4v.
5
(HDS) Open rootinstall/samples/videoPlayer/videoplayer.html in a browser and in the Stream URL text box, enter:
http://localhost/hds-vod/sample1_1500kbps.f4v.f4m
6
(HLS) On a device running iOS, open Safari and enter the following:
http://localhost/hls-vod/sample1_1500kbps.f4v.m3u8
The request URL is the same as it was before the Apache configuration change, but the content is in a different location on the disk. When Apache receives a request that start with /hds-vod, it resolves the rest of the path based on the value of
HttpStreamingContentPath
.
To verify that the Apache configuration took effect, try to stream a sample file that isn’t in the c:\hds_vod_content folder. For example, try to stream http://localhost/hds-vod/sample1_1000kbps.f4v.f4m. The sample video player displays an error, “We are unable to connect to the content you’ve requested. We apologize for the inconvenience.”
Configure the location of live HDS and HLS content
To configure the location of live HDS and HLS content on disk, edit the Apache httpd.conf file. Use the following directives:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 51
Getting started streaming media
Last updated 7/19/2012
Configure the location of the live content on disk
1
Open rootinstall/conf/ams.ini in a text editor. Set the
VHOST.APPSDIR
in parameter to one of the following:
•
(Windows) C:/applications
•
(Linux) /opt/applications
2
Restart the server.
3
Create a folder at the location in step 1 and copy the livepkgr application to it.
4
Open rootinstall/Apache2.2/conf/httpd.conf in a text editor.
5
To change the location of the HDS live content, edit the directives in bold:
Directive
Description
HttpStreamingContentPath
The root location of the streams on disk (livepkgr/streams, by default). By default, the location is
“../applications”
. This location must be a subfolder of the livepkgr application.
This value can be absolute or relative to the Apache root folder.
HttpStreamingLiveEventPath
The root location of live events on disk (livepkgr/events, by default). The default value is “../applications”. This location must be a subfolder of the livepkgr application.
This value can be absolute or relative to the Apache root folder.
For HLS, this value is dependant on the value of the
HttpStreamingURLSandboxLevel
directive.
HttpStreamingURLSandboxLevel
Defines the scope at which
HttpStreamingLiveEventPath
is configured. Possible values are
“App”
,
“Inst”
, and
“Server”
. The default value is
“Server”
.
If
HttpStreamingLiveEventPath
is configured to a particular application, use the value
“App”
. In this case, the client request URL can omit the application name, as in the following:
HttpStreamingLiveEventPath “..application/livepkgr”
HttpStreamingURLSandboxLevel “App”
The request URL is:
http://<fms-dns-or-ip>/hls-live/<app-instance>/<event-name>/<stream-name>.m3u8
If
HttpStreamingLiveEventPath
is configured to an application instance, use the value
“Inst”
. In this case, the client request URL can omit the application name and the application instance, as in the following:
HttpStreamingLiveEventPath “..application/livepkgr/events/_definst_”
HttpStreamingURLSandboxLevel “Inst”
The request URL is:
http://<fms-dns-or-ip>/hls-live/<event-name>/<stream-name>.m3u8
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 52
Getting started streaming media
Last updated 7/19/2012
<Location /hds-live>
HttpStreamingEnabled true
#HttpStreamingLiveEventPath “../applications”
#HttpStreamingContentPath “../applications”
HttpStreamingLiveEventPath “C:\applications”HttpStreamingContentPath “C:\applications”
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingFragMaxAge -1
HttpStreamingDrmmetaMaxAge 3600
Options -Indexes FollowSymLinks
</Location>
</IfModule>
Note: On Linux, use
“/opt/applications”
.
6
To change the location of HLS live content, edit the directives in bold:
<IfModule hlshttp_module>
<Location /hls-live>
HLSHttpStreamingEnabled true
#HttpStreamingLiveEventPath “../applications”
#HttpStreamingContentPath “../applications”
HttpStreamingLiveEventPath “C:\applications”HttpStreamingContentPath “C:\applications”
HLSMediaFileDuration 8000
HLSSlidingWindowLength 6
HLSFmsDirPath “..”
HLSM3U8MaxAge 2
HLSTSSegmentMaxAge -1
# Uncomment the following directives to enable encryption
# for this location.
# HLSEncryptionScope server
# HLSEncryptCipherKeyFile “../creds/liveeventkey.bin”
# HLSEncryptKeyURI “https://<ServerName>/hls-key/liveeventkey.bin”
Options -Indexes FollowSymLinks
</Location>
7
Restart Apache HTTP Server. The service name is FMSHttpd.
8
Open Flash Media Live Encoder and publish a stream with the following settings:
•
Video codec—H.264
•
Audio codec—AAC
•
Keyframe Frequency—4 seconds
•
AMS URL—rtmp://localhost/livepkgr
•
Stream—livestream?adbe-live-event=liveevent
9
(HDS) Open rootinstall/samples/videoPlayer/videoplayer.html in a browser and in the Stream URL text box, enter:
http://localhost/hds-live/livepkgr/_definst_/liveevent/livestream.f4m
10
(HLS) On a device running iOS, open Safari and enter:
http://localhost/hls-live/livepkgr/_definst_/liveevent/livestream.m3u8
Note: To play content in Safari 4.0 on Mac OS, create an HTML document that uses the
<video>
tag.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 53
Getting started streaming media
Last updated 7/19/2012
Configure the scope of the request URL
1
Open rootinstall/Apache2.2/conf/httpd.conf in a text editor.
2
To change the scope of the request URL (also called the URL sandbox level) for HDS, edit the directives in bold:
<Location /hds-live>
HttpStreamingEnabled true
#HttpStreamingLiveEventPath “../applications”
#HttpStreamingContentPath “../applications”
HttpStreamingLiveEventPath “c:\applications\livepkgr”
HttpStreamingContentPath “c:\applications”
HttpStreamingURLSandboxLevel “App”
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingFragMaxAge -1
Options -Indexes FollowSymLinks
</Location></IfModule>
To change the scope of the request URL for HLS, edit the directives in bold:
<IfModule hlshttp_module>
<Location /hls-live>
HLSHttpStreamingEnabled true
#HttpStreamingLiveEventPath “../applications”
#HttpStreamingContentPath “../applications”
HttpStreamingLiveEventPath “C:\applications\livepkgr”
HttpStreamingContentPath “C:\applications”
HttpStreamingURLSandboxLevel “App”
HLSMediaFileDuration 8000
HLSSlidingWindowLength 6
HLSFmsDirPath “..”
HLSM3U8MaxAge 2
HLSTSSegmentMaxAge -1
# Uncomment the following directives to enable encryption
# for this location.
# HLSEncryptionScope server
# HLSEncryptCipherKeyFile “../creds/liveeventkey.bin”
# HLSEncryptKeyURI “https://<ServerName>/hls-key/liveeventkey.bin”
Options -Indexes FollowSymLinks
</Location>
3
Restart the Apache HTTP Server. The service name is FMSHttpd.
4
Open Flash Media Live Encoder and publish a stream with the following settings:
•
Video codec—H.264
•
Audio codec—AAC
•
Keyframe Frequency—4 seconds
•
AMS URL—rtmp://localhost/livepkgr
•
Stream—livestream?adbe-live-event=liveevent
5
(HDS) Double-click rootinstall/samples/videoPlayer/videoplayer.html to open the Adobe Media Server sample video player. Enter the following for Stream URL and click play:
http://<host>/hds-live/_definst_/liveevent/livestream.f4m
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 54
Getting started streaming media
Last updated 7/19/2012
6
On a device running iOS, open Safari and enter:
http://<host>/hls-live/_definst_/liveevent/livestream.m3u8
Because the URL sandbox level is configured to “App” instead of the default “Server”, the URL does not include the application name (livepkgr).
Configure set-level F4M/M3U8 files for multi-bitrate streaming
Adobe Media Server 5
Configuration information about multi-bitrate streams has been divided into multiple levels: set-level F4M and M3U8 files and stream-level F4M and M3U8 files. For HDS, the files are F4M manifest files. For HLS, the files are M3U8 variant playlists. (The documentation sometimes uses the generic term “manifest” to refer to both.)
Set-level F4M and M3U8 files
Contain the URL to the stream-level manifest file and the bit rate information for each stream in a multi-bitrate set. For HDS, the set-level F4M file can also contain information about a DVR rolling window. For HLS, the set-level M3U8 file can also contain codec information.
Adobe Media Server 5 includes a Set-level F4M/M3U8 File Generator tool. This tool is installed to rootinstall/tools/f4mconfig/configurator/f4mconfig.html. Use the tool to generate set-level files. Copy the set-level files to a web server. The media player requests set-level files to play multi-bitrate content.
The following is a set-level F4M file:
<manifest xmlns=”http://ns.adobe.com/f4m/2.0″>
<baseURL>http://localhost/hds-live/livepkgr/_definst_/liveevent/</baseURL>
<media href=”livestream1.f4m” bitrate=”150″/>
<media href=”livestream2.f4m” bitrate=”500″/>
<media href=”livestream3.f4m” bitrate=”700″/>
</manifest>
The following is a set-level M3U8 file:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=150000
http://10.0.1.11/hls-live/livepkgr/_definst_/liveevent/livestream1.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=500000
http://10.0.1.11/hls-live/livepkgr/_definst_/liveevent/livestream2.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=700000
http://10.0.1.11/hls-live/livepkgr/_definst_/liveevent/livestream3.m3u8
Stream-level F4M and M3U8 files
contain bootstrap information and DRM metadata. The live packager and the HTTP modules generate stream-level F4M and M3U8 files in real time when a media player requests the content.
Flash/AIR media players that support set-level files
To play set-level F4M files, use a media player that uses OSMF 1.6 or later. Strobe Media Playback that installs to rootinstall/samples/videoPlayer supports set-level F4M files.
Apple media players that support set-level files
To play set-level M3U8 files, use any device that supports Apple HTTP Live Streaming. See the
Apple HTTP Live Streaming documentation
.
F4M specification
For detailed information about the F4M file format, see the
F4M File Format Specification
.
M3U8 specification
For detailed information about the M3U8 file format, see
HTTP Live Streaming Internet-Draft
.
Tutorials that use set-level files
The following tutorials use set-level files for multi-bitrate streaming:
•
“Publish and play live multi-bitrate streams over HTTP” on page
10
•
“Play on-demand multi-bitrate media files over HTTP” on page
24
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 55
Getting started streaming media
Last updated 7/19/2012
•
“Publish an audio-only stream (HLS)” on page
14
•
“Configure DVR (HDS)” on page
16
Configure absolute time on the server
Note: The livepkgr application is configured by default to use absolute time. Use this section to understand HTTP streaming and to duplicate the livepkgr application.
The livepkgr ingest application is configured by default to use absolute time. To see the configuration, open rootinstall/applications/livepkgr/Application.xml in a text editor.
To publish live, multi-bitrate streams, configure the live encoder to publish the streams using absolute time. See
“Stream live media (HTTP)” on page
5
.
1
Copy an Application.xml file to the application folder.
For example, if you’re publishing streams to the application “livepkgr2”, copy an Application.xml file from the conf\_defaultRoot_\_defaultVHost_ folder to the applications/livepkgr2 folder.
2
Open the Application.xml file in a text editor.
3
Set the tag //Application/StreamManager/Live/AssumeAbsoluteTime to true:
<Application>
…
<StreamManager>
…
<Live>
…
<AssumeAbsoluteTime>true</AssumeAbsoluteTime>
4
Save the file.
5
Restart the server. See
Starting and stopping the server
.
Important: Set
<AssumeAbsoluteTime>
to true only when all streams published to the application use absolute time. If this value is set to true and the application ingests a stream that does not use absolute time, you may see warnings in the server logs about time going backwards when streams are stopped and re-published.
Configure F4F and TS fragment duration
The server records ingested (live) streams into fragments. It records on-demand files into fragments when a client requests the files.
Adobe HDS fragments are F4F files. Apple HLS fragments are TS files.
Specify the size of content fragments based on frames or based on time. The frame-based configuration overrides the time-based configuration.
Use frame-based configuration when the source media contains video encoded at a constant frame rate. Use frame-based configuration to match the fragment size to the video’s keyframe interval. Use time-based configuration for media that contains audio or data but not video.
The server’s fragment duration must be a multiple of the encoder’s keyframe interval. The value of
KeyframeIntervalsPerFragment
defines the multiple.
Configure fragment size for live HDS and HLS
Server-level configurations for live HDS
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 56
Getting started streaming media
Last updated 7/19/2012
Set the following directive in the Apache httpd.conf to configure fragment size for all live HDS events on the server:
Server-level configurations for live HLS
Set the following directive in the Apache httpd.conf to configure a time-based fragment size for all live HLS events on the server:
Application-level and event-level configurations for live HDS
To configure fragment size at the application-level, use the Application.xml file in the directory of the Live Packager application (livepkgr, by default).
To configure fragment size at the event-level, use the Event.xml file in the live event directory (applications/livepkgr/events/_definst_/liveevent, by default).
Use the elements in the
<Recording>
container to configure how the server writes files to disk. In the Application.xml file, the elements are located at
//Application/HDS
. In the Event.xml file, the elements are located at
//Event
.
Directive
Description
Default
HttpStreamingFragmentDuration
The default fragment duration, in milliseconds. This is the time-based configuration, and can be overridden by selecting frame-based values.
4000
HttpStreamingFrameRate
For frame-based fragment duration configuration, this is the frame rate of the source content.
None
HttpStreamingFramesPerKeyframeInterval
For frame-based fragment duration configuration, this is the number of frames in each keyframe interval (group of pictures).
None
HttpStreamingKeyframeIntervalsPerFragment
For frame-based fragment duration configuration, this is the number of keyframe intervals (GOPs) per fragment.
1
Directive
Description
Default
HLSMediaFileDuration
The duration of TS files, in milliseconds. Use a value that is a multiple of the keyframe intervals for the media.
8000
Element
Description
Default
/Recording
The section that configures how the file is written to disk.
None
/Recording/FragmentDuration
The length of each fragment, in milliseconds. Each segment can contain one or more fragments.
Time-based configuration.
4000
/Recording/FramePrecision
The rounding precision for the fragment run table, in frame units. Frame units are derived from the specified frame rate (1/rate).
Frame-based configuration.
1
/Recording/FrameRate
The frame rate of the original content, in frames per second (fps). The value is floating point; for NTSC, use the value 29.97.
Frame-based configuration
None
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 57
Getting started streaming media
Last updated 7/19/2012
Application-level and event-level configurations for live HLS
To configure fragment size at the application-level, use the Application.xml file in the directory of the Live Packager application (livepkgr, by default).
To configure fragment size at the event-level, use the Event.xml file in the live event directory (applications/livepkgr/events/_definst_/liveevent, by default).
Use the elements in the
<Recording>
and
<HLS>
containers to configure how the server writes files to disk. In the Application.xml file, the elements are located at
//Application/HDS
. In the Event.xml file, the elements are located at
//Event/
.
Specify fragment size for live HDS and HLS based on frames
Use the following elements for HDS:
KeyframeIntervalsPerFragment
,
FrameRate
,
FramesPerKeyframeInterval
,
FramePrecision
.
Use the following elements for HLS:
FrameRate
,
FramesPerKeyframeInterval
, and
KeyframeIntervalPerMediaFile
.
/Recording/FramesPerKeyframeInterval
The number of frames between each keyframe. For example, 30 fps video with a keyframe every 2 seconds contains 60 frames per keyframe interval.
Frame-based configuration.
None
/Recording/KeyframeIntervalsPerFragment
The number of keyframe intervals per fragment. The default value is 1, which means that the fragment size is the same as the keyframe interval.
Frame-based configuration.
1
/Recording/SegmentDuration
The length of each segment, in milliseconds. Each .f4f file contains one segment.
Time-based configuration. Frame-based configurations override time-based configurations
400000
Element
Description
Default
/Recording/FrameRate
The frame rate of the original content, in frames per second (fps). The value is floating point; for NTSC, use the value 29.97.
Frame-based configuration.
None
/Recording/FramesPerKeyframeInterval
The number of frames between each keyframe. For example, 30 fps video with a keyframe every 2 seconds contains 60 frames per keyframe interval.
Frame-based configuration.
None
/HLS/KeyframeIntervalPerMediaFile
The number of keyframe intervals per media file (TS). The default value is 1, which means that the fragment size is the same as the keyframe interval.
Frame-based configuration.
1
/HLS/MediaFileDuration
The length of each media file (TS), in milliseconds.
Time-based configuration. Frame-based configurations override time-based configurations
8000
Element Description Default
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 58
Getting started streaming media
Last updated 7/19/2012
<Event>
<EventID>liveevent</EventID>
<Recording>
<FrameRate>29.97</FrameRate>
<FramesPerKeyframeInterval>120</FramesPerKeyframeInterval>
<KeyframeIntervalsPerFragment>1</KeyframeIntervalsPerFragment>
<FramePrecision>1</FramePrecision>
</Recording>
<HLS>
<KeyframeIntervalPerMediaFile>3</KeyframeIntervalPerMediaFile>
</HLS>
</Event>
The server calculates the HLS media file duration according to the following formula:
MediaFileDurationInSeconds = FramesPerKeyframeInterval * KeyframeIntervalPerMediaFile / FrameRate
Specify fragment size for live HDS and HLS based on time
Use the following elements for HDS:
FragmentDuration
,
SegmentDuration
.
Use the following element for HLS:
MediaFileDuration
.
Use the following elements:
FragmentDuration
,
MediaFileDuration
.
<Event>
<EventID>liveevent</EventID>
<Recording>
<FragmentDuration>4000</FragmentDuration>
<SegmentDuration>400000</SegmentDuration>
</Recording>
<HLS>
<MediaFileDuration>8000<MediaFileDuration>
</HLS>
</Event>
Configure fragment size for on-demand HDS and HLS
Server-level configurations for on-demand HDS
Set the following directive in the Apache httpd.conf to configure fragment size for all on-demand HDS on the server:
Server-level configurations for on-demand HLS
Directive
Description
Default
HttpStreamingFragmentDuration
The default fragment duration, in milliseconds.
This is the time-based configuration. Frame-based configurations override time-based configurations.
4000
HttpStreamingFrameRate
The frame rate of the source content.
Frame-based configuration.
None
HttpStreamingFramesPerKeyframeInterval
The number of frames in each keyframe interval (group of pictures.
Frame-based configuration.
None
HttpStreamingKeyframeIntervalsPerFragment
The number of keyframe intervals (GOPs) per fragment.
Frame-based configuration.
1
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 59
Getting started streaming media
Last updated 7/19/2012
Set the following directive in the Apache httpd.conf to configure fragment size for all on-demand HLS on the server:
Stream-level configurations for on-demand HDS
To configure a set of on-demand media files (or a single file), copy a jit.conf file to the same directory as the media files. All media files in a directory use the same jit.conf file.
Use a jit.conf file with the following elements to configure fragment size for HDS at the stream-level:
Stream-level configurations for on-demand HLS
To configure a set of on-demand media files (or a single file), copy a jit.conf file to the same directory as the media files. All media files in a directory use the same jit.conf file. Use a jit.conf file with the following elements to configure fragment size for HLS at the stream-level:
Directive
Description
Default
HLSMediaFileDuration
The duration of TS files, in milliseconds. Use a value that is a multiple of the keyframe intervals for the media.
8000
HttpStreamingFrameRate
The frame rate of the source content. This is a frame-based configuration.
None
HLSKeyframeIntervalsPerMediaFile
The number of keyframe intervals (group of pictures) per media file. This is a frame-based configuration.
1
HttpStreamingFramesPerKeyframeInterval
The number of frames in each keyframe interval (group of pictures). This is a frame-based configuration.
None
Element
Description
Default
//manifest/hds:fragment-duration
The fragment duration for the set of content, in seconds. The value can be fractional (for example, to specify 2002 milliseconds, use the value 2.002).
Time-based configuration. Frame-based configurations override time-based configurations
None
//manifest/hds:frame-rate
The frame rate of the set of content. Units are frames/second, and can be fractional (i.e. 29.97 for NTSC) .
Frame-based configuration.
None
//manifest/hds:frames-per-keyframe-interval
The number of frames per keyframe interval (GOP). Units are frames, and should be a whole integer value.
Frame-based configuration.
None
//manifest/hds:keyframe-intervals-per-fragment
The number of keyframe intervals per fragment. Units are keyframe intervals per fragment, and should be a whole integer value.
Frame-based configuration.
1
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 60
Getting started streaming media
Last updated 7/19/2012
Specify fragment size for on-demand HDS and HLS based on frames
Use the following elements for HDS:
hds:frame-rate
,
hds:frames-per-keyframe-interval
, and
hds:keyframe-intervals-per-fragment
.
Use the following elements for HLS:
hds:frame-rate
,
hds:frames-per-keyframe-interval
, and
hds:keyframe-intervals-per-media-file
.
<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns=”http://ns.adobe.com/f4m/1.0″ xmlns:hds=”http://ns.adobe.com/hds-package/1.0″>
<hds:frame-rate>29.97</hds:frame-rate>
<hds:frames-per-keyframe-interval>60</hds:frames-per-keyframe-interval>
<hds:keyframe-intervals-per-fragment>2</hds:keyframe-intervals-per-fragment>
<hds:hls>
<hds:keyframe-intervals-per-media-file>2</hds:keyframe-intervals-per-media-file>
</hds:hls>
</manifest>
Specify fragment size for on-demand HDS and HLS based on time
Use the following element for HDS:
hds:fragment-duration
.
Use the following element for HLS:
hds:media-file-duration.
<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns=”http://ns.adobe.com/f4m/1.0″ xmlns:hds=”http://ns.adobe.com/hds-package/1.0″>
<hds:fragment-duration>8000</hds:fragment-duration>
<hds:hls>
<hds:media-file-duration>8000</hds:media-file-duration>
</hds:hls>
</manifest>
Element
Description
Default
//manifest/hds:frame-rate
The frame rate of the set of content. Units are frames/second, and can be fractional (i.e. 29.97 for NTSC) .
Frame-based configuration.
None
//manifest/hds:frames-per-keyframe-interval
The number of frames per keyframe interval (GOP). Units are frames, and should be a whole integer value.
Frame-based configuration.
None
//manifest/hds:hls
Container for Apple HTTP Live Streaming configurations.
None
//manifest/hds:hls/hds:keyframe-intervals-per-media-file
The number of keyframe intervals per TS file duration. The value must be a whole integer.
Frame-based configuration.
None
//manifest/hds:hls/hds:media-file-duration
The TS file duration, in milliseconds, for the set of content associated with this file. Use a value that is a multiple of the fragment duration.
Time-based configuration. Frame-based configurations override time-based configurations
None
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 61
Getting started streaming media
Last updated 7/19/2012
Configure the size of the IO buffer
Adobe Media Server 5
The IO buffer improves the read and write performance of the Apache f4f module. The IO buffer loads the disk file into an in-memory buffer. It reads and writes to the in-memory buffer instead of making system calls.
Note: This feature impacts both HTTP Dynamic Streaming and HTTP Live Streaming.
When the buffer is full, or if the read/write head needs to move beyond the buffer boundaries, the server commits the contents of the buffer to the disk file and pre-loads new content into the buffer from the disk file.
The default value of the IO buffer is 4096 bytes. To increase or decrease the value, edit the Event.xml file. Use a multiple of 4096 bytes.
1
Open the Event.xml file in a text editor.
For live HTTP streaming, the Event.xml file is located in the live event folder. For example, rootinstall/applications/livepkgr/events/_definst_/liveevent/Event.xml.
2
Set the
IOBufferSize
to a value that is a multiple of the cluster size of the underlying operating system.
IOBufferSize
is the size of the IO buffer in bytes.
<Event>
<EventID>liveevent</EventID>
<Recording>
<FragmentDuration>4000</FragmentDuration>
<IOBufferSize>4096</IOBufferSize>
</Recording>
</Event>
3
Save the file.
Disk management
Adobe Media Server 5
Set the
DiskManagementDuration
configuration parameter in the Application.xml file or the Event.xml file to specify how much of the latest live content is on disk. The limit set at the application level cannot be overriden at the event level. If the limit has been set in the Application.xml file, the Event.xml file can set a duration that is equal to or lower than that limit.
All live HTTP streaming uses disk management to prevent the disk from filling. Disk management allows you to create 24/7 live streaming events. In addition, when using DVR, configure disk management in relation to the DVR settings. See
“Configure DVR (HDS)” on page
16
.
By default, disk management keeps 3 hours of a live stream. The server constantly checks the content and if the content duration is above the value of
DiskManagmentDuration
, the server deletes the .f4f files and the .f4x files for segments beyond the limit.
If
SegmentDuration
or
DiskManagmentDuration
have values (both do by default), the following formula must be true for the server to start recording:
FragmentDuration < SegmentDuration < DiskManagementDuration
Also, the value of
SegmentDuration
must be greater than 0. (The value 0 creates 1 segment.) The value of
SegmentDuration
specifies how rapidly segments are removed. The smaller the value of
SegmentDuration
, the faster segments are deleted.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 62
Getting started streaming media
Last updated 7/19/2012
The server maintains the total duration of all the content available. After a segment is created, the server checks if the segment does not have any fragments that are in the disk management window. If so, the server removes the segment from the bootstrap entries, then removes the segment from disk.
Note: This behavior is a change from Adobe Media Server 4.0 which allowed
FragmentDuration
to be greater than
SegmentDuration
.
The value of
DiskManagementDuration
in the Application.xml file cannot be overridden by the value in the Event.xml file. If a value is not set in Application.xml, you can set a value in Event.xml.
The following sets disk management duration to 4 hours in the Application.xml file. This value impacts all live events running in this application.
<Application>
…
<HDS>
<Recording>
<FragmentDuration>4000</FragmentDuration>
<SegmentDuration>16000</SegmentDuration>
<DiskManagementDuration>4</DiskManagementDuration>
</Recording>
</HDS>
</Application>
The following sets the disk management duration to 1 hour in the Event.xml file. This value limits the content duration on the server for the event called “liveevent.”
<Event>
<EventID>liveevent</EventID>
<Recording>
…
<DiskManagementDuration>1</DiskManagementDuration>
</Recording>
</Events>
For more information, see
“Configure live HTTP streaming” on page
71
.
Configure content caching (HDS)
To improve the performance of live and on-demand HTTP Dynamic Streaming, enable Apache content caching on the origin server. When caching is enabled, the server caches content that it packages for HDS. When the server receives a request, it checks the cache before it serves content. Content caching is disabled by default.
1
Run the htcacheclean tool.
To limit the amount of storage the disk cache uses, run the Apache htcacheclean tool when content caching is enabled. The tool can run manually or as a daemon. The htcacheclean tool is located at rootinstall/Apache2.2/bin/. For information about how to run the tool, see the
Apache documentation
.
2
In the Apache httpd.conf file, uncomment the caching configuration section.
Element
Default
Description
DiskManagementDuration
3
The maximum duration of the content on the server, in hours. The default value is 3. Use a fractional value to specify minutes.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 63
Getting started streaming media
Last updated 7/19/2012
# Uncomment this to enable caching
LoadModule cache_module modules/mod_cache.so
<IfModule mod_cache.c>
LoadModule disk_cache_module modules/mod_disk_cache.so
IfModule mod_disk_cache.c>
CacheEnable disk /hds-vod
CacheEnable disk /hls-vod
CacheRoot cacheroot
CacheMaxFileSize 10000000
CacheLock On
</IfModule>
</IfModule>
Verify that the directory specified by the
CacheRoot
directive exists. The default cacheroot directory is located at rootinstall/Apache2.2/cacheroot.
3
Restart Apache.
For more information about content caching, see the
Apache documentation
.
Encrypt content for Adobe Access protection
Important: Use the HTTP Dynamic Streaming packagers to both encrypt and fragment content. Do not use the Adobe Access packaging tools to encrypt content. The HTTP Dynamic Streaming packagers cannot fragment content that has already been encrypted.
To deliver live or on-demand content with HTTP Dynamic Streaming and protect it with Adobe Access, use Adobe Access Server for Protected Streaming. This server is a Adobe Access license server implementation optimized for use with HTTP Dynamic Streaming. See
Adobe Access Protecting Content
.
Note: The Adobe Access SDK and the Adobe Access license server reference implementation can also issue licenses for HTTP Dynamic Streaming.
After you’ve deployed Adobe Access Server for Protected Streaming, configure Adobe Media Server to package and encrypt the content in real-time.
Configure Adobe Media Server to encrypt live content
You can configure live content encryption with Adobe Access at the application level and at the event level.
To configure Adobe Access at the application level, use the Application.xml file located here:
rootinstall/applications/livepkgr/Application.xml
In the Application.xml file, the
FlashAccessV2
container element is located here:
//Application/HDS/Recording/ContentProtection/FlashAccessV2
To configure Adobe Access at the event level, use the Event.xml file located here:
rootinstall/applications/livepkgr/events/_definst_/liveevent/Event.xml
In the Event.xml file, the
FlashAccessV2
container element is located here:
//Event/Recording/ContentProtection/FlashAccessV2
1
Open the file rootinstall/applications/livepkgr/events/_definst_/liveevent/Event.xml in a text editor.
2
Add the XML tags required for encrypting the streams. The following is a sample Event.xml file:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 64
Getting started streaming media
Last updated 7/19/2012
<Event>
<EventID>liveevent</EventID>
<Recording>
<FragmentDuration>4000</FragmentDuration>
<SegmentDuration>10000</SegmentDuration>
<ContentProtection enabled=”true”>
<ProtectionScheme>FlashAccessV2</ProtectionScheme>
<FlashAccessV2>
<ContentID>foo</ContentID>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<LicenseServerURL>http://dill.corp.adobe.com:8090</LicenseServerURL>
<TransportCertFile>production_transport.der</TransportCertFile>
<LicenseServerCertFile>license_server.der</LicenseServerCertFile>
<PackagerCredentialFile>production_packager.pfx</PackagerCredentialFile>
<PackagerCredentialPassword>hbXX5omIhzI=</PackagerCredentialPassword>
<PolicyFile>policy01.pol</PolicyFile>
</FlashAccessV2>
</ContentProtection>
</Recording>
</Event>
Note: The certificates that you use with the Live Packager must match the license server.
Element
Description
Default value
FlashAccessV2
A container for settings used by Adobe Access to protect content.
None
FlashAccessV2/CommonKeyFile
A path to a common key file used to generate a content encryption key. The path should be absolute or relative to the configuration file.
The base key used with the content ID to generate the content encryption key. This is a binary file containing a 16-byte/128-bit binary key.
For adaptive bitrate streaming, use the same common key and content ID for an entire set of content. Using the same key and id allows a single license to decrypt a set of content.
None
FlashAccessV2/ContentID
The content ID used with the common key to generate the content encryption key.
None
FlashAccessV2/LicenseServerCertFile
The DER encoded license server certificate file used for content protection.
None
FlashAccessV2/LicenseServerURL
The URL of the license server that handles license acquisition for this content.
None
FlashAccessV2/PackagerCredentialFile
The PFX file containing the packager’s protection credentials.
None
FlashAccessV2/PackagerCredentialPassword
The password string used to secure the packager credentials.
None
FlashAccessV2/PolicyFile
The file containing the policy for this content. Currently only a single policy can be applied to content packaged with this tool.
None
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 65
Getting started streaming media
Last updated 7/19/2012
The Live Packager outputs the fragmented and protected files needed for HTTP Dynamic Streaming. Each fragment is persistently protected in both the CDN cache and the browser cache.
Configure Adobe Media Server to encrypt on-demand content:
1
Create a file called jit.conf and copy it to the same folder as the on-demand media files. The settings in the jit.conf file apply to all the files in the folder.
2
Add the XML tags required for encrypting the streams. The following is a sample jit.conf file:
<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns=”http://ns.adobe.com/f4m/1.0″ xmlns:hds=”http://ns.adobe.com/hds-package/1.0″>
<hds:frame-rate>29.97</hds:frame-rate>
<hds:frames-per-keyframe-interval>60</hds:frames-per-keyframe-interval>
<hds:content-protection enabled=”true”>
<hds:protection-scheme>FlashAccessV2</hds:protection-scheme>
<hds:FlashAccessV2>
<hds:content-id>myfile.manifest</hds:content-id>
<hds:common-key-file>common.bin</hds:common-key-file>
<hds:license-server-url>http://mylicenseserver.myhost.com</hds:license-server-url>
<hds:transport-cert-file>transport.der</hds:transport-cert-file>
<hds:license-server-cert-file>server.der</hds:license-server-cert-file>
<hds:packager-credential-file>packager.pfx</hds:packager-credential-file>
<hds:packager-credential-password>??????</hds:packager-credential-password>
<hds:policy-file>policy.pol</hds:policy-file>
</hds:FlashAccessV2>
</hds:content-protection>
</manifest>
FlashAccessV2/TransportCertFile
The DER encoded transport certificate file.
None
Element
Description
Default
//manifest/hds:content-protection/hds:flash-access/hds:common-key-file
The path to common key file. File contains 16-byte/128-bit random key.
The path must be absolute or relative to the jit.conf file.
None
//manifest/hds:content-protection/hds:flash-access/hds:content-id
The Content ID to be used for content protection. If not specified, the salt is the filename. If specified, the salt is shared with all content in the directory.
None
//manifest/hds:content-protection/hds:flash-access/hds:license-server-url
The License Server URL.
None
//manifest/hds:content-protection/hds:flash-access/hds:transport-cert-file
The path to transport cert file. The file is in DER format.
The path should be absolute or relative to the jit.conf file.
None
Element Description Default value
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 66
Getting started streaming media
Last updated 7/19/2012
Publish live streams
❖
Publish a live stream or multi-bitrate streams from a supported encoder to the livepkgr service. Adobe Access doesn’t require any special settings.
Play encrypted streams
❖
OSMF media players do the following:
a
Request the file fragments and play them back seamlessly.
b
Obtain a content license from Adobe Access Server for Protected Streaming. The content license contains the key required to play the content to legitimate clients.
c
Decrypt the content in real-time.
HTTP streaming configuration file reference
Configure live and on-demand HTTP Streaming at the server level (httpd.conf)
Apache HTTP Server that installs with Adobe Media Server is configured by default for Adobe HTTP Dynamic Streaming (to Flash Player and AIR) and Apple HTTP Live Streaming (to iOS and Mac OS). The Adobe Media Server Apache installation includes three custom modules that handle HTTP streaming.
The following table describes the types of streaming that each modules handles, and where the module is configured in the httpd.conf file:
//manifest/hds:content-protection/hds:flash-access/hds:license-server-cert-file
The path to transport cert file. File is in DER format.
The path should be absolute or relative to the jit.conf file.
None
//manifest/hds:content-protection/hds:flash-access/hds:packager-credential-file
The path to packager credential cert file. File is in PFX format.
The path should be absolute or relative to the jit.conf file.
None
//manifest/hds:content-protection/hds:flash-access/hds:packager-credential-password
The packager credential password.
None
//manifest/hds:content-protection/hds:flash-access/hds:policy-file
The path to a policy file. File is in FAXS policy format.
The path should be absolute or relative to the jit.conf file.
None
Streaming type
Module
Location directive in httpd.conf
Live Adobe HTTP Dynamic Streaming
f4fhttp_module
<Location /hds-live>
On-demand Adobe HTTP Dynamic Streaming packaged in real-time
jithttp_module
<Location /hds-vod>
On-demand Adobe HTTP Dynamic Streaming packaged offline by the File Packager tool
f4fhttp_module
<Location /vod>
Element Description Default
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 67
Getting started streaming media
Last updated 7/19/2012
Note: Despite the name, Apple HTTP Live Streaming supports live and on-demand content.
The configuration of the modules determines the format of the URL that the player requests from the server, the location of the content, the content fragmentation settings, and additional settings. Configure the settings at the server-level in the Apache httpd.conf file:
rootinstall/Apache2.2/conf/httpd.conf
To see the default configurations, open the httpd.conf file.
Directives for all the HTTP streaming modules
Use the following directives to configure all the HTTP streaming modules (jithttp_module, f4fhttp_module, and hlshttp_module):
For more information, see Configure HTTP Streaming failover.
Directives for Adobe HTTP Dynamic Streaming
Use the following directives to configure the Adobe HTTP Dynamic Streaming modules (jithttp_module for on-demand and f4fhttp_module for live):
Live Apple HTTP Live Streaming
hlshttp_module
<Location /hls-live>
On-demand Apple HTTP Live Streaming
hlshttp_module
<Location /hls-vod>
HTTP Streaming failover
ctrlplane_module
<Location /ctrlplane
Directive
Required
Description
HttpStreamingContentPath
Yes
The physical locaion of the content path. For live streaming, the location of livepkgr/streams.
This value can be absolute or relative to the Apache root folder. See
“Content storage (HDS and HLS)” on page
47
.
HttpStreamingLiveEventPath
Yes
For live streaming only.
The location of the live event directory (by default livepkgr/events). The default value is “../applications”.
This value can be absolute or relative to the Apache root folder. See
“Content storage (HDS and HLS)” on page
47
.
HTTP streaming file operations are routed through the File plug-in. You can optionally use a File plug-in to manage content. For more information, see
“Use the File plug-in to
manage content for live HTTP streaming” on page
306
.
HttpStreamingURLSandboxLevel
No
For live streaming only
Defines the scope at which
HttpStreamingLiveEventPath
is configured. Possible values are
“App”
,
“Inst”
, and
“Server”
. The default value is
“Server”
.
This value can be absolute or relative to the Apache root folder. See
“Content storage (HDS and HLS)” on page
47
.
Location
Yes
The section of the request URL after the server name (and optional port number). This path tells Apache which module to use to process the request.
This value can be absolute or relative to the Apache root folder. See
“Content storage (HDS and HLS)” on page
47
.
Streaming type Module Location directive in
httpd.conf
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 68
Getting started streaming media
Last updated 7/19/2012
Parameter
Module
Required
Description
EncryptionScope
jithttp_module, f4fhttp_module
No
The scope at which protected HTTP Dynamic Streaming (PHDS) is configured. Possible values are:
server
—The server uses configuration settings in the httpd.conf file.
content
—The server uses configuration settings in the Event.xml or Application.xml file (live), or in the jit.conf file (on-demand).
See
Protected HTTP Dynamic Streaming
(PHDS)
.
HttpStreamingBootstrapMaxAge
f4fhttp_module
No
The time to live for bootstrap files, in seconds. The default value is 2.
HttpStreamingEnabled
f4fhttp_module
Yes
Enables packaging. Possible values are
true
and
false
.
HttpStreamingFragMaxAge
f4fhttp_module
No
The time to live for fragment files, in seconds. The default value is -1 which is unlimited.
HttpStreamingDrmmetaMaxAge
f4fhttp_module
No
The time to live for DRM MetaData, in seconds. The default value is 1 hour.
HttpStreamingFragmentDuration
jithttp_module
No
The length of an F4F file, in milliseconds. The default value is 4000. See
Configure
F4M and TS duration
.
HttpStreamingFrameRate
jithttp_module
No
For frame-based fragment duration configuration, this is the frame rate of the source content. This value is overridden if a jit.conf file is provided. See
Configure F4M
and TS duration
.
HttpStreamingFramesPerKeyframeInterval
jithttp_module
No
For frame-based fragment duration configuration, this is the number of frames in each keyframe interval (group of pictures). This value is overridden if a jit.conf file is provided. See
Configure F4M
and TS duration
.
HttpStreamingF4MMaxAge
f4fhttp_module
No
The time to live for F4M files, in seconds. The default value is 2.
HttpStreamingJITConfAllowed
jithttp_module
No
Indicates whether jit.conf processing is allowed. The default is
true
. Setting this to
false
means that jit.conf will not be processed, even if present, and the server will not even attempt to load a jit.conf file.
HttpStreamingJITPEnabled
jithttp_module
Yes
Indicates whether just-in-time packaging is enabled (
true
) or not (
false
).
HttpStreamingKeyframeIntervalsPerFragment
jithttp_module
No
For frame-based fragment duration configuration, this is the number of keyframe intervals (GOPs) per fragment. The default value is 1.
This value is overridden if a jit.conf file is provided. See
Configure F4M and TS
duration
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 69
Getting started streaming media
Last updated 7/19/2012
Directives for Apple HTTP Live Streaming
Use the following directives to configure the Apple HTTP Live Streaming module for live and on-demand streaming (hlshttp_module):
HttpStreamingMaxFragmentDuration
jithttp_module, f4fhttp_module
No
This is the maximum allowed size of a fragment (in milliseconds). Set this directive to a value that prevents user-supplied overrides from creating large fragments that can clog the network.
HttpStreamingMinFragmentDuration
jithttp_module, f4fhttp_module
No
This is the minimum allowed size of a fragment (in milliseconds).Set this directive to a value that prevents user-supplied overrides from creating many small fragments. When media is packaged into too many fragments, the client has to make too many requests.
JitFmsDirPath
jithttp_module
Yes
The location of the Adobe Media Server installation.
PHDSSWFVerification
jithttp_module, f4fhttp_module
No
Enables SWF verification for PHDS (
true
) or not (
false
).
If
EncryptionScope
is set to
content
, this value can be set in the jit.conf file.
PHDSSWFWhiteListFolder
jithttp_module, f4fhttp_module
No
A path to the folder containing the whitelist for on-demand SWF verification. The folder can contain more than one whitelist file.
The default value is the content folder (which contains both media and the jit.conf file ).
If
EncryptionScope
is set to
content
, this value can be set in the jit.conf file..
ProtectionScheme
jithttp_module, f4fhttp_module
No
The type of protection to apply to content. Possible values are
phds
and
FlashAccessV2
.
Directive
Required
Description
HLSEncryptCipherKeyFile
No
The path of the default cipher key used to encrypt the content for PHLS.
HLSEncryptionScope
No
The scope at which protected HTTP Live Streaming (PHLS) is configured. Possible values are:
server
—The server uses configuration settings in the httpd.conf file.
content
—The server uses configuration settings in the Event.xml or Application.xml file (live), or in the jit.conf file (on-demand).
See
Protected HTTP Live Streaming (PHLS)
.
HLSEncryptKeyURI
No
The URI that the client uses to fetch the encryption key for PHLS.
HLSFmsDirPath
Yes
The location of the Adobe Media Server installation. The default value is
“..”
.
Parameter Module Required Description
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 70
Getting started streaming media
Last updated 7/19/2012
Directives for HTTP Streaming failover
Use the following directives to configure HTTP Streaming failover (ctrlplane_module):
HLSHttpStreamingEnabled
Yes
Indicates whether or not HLS is enabled (
true
) or not (
false
). The default value is
false
.
HLSJITConfAllowed
No
Indicates whether jit.conf processing is allowed. The default is
true
. Setting this to
false
means that jit.conf will not be processed, even if present, and the server will not even attempt to load a jit.conf file.
HLSMediaFileDuration
No
The duration of the TS file to be served, in milliseconds. This number must be a multiple of the fragment duration specified in Flash Media Live Encoder. The default value is 8000. See
Configure F4M and TS duration
.
In the case of HLS-VOD,
HLSMediaFileDuration
can be in between 500 ms to 30000ms. These bound values can be modified using the following directives:
•
HLSMaxMediaFileDuration
•
HLSMinMediaFileDuration
HLSM3U8MaxAge
No
Specifies the max-age to set in the cache-control header for M3U8 responses, in seconds. The default value for HLS Live is 2. The default value for HLS on-demand is 86400 (1 day). The value -1 does not set a cache-control header.
HLSSlidingWindowLength
No
The number of TS files in a playlist and available for seeking within a sliding window. The time within the window is the value of
HLSSlidingWindowLength * HLSMediaFileDuration
. HTTP Live Streaming clients use the sliding window to configure the seek bar. The default value is 6.
See
Configure a sliding window (HLS)
.
HLSTSSegmentMaxAge
No
Specifes the max-age to set in the cache-control header for TS segment responses, in seconds. The default value for HLS Live is -1 which doesn’t set a cache-control header. The default value for HLS on-demand is 86400 (1 day).
HttpStreamingUnavailableResponseCode
No
The HTTP response code that FMS returns for unavailable fragments (end-of-program, gaps, etc.)
The default is 503.
HLSMaxEventAge
No
The maximum number of seconds FMS allows the bootstrap to age before marking it as stale. If the bootstrap age is greater than this value, the stream is considered to be down.
The default is 300.
Directive Required Description
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 71
Getting started streaming media
Last updated 7/19/2012
Configure live HTTP streaming
You can configure live HTTP Dynamic Streaming and live HTTP Live Streaming at the following levels:
Configure live HTTP streaming at the application level (Application.xml)
To configure HTTP streaming for all live events in an application, use the Application.xml file. The Application.xml file overrides settings in the httpd.conf file for a single application.
Place the Application.xml file in the application folder. For example, rootinstall/applications/livepkgr/Application.xml.
Note: Configuring HTTP streaming in the Application.xml file at the vhost level is not supported.
The following is an Application.xml file with all possible configuration elements for HTTP streaming:
Directive
Required
Description
HdsHttpStreamingLiveEventPath
Yes
The physical location of the root of the event path for HDS. This can be relative to the Apache installation root.
For example, “C:\Program Files\Adobe\Adobe Media Server 5\applications”or “..\applications.”
HlsHttpStreamingLiveEventPath
Yes
The physical location of the root of the event path for HLS. This can be relative to the Apache installation root.
For example, “C:\Program Files\Adobe\Adobe Media Server 5\applications”or “..\applications.”
MaxBootstrapAge
No
The maximum number of seconds the Control Plane module lets the bootstrap age before marking it as stale. If the bootstrap age is greater than this value, the stream is considered to be down and the Control Plane module sets the
up
status to false.
The default is 300.
HttpStreamingURLSandboxLevel
No
The Level at which
HttpStreamingLiveEventPath
sandboxes the access. You should set this to match corresponding settings in HDS and HLS configurations. Valid values include App, Application, Inst, Instance, and Server. The default is Server.
For example, if
HdsHttpStreamingLiveEventPath
is set to
../applications/livepkgr/events/_definst_
, set
HttpStreamingURLSandboxLevel
to Inst. if
HdsHttpStreamingLiveEventPath
is set to
../applications/livepkgr/
, set
HttpStreamingURLSandboxLevel
to App.
For information on similar HDS and HLS settings, see
“Configure
live and on-demand HTTP Streaming at the server level
(httpd.conf)” on page
66
Level
Configuration file
Server
rootinstall/Apache2.2/conf/httpd.conf
Application
rootinstall/applications/livepkgr/Application.xml
Event
rootinstall/applications/livepkgr/events/_definst_/liveevent/Event.xml
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 72
Getting started streaming media
Last updated 7/19/2012
<Application>
<StreamManager>
<Live>
<AssumeAbsoluteTime></AssumeAbsoluteTime>
</Live>
</StreamManager>
<HDS>
<HLS>
<KeyframeIntervalPerMediaFile></KeyframeIntervalPerMediaFile>
<MediaFileDuration></MediaFileDuration>
<SlidingWindowLength></SlidingWindowLength>
<Encryption enabled=”true”>
<KeyFile></KeyFile>
<KeyURI></KeyURI>
</Encryption>
</HLS>
<Recording>
<FragmentDuration></FragmentDuration>
<SegmentDuration></SegmentDuration>
<FrameRate></FrameRate>
<FramesPerKeyframeInterval></FramesPerKeyframeInterval>
<KeyframeIntervalsPerFragment></KeyframeIntervalPerFragment>
<FramePrecision></FramePrecision>
<DiskManagementDuration></DiskManagementDuration>
<ContentProtection enabled=”true”>
<ProtectionScheme></ProtectionScheme>
<PHDS>
<CommonKeyFile></CommonKeyFile>
<VideoEncryptionLevel></VideoEncryptionLevel>
<UpdateInterval></UpdateInterval>
<SWFVerification enabled=”true”>
<WhiteListFolder></WhiteListFolder>
<UpdateInterval></UpdateInterval>
</SWFVerfication>
</PHDS>
<FlashAccessV2>
<ContentID></ContentID>
<CommonKeyFile></CommonKeyFile>
<LicenseServerURL></LicenseServerURL>
<TransportCertFile></TransportCertFile>
<LicenseServerCertFile></LicenseServerCertFile>
<PackagerCredentialFile></PackagerCredentialFile>
<PackagerCredentialPassword></PackagerCredentialPassword>
<PolicyFile></PolicyFile>
</FlashAccessV2>
</ContentProtection>
</Recording>
</HDS>
</Application>
For information about each element, see
“Application.xml and Event.xml” on page
73
.
Configure live HTTP streaming at the event level (Event.xml)
To configure a single event, use an Event.xml file. Copy the Event.xml file to a live event folder. The default live event is rootinstall/applications/livepkgr/events/_definst_/liveevent. The Event.xml file overrides the Application.xml file and the Apache httpd.conf file for a single live event. Every live event folder must have a single Event.xml file.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 73
Getting started streaming media
Last updated 7/19/2012
Note: There are a few exceptions in which the Event.xml configuration does not override the Application.xml configuration. These exceptions are noted with the configuration parameter.
The following is an Event.xml file with all possible configuration elements for HTTP streaming:
<Event>
<EventID></EventID>
<HLS>
<KeyframeIntervalPerMediaFile></KeyframeIntervalPerMediaFile>
<MediaFileDuration></MediaFileDuration>
<SlidingWindowLength></SlidingWindowLength>
<Encryption enabled=”true”>
<KeyFile></KeyFile>
<KeyURI></KeyURI>
</Encryption>
</HLS>
<Recording>
<FragmentDuration></FragmentDuration>
<SegmentDuration></SegmentDuration>
<FrameRate></FrameRate>
<FramesPerKeyframeInterval></FramesPerKeyframeInterval>
<KeyframeIntervalsPerFragment></KeyframeIntervalPerFragment>
<FramePrecision></FramePrecision>
<DiskManagementDuration></DiskManagementDuration>
<ContentProtection enabled=”true”>
<ProtectionScheme></ProtectionScheme>
<PHDS>
<CommonKeyFile></CommonKeyFile>
<VideoEncryptionLevel></VideoEncryptionLevel>
<PlaybackExpiration></PlaybackExpiration>
<UpdateInterval></UpdateInterval>
<SWFVerification enabled=”true”>
<WhiteListFolder></WhiteListFolder>
<UpdateInterval></UpdateInterval>
</SWFVerfication>
</PHDS>
<FlashAccessV2>
<ContentID></ContentID>
<CommonKeyFile></CommonKeyFile>
<LicenseServerURL></LicenseServerURL>
<TransportCertFile></TransportCertFile>
<LicenseServerCertFile></LicenseServerCertFile>
<PackagerCredentialFile></PackagerCredentialFile>
<PackagerCredentialPassword></PackagerCredentialPassword>
<PolicyFile></PolicyFile>
</FlashAccessV2>
</ContentProtection>
</Recording>
</Event>
Application.xml and Event.xml
Root elements
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 74
Getting started streaming media
Last updated 7/19/2012
Configurations for HTTP Live Streaming
Use the elements in the
<HLS>
container to configure HTTP Live Streaming. In the Application.xml file, the elements are located at
//Application/HDS/HLS
. In the Event.xml file, the elements are located at
//Event/HLS
.
Configurations for recording
Use the elements in the
<Recording>
container to configure how the server writes files to disk. In the Application.xml file, the elements are located at
//Application/HDS/Recording
. In the Event.xml file, the elements are located at
//Event/Recording
.
Element
Description
Default
//Application
The root element for an Application.xml configuration file.
N/A
//Event
The root element for an Event.xml configuration file.
N/A
//Event/EventID
The name of a live event. This name is the same as the name of the event folder and the value of the Server-Side ActionScript
Stream.liveEvent
property.
liveevent
Element
Description
Default
/HLS/KeyframeIntervalPerMediaFile
Sets frame-based file duration.
See
“Configure F4F and TS fragment duration” on
page
55
.
None
/HLS/MediaFileDuration
The duration of the TS file to be served, in milliseconds. This number must be a multiple of the FragmentDuration.
See
“Configure F4F and TS fragment duration” on
page
55
.
None
/HLS/SlidingWindowLength
The seekable portion of the stream for Apple HTTP Live Streaming. The time within the window is the value of
SlidingWindowLength * MediaFileDuration
. HTTP Live Streaming clients use the sliding window to configure the seek bar.
The sliding window is relative to the current position of the live stream.
See
“Configure a sliding window (HLS)” on page
16
.
6
/HLS/Encryption
Set the
enabled
attribute to
“allow”
to allow
PHLS
configurations in the Event.xml file to override settings in the Application.xml file.
Set the
enabled
attribute to
“true”
to configure
PHLS
in the Application.xml file. These configurations apply to all live events in the application.
None
/HLS/Encryption/KeyFile
The path of the default cipher key used to encrypt the content.
None
/HLS/Encryption/KeyURI
The URI that the client uses to fetch the decryption key.
None
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 75
Getting started streaming media
Last updated 7/19/2012
Configurations for content protection
Use the
ContentProtection
and
ProtectionScheme
elements to enable content protection with Protected HTTP Dynamic Streaming or Adobe Access.
Configurations for Protected HTTP Dynamic Streaming (PHDS)
Element
Description
Default
/Recording
The section that configures how the file is written to disk.
None
/Recording/DiskManagementDuration
The maximum duration of live content on disk, in hours. Use a fractional value to specify minutes. When this value is set in Application.xml, it cannot be overridden in Event.xml.
See
“Disk management” on page
61
.
3
/Recording/FragmentDuration
The length of each fragment, in milliseconds. Each segment can contain one or more fragments. See
“Configure F4F and TS fragment duration” on page
55
.
4000
/Recording/FramePrecision
The rounding precision for the fragment run table, in frame units. Frame units are derived from the specified frame rate (1/rate). See
“Configure F4F and TS fragment
duration” on page
55
.
1
/Recording/FrameRate
The frame rate of the original content, in frames per second (fps). The value is floating point; for NTSC, use the value 29.97. See
“Configure F4F and TS fragment
duration” on page
55
.
None
/Recording/FramesPerKeyframeInterval
The number of frames between each keyframe. For example, 30 fps video with a keyframe every 2 seconds contains 60 frames per keyframe interval. See
“Configure
F4F and TS fragment duration” on page
55
.
None
/Recording/IOBufferSize
The size of the IO buffer for the recording, in bytes. The IO buffer loads the disk file into a buffer in memory. It reads and writes to the buffer in the memory instead of making system calls. See
“Configure the size of the IO buffer” on
page
61
.
4096
/Recording/KeyframeIntervalsPerFragment
The number of keyframe intervals per fragment. The default value is 1, which means that the fragment size is the same as the keyframe interval. See
“Configure F4F and
TS fragment duration” on page
55
.
1
/Recording/SegmentDuration
The length of each segment, in milliseconds. Each .f4f file contains one segment.
See
“Configure F4F and TS fragment duration” on
page
55
.
400000
Element
Description
Default
/ContentProtection
Whether to enable content for protection with Protected HTTP Dynamic Streaming or Adobe Access. To enable content protection, set the
enabled
attribute to
true
.
None
/ContentProtection/ProtectionScheme
The type of protection. Possible values are
phds
and
FlashAccessV2
.
None
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 76
Getting started streaming media
Last updated 7/19/2012
Use the elements in the
PHDS
container to configure Protected HTTP Dynamic Streaming. In the Application.xml file, the elements are located at
//Application/HDS/Recording/ContentProtection/PHDS
. In the Event.xml file, the elements are located at
//Event/Recording/ContentProtection/PHDS
.
Configurations for Adobe Access
Use the elements in the
FlashAccessV2
container to configure content protection with Adobe Access. In the Application.xml file, the elements are located at
//Application/HDS/Recording/ContentProtection/FlashAccessV2
. In the Event.xml file, the elements are located at
//Event/Recording/ContentProtection/FlashAccessV2
.
For information about the elements in the
FlashAccessV2
container, see
“Encrypt content for Adobe Access
protection” on page
63
.
Manifest.xml
Adobe Media Server 5 introduces set-level manifest files that replace Manifest.xml files. However, Adobe Media Server 5 supports Manifest.xml files and, in some cases, you may want to use them.
For example, Flash Media Playback does not support set-level manifest files. To use Flash Media Playback for DVR or multi-bitrate streaming, configure a Manifest.xml file.
The following is the default Manifest.xml file with an added
<dvrInfo>
element:
<manifest xmlns=”http://ns.adobe.com/f4m/1.0″>
<dvrInfo beginOffset=”0″></dvrInfo>
<media streamId=”livestream1″ bitrate=”100″>
</media>
<media streamId=”livestream2″ bitrate=”200″>
</media>
<media streamId=”livestream3″ bitrate=”350″>
</media>
</manifest>
Element
Attribute
Description
dvrInfo
beginOffset
An offset, in seconds, from the beginning of the recorded stream. Clients can begin viewing the stream at this location. The default value is 0.
endOffset
An offset, in seconds, before the current duration of the recorded stream. Clients cannot view the stream before this location. The default value is 0.
Negative values are treated as 0. If neither
endOffset
nor
beginOffset
is set, the start time is the beginning of the content.
media
Represents one stream.
streamID
The name of the publishing stream.
bitrate
The bitrate at which the stream was encoded.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 77
Getting started streaming media
Last updated 7/19/2012
Note: Manifest.xml files support F4M v1.0 only (if not using best-effort fetch).
bestEffortFetchInfo
Parent element for best effort fetchconfiguration. If thiselement is present, AMS enables best effort fetch.
The
bestEffortFetchInfo
element is expected to be a part of F4M 2.0. To specify your Manifest.xml as F4M 2.0, you must change the
xmlns
attribute to “http://ns.adobe.com/f4m/2.0”. AMS currently honors this syntax. However, since the official F4M specification 2.0 is not yet complete, this element may change in future releases.
maxForwardFetches
Maximum total number of forward fetches that the OSMF player performs when it encounters a liveness or dropout error that is encountered. If the forward fetches fail, the OSMF player reverts to non-best-effort behavior.
The default is 2.
maxBackwardFetches
Maximum number of consecutive failed backward fetches that OSMF player performs before reverting to non-best-effort behavior. A value of 0 indicates that no backward fetches will be performed.
The default is 2.
fragmentDuration
Corresponds to the fragment interval (in seconds) that is currently in use on the packaging server. You can specify up to 3 decimal points.
Ensure that this value matches the configured
FragmentInterval
in your Event.xml file. Differences of as little as a millisecond can result in incorrect best effort fetch behavior.
This attribute is required.
segmentDuration
Corresponds to the segment interval (in seconds) that is currently in use on the packaging server. You can specify up to 3 decimal points.
Ensure that this value matches the configured
SegmentInterval
in your Event.xml file. Differences of as little as a millisecond can result in incorrect best effort fetch behavior.
This attribute is required.
For more on
fragmentDuration
and
segmentDuration
, see
“Configure live
HTTP streaming” on page
71
.
Element Attribute Description
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 78
Getting started streaming media
Last updated 7/19/2012
Note: The
bestEffortFetchInfo
element is expected to be a part of F4M 2.0. To use best-effort fetch, specify your Manifest.xml as F4M 2.0 by changing the xmlns attribute to “http://ns.adobe.com/f4m/2.0″. AMS currently honors this syntax. However, since the official F4M specification 2.0 is not yet complete, this element may change in future releases.
Specify the
bestEffortFetchInfo
element in the set-level manifest. AMS ignores
bestEffortFetchInfo
elements specified in the stream-level manifest.
Configure on-demand HTTP streaming
You can configure on-demand HTTP Dynamic Streaming and HTTP Live Streaming at the following levels:
Configure on-demand HTTP streaming at the stream level (jit.conf)
Configure stream-level configuration live in a jit.conf file. Create a jit.conf file and copy it to the same directory as the on-demand stream or streams. A directory can contain only 1 jit.conf file. The settings in the file apply to all content in the directory.
The following is a jit.conf file with all possible configurations:
Level
Configuration file
Server
rootinstall/Apache2.2/conf/httpd.conf
Stream
jit.conf
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 79
Getting started streaming media
Last updated 7/19/2012
<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns=”http://ns.adobe.com/f4m/1.0″ xmlns:hds=”http://ns.adobe.com/hds-package/1.0″>
<hds:frame-rate></hds:frame-rate>
<hds:frames-per-keyframe-interval></hds:frames-per-keyframe-interval>
<hds:fragment-duration></hds:fragment-duration>
<hds:keyframe-intervals-per-fragment><hds:keyframe-intervals-per-fragment>
<hds:hls>
<hds:keyframe-intervals-per-media-file></hds:keyframe-intervals-per-media-file>
<hds:media-file-duration></hds:media-file-duration>
<hds:encryption enabled=”true”>
<hds:keyfile></hds:keyfile>
<hds:keyuri></hds:keyuri>
</hds:encryption>
</hds:hls>
<hds:content-protection enabled=”true”>
<hds:protection-scheme>phds</hds:protection-scheme>
<hds:phds>
<hds:common-key-file></hds:common-key-file>
<hds:video-encryption-level></hds:video-encryption-level>
<hds:playback-expiration></hds:playback-expiration>
</hds:phds>
<hds:FlashAccessV2>
<hds:content-id></hds:content-id>
<hds:common-key-file></hds:common-key-file>
<hds:license-server-url></hds:license-server-url>
<hds:transport-cert-file></hds:transport-cert-file>
<hds:license-server-cert-file></hds:license-server-cert-file>
<hds:packager-credential-file></hds:packager-credential-file>
<hds:packager-credential-password></hds:packager-credential-password>
<hds:policy-file></hds:policy-file>
</hds:FlashAccessV2>
</hds:content-protection>
</manifest>
Configurations for recording to disk
For more information about elements in this table, see
“Configure F4F and TS fragment duration” on page
55
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 80
Getting started streaming media
Last updated 7/19/2012
Configurations for content protection
Element
Description
Default
//manifest/hds:fragment-duration
Use this element to configure fragment duration by time.
The fragment duration for the set of content, in seconds. The value can be fractional (for example, to specify 2002 milliseconds, use the value 2.002).
If this value is not specified, the value is taken from the module configurations in httpd.conf.
See
“Configure F4F and TS fragment duration” on
page
55
.
None
//manifest/hds:frame-rate
Use this element to configure fragment duration by frame rate.
The frame rate that determines the fragment duration for the set of content. Units are frames/second, and can be fractional (i.e. 29.97 for NTSC) .
See
“Configure F4F and TS fragment duration” on
page
55
.
None
//manifest/hds:frames-per-keyframe-interval
Use this element to configure fragment duration by frame rate.
The number of frames per keyframe interval (GOP). Units are frames, and should be a whole integer value.
See
“Configure F4F and TS fragment duration” on
page
55
.
None
//manifest/hds:keyframe-intervals-per-fragment
Use this element to configure fragment duration by frame rate.
The number of keyframe intervals per fragment. Units are keyframe intervals per fragment, and should be a whole integer value.
See
“Configure F4F and TS fragment duration” on
page
55
.
1
//manifest/hds:hls
Container for Apple HTTP Live Streaming configurations.
N/A
//manifest/hds:hls/hds:keyframe-intervals-per-media-file
Use this element to configure a frame-based file duration.
The number of keyframe intervals per TS file duration. The value must be a whole integer.
See
“Configure F4F and TS fragment duration” on
page
55
.
None
//manifest/hds:hls/hds:media-file-duration
Use this element to configure a time-based file duration.
The TS file duration, in milliseconds, for the set of content associated with this file. Use a value that is a multiple of the fragment duration.
See
“Configure F4F and TS fragment duration” on
page
55
.
None
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 81
Getting started streaming media
Last updated 7/19/2012
Use the
ContentProtection
and
ProtectionScheme
elements to enable content protection with Protected HTTP Dynamic Streaming or Adobe Access.
Configurations for protected HTTP Dynamic Streaming (PHDS)
Use the elements in the
<hds:phds>
container to configure content protection with PHLS.
Configurations for protected HTTP Live Streaming (PHLS)
Use the elements in the
<hds:hls>
container to configure content protection with PHLS.
Configurations for Adobe Access
Use the elements in the
<hds:FlashAccessV2>
container to configure content protection with Adobe Access.
For more information, see
“Encrypt content for Adobe Access protection” on page
63
.
Build custom media players
Build media players for the live and vod services
Adobe has developed the Open Source Media Framework (OSMF) to make it easier to build media players. OSMF is an open software framework for building robust, feature rich video players and applications based on the Flash Platform. For information about building a media player with the OSMF library, see
Building streaming video players
in Flash with the Adobe Open Source Media Framework
.
You can also use ActionScript to build a media player from scratch. For more information, see the following:
•
“Developing streaming media applications” on page
161
•
“Build an HTTP Dynamic Streaming media player” on page
84
Connect to a streaming service
Like all Adobe Media Server applications, streaming services expect a
NetConnection.connect()
URI in the following format:
rtmp://fms-ip-or-dna/serviceName/[formatType:][instanceName/]fileOrStreamName
hostName
The Adobe Media Server domain name.
serviceName
Either
live
or
vod
.
instanceName
If the client is connecting to the default instance, you can either omit the instance name or use
_definst_
. If the client is connecting to an instance you have created, such as room1, use that name.
formatType
For mp3 files,
mp3:
. For MP4/F4V files,
mp4:
. Not required for FLV files.
Element
Description
Default
//manifest/hds:content-protection
Whether to enable content for protection with Protected HTTP Dynamic Streaming or Adobe Access. To enable content protection, set the
enabled
attribute to
“true”
.
None
//manifest/hds:content-protection/hds:protection-scheme
The type of protection. Possible values are
phds
and
FlashAccessV2
.
None
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 82
Getting started streaming media
Last updated 7/19/2012
fileOrStreamName
Either a filename (for example, my_video.mp4) or a path (for example, subdir/subdir2/my_video.mp4), for example,
rtmp://www.examplemediaserver.com/vod/mp4:ClassicFilms/AnOldMovie.mp4
. For MPEG-4-based files, if the file on the server uses a filename extension (.mp4, .f4v, and so on), specify it. If the stream is live and the publisher specified a filename extension, specify it.
Unsupported ActionScript APIs
Clients for the vod and live services can use any ActionScript APIs except remote shared objects (
SharedObject.getRemote()
).
You cannot edit the server-side code for streaming services. However, the services do have a custom API that lets you access information from the server. Call the
NetConnection.call()
method from client-side code and pass it the name of the API you want to call.
More Help topics
“Streaming services API” on page
83
Allow connections from specific domains
By default, clients can connect to the live and vod services from any domain. You can limit the domains from which clients can connect.
❖
Navigate to the rootinstall/applications/live or rootinstall/applications/vod folder and do one of the following:
•
To add a domain for SWF clients, edit the allowedSWFdomains.txt file.
•
To add a domain for HTML clients, edit the allowedHTMLdomains.txt file.
The TXT files contain detailed information about adding domains.
Access raw audio and video data
Note: Adobe Media Server Standard supports this feature through the Access plug-in only.
Beginning with Adobe Media Server 3 and Flash Player 9.0.115, you can access raw audio and video data in streams. Use this data to create snapshots in your applications. To access the data, call the ActionScript 3.0
BitmapData.draw()
and
SoundMixer.computeSpectrum()
methods. For more information, see
ActionScript 3.0
Reference for Flash Platform
.
By default, Adobe Media Server prevents you from accessing streams. To allow stream access, do the following:
1
Move the main.far file from rootinstall/applications/live or rootinstall/applications/vod to rootinstall/samples/applications/live or rootinstall/samples/applications/vod.
You cannot edit FAR files, so you must replace main.far with main.asc.
2
Copy the main.asc file from rootinstall/samples/applications/live or rootinstall/samples/applications/vod to rootinstall/applications/live or rootinstall/applications/vod.
3
Open the main.asc file in a text editor.
4
Uncomment the following code to allow all clients to access all streams:
//p_client.audioSampleAccess = “/”;
//p_client.videoSampleAccess = “/”;
5
Save the main.asc file.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 83
Getting started streaming media
Last updated 7/19/2012
Streaming services API
getStreamLength()
getStreamLength(streamObj)
Returns the length of a stream, in seconds. Call this method from a client-side script and specify a response object to receive the returned value.
Availability
Adobe Media Server 3, vod streaming service
Parameters
streamObj
A Stream object.
Returns
A number.
Example
The following client-side code gets the length of the
sample_video
stream and returns the value to
returnObj
:
nc.call(“getStreamLength”, returnObj, “sample_video”);
getPageUrl()
getPageUrl()
Returns the URL of the web page in which the client SWF file is embedded. If the SWF file isn’t embedded in a web page, the value is the location of the SWF file. The following code shows the two examples:
// trace.swf file is embedded in trace.html.
getPageUrl returns: http://www.example.com/trace.html
// trace.swf is not embedded in an HTML file.
getPageUrl returns: http://www.example.com/trace.swf
The value must be an HTTP address. For security reasons, local file address (for example, file:///C:/Adobe Media Server applications/example.html) are not displayed.
Availability
Adobe Media Server 3, vod streaming service, live streaming service
Example
The following example calls the
getPageUrl()
method on the server:
nc.call(“getPageUrl”, returnObj);
getReferrer()
getReferrer()
Returns the URL of the SWF file or the server where the connection originated.
Availability
Adobe Media Server 3, vod streaming service, live streaming service
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 84
Getting started streaming media
Last updated 7/19/2012
Example
The following code calls the
getReferrer()
method on the server:
myNetConnection.call(“getReferrer”, returnObj);
Build an HTTP Dynamic Streaming media player
Use Open Source Media Framework (OSMF)
You don’t need to build an HTTP Dynamic Streaming media player—
Strobe Media Playback
and
Flash Media
Playback
support HDS by default.
If you do decide to build a custom player, Adobe strongly recommends using OSMF. OSMF is a robust framework designed to deliver high-quality video. Use the
OSMF Sample Player for HTTP Dynamic Streaming
as a reference
implementation. The OSMF Sample Player uses the ActionScript 3.0
NetStream.appendBytes()
API to deliver bytes to Flash Player and AIR.
Understanding the application flow for live HTTP Dynamic Streaming
To play a stream, a media player requests a .f4m file. The player contains logic that requests additional files when a user seeks, pauses, and plays media. The Adobe Media Server Live Packager (livepkgr application) creates these files when the server ingests a live stream or when a client requests an on-demand media file.
The HTTP Origin Module generates the .f4m file when it is requested. The file is not physically present on the disk.
However, you can request the file even when a live stream has stopped publishing.
To stream media using Adobe HDS, Adobe Media player requests Adobe Media Manifest files (.f4m).
The manifest file contains information about a media asset or information about each stream in a multiple stream event. This information can include the location of the media, DRM additional header data, media bootstrap information, adaptive streaming bitrates, and so on.
The Apache HTTP modules create the F4M and M3U8 files as the streams are packaged and written to disk. To create these files, the HTTP modules use metadata from the Event.xml file (if it exists), the multi-level manifest file, and data from the .f4f, .f4x, .meta, .bootstrap, and .drmmeta files.
Important: Do not move the files from their original locations.
To generate the file, the HTTP modules follow these steps:
1
Combine the request URL and the
HttpStreamingLiveEventPath
directive to locate the live event.
2
Retrieve metadata about the event from the Event.xml file and the multi-level manifest file.
3
Scan the event directory for stream record files (.stream).
4
Retrieve the path to the corresponding content from each .stream file. Each .stream file becomes a
<media>
element in the manifest file.
5
Retrieve metadata from the .meta file.
6
Create links to the bootstrap information and DRM additional header data (if the content is protected).
7
Return the generated manifest document (.f4m or .m3u8).
For more information, see the F4M File Format Specification at
adobe.com
.
For more information, sabout the M3U8 file, see the the HTTP Live Streaming
Internet-Draft
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 85
Getting started streaming media
Last updated 7/19/2012
In the rootinstall\applications\livepkgr\streams\_definst_ folder, the Live Packager creates a folder with the name of each stream, livestream1, livestream2, and livestream3. The Live Packager creates the following files in each folder:
•
livestream#.bootstrap
•
livestream#.control
•
livestream#.meta
•
livestream#Seg#.f4f
•
livestream#Seg#.f4x
These are the files that an HTTP Dynamic Streaming media player requests to handle pausing, fast forwarding, rewinding, and so on. The following table describes each file type:
The following are the URL request formats for these files when Apache is configured for HTTP Dynamic Streaming:
For more information about configuring Apache for HTTP Dynamic Streaming, see
Apache configurations for HTTP
Dynamic Streaming
.
Sample .f4m manifest file
The player uses the manifest file to request a content fragment. In the following example, there are two streams associated with the live event, “myStream” and “myStream1”. The
<media>
elements provide the absolute URL path to the content location with the prefix “/live/streams”.
If .bootstrap and .drmmeta are found in the same location as the .f4f file,
<bootstrap>
and
<drmAdditionalHeader>
elements are included in the manifest file. The .drmmeta file can be shared across multiple streams, therefore there is only one
<drmAdditionalHeader>
element in the sample manifest file. Both myStream and myStream1 refer to the same .drmmeta file through the
drmAdditionalHeaderId
attribute.
The
metadata
element contains the metadata for one piece of media in Base64 encoding. The metadata is the same information dispatched in the ActionScript
NetStream.onMetaData()
event.
File
Description
livestream#Seg#.f4f
A segment. The Live Packager outputs one or more F4F files. Each file contains a segment of the source file. Each segment contains the fragmented (and optionally protected) content.
livestream#Seg#.f4x
An index file listing the fragment offsets in each .f4f file. The Live Packager outputs one or more F4X files. The HTTP Origin Module uses this file to deliver fragments.
livestream#.meta
Contains the stream metadata (bitrate, screen size, and so on).
livestream#.bootstrap
Contains the bootstrap information for the stream.
livestream#.control
Contains internal metadata that the Live Packager uses to manage stream state.
livestream#.drmmeta
Contains additional header information when a stream is encrypted for use with Adobe Access.
Request type
URL Form
Fragment
http://<host>/<location-tag-alias>/streams/<app-name>/streams/<app-instance>/<stream name>Seg<segment #>-Frag<fragment #>
Note:You cannot request an F4F file directly. Request a Fragment.
Bootstrap (.bootstrap)
http://<host>/<location-tag-alias>/streams/<app-name>/streams/<app-instance>/<stream name>.bootstrap
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 86
Getting started streaming media
Last updated 7/19/2012
<?xml version=”1.0″ encoding=”UTF-8″ ?>
<manifest xmlns=”http://ns.adobe.com/f4m/1.0″>
<id>live_mbr_event</id>
<streamType>live</streamType>
<duration>0</duration>
<bootstrapInfo
profile=”named”
url=”/live/streams/myStream.bootstrap”
id=”bootstrap2267″ />
<drmAdditionalHeader
url=”/live/streams/myStream.drmmeta”
drmContentId=”live_mbr_event”
id=”drmMetadata9996″ />
<media>
url=”/live/streams/myStream”
bitrate=”408″
bootstrapInfoId=”bootstrap2267″
drmAdditionalHeaderId=”drmMetadata9996″>
<metadata>AgAKb25NZXRhRGF0YQgAAAAAAAhkdXJhdGlvbgBARo9cKPXCjwAFd2lkdGgAQJQAAAAAAAAABmhlaWdodABAho
AAAAAAAAAMdmlkZW9jb2RlY2lkAgAEYXZjMQAMYXVkaW9jb2RlY2lkAgAEbXA0YQAKYXZjcHJvZmlsZQBAWQAA
AAAAAAAIYXZjbGV2ZWwAQEAAAAAAAAAABmFhY2FvdAAAAAAAAAAAAAAOdmlkZW9mcmFtZXJhdGUAQD34U+JVay
gAD2F1ZGlvc2FtcGxlcmF0ZQBA53AAAAAAAAANYXVkaW9jaGFubmVscwBAAAAAAAAAAAAJdHJhY2tpbmZvCgAA
AAIDAAZsZW5ndGgAQTSinwAAAAAACXRpbWVzY2FsZQBA3UwAAAAAAAAIbGFuZ3VhZ2UCAANlbmcAAAkDAAZsZW
5ndGgAQUCGAAAAAAAACXRpbWVzY2FsZQBA53AAAAAAAAAIbGFuZ3VhZ2UCAANlbmcAAAkAAAk=
</metadata>
</media>
<bootstrapInfo
profile=”named”
url=”/live/streams/myStream1.bootstrap”
id=”bootstrap7975″ />
<media>
url=”/live/streams/myStream1″
bitrate=”1108″
bootstrapInfoId=”bootstrap7975″
drmAdditionalHeaderId=”drmMetadata9996″>
<metadata>AgAKb25NZXRhRGF0YQgAAAAAAAhkdXJhdGlvbgBARo9cKPXCjwAFd2lkdGgAQJQAAAAAAAAABmhlaWdodABAho
AAAAAAAAAMdmlkZW9jb2RlY2lkAgAEYXZjMQAMYXVkaW9jb2RlY2lkAgAEbXA0YQAKYXZjcHJvZmlsZQBAWQAA
AAAAAAAIYXZjbGV2ZWwAQEAAAAAAAAAABmFhY2FvdAAAAAAAAAAAAAAOdmlkZW9mcmFtZXJhdGUAQD34U+JVay
gAD2F1ZGlvc2FtcGxlcmF0ZQBA53AAAAAAAAANYXVkaW9jaGFubmVscwBAAAAAAAAAAAAJdHJhY2tpbmZvCgAA
AAIDAAZsZW5ndGgAQTSinwAAAAAACXRpbWVzY2FsZQBA3UwAAAAAAAAIbGFuZ3VhZ2UCAANlbmcAAAkDAAZsZW
5ndGgAQUCGAAAAAAAACXRpbWVzY2FsZQBA53AAAAAAAAAIbGFuZ3VhZ2UCAANlbmcAAAkAAAk=
</metadata>
</media>
</manifest>
Stream record files
A stream record file (.stream) is an XML document that contains the physical location of the stream. The server creates the stream record file when an incoming stream is associated with a live event. The server creates the file with an encoded name in the following location:
applications/appname/events/appinstancename/eventname/MTg1ODAyNjgwNg=.stream
The HTTP Origin Module reads the stream record file to locate the content for the stream. The following is the format of the .stream file:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 87
Getting started streaming media
Last updated 7/19/2012
<?xml version=”1.0″ encoding=”UTF-8″?>
<stream xmlns=”http://www.adobe.com/liveevent/1.0″>
<type>
f4f
</type>
<name>
livestream
</name>
<path>
C:\Program Files\Adobe\Adobe Media Server 5\applications\myapp\streams\_definst_\livestream
</path>
</stream>
Offline packaging for HLS
The Adobe Media Server installation includes a command line tool for packaging on-demand media files into fragmented video content that can be streamed over HTTP. This offline packager can also encrypt files for protection with Adobe Access.
The
hlspackager
is the command line tool that takes F4V source and produces fragmented HLS VOD content. You can pass various options to the packager either through the command line or through a configuration file. However, options passed through the command line will override the corresponding options specified in the configuration file.
Note: The packager can recognize only F4F and MP4 files.
The packager tool generates several types of output files during the packaging process. They are:
•
m3u8 file (single-stream playlist)
•
TS segments listed in the m3u8 file
The following command shows the syntax of
hlspackager
:
hlspackager –input-file=<input> –output-path=<output> –base-url=<baseurl> –audio-only=<bool> –config-dump –help –media-target-duration=<fragmentLength> –conf-file=<confFile>
The various supported options are described in the following table:
Option
Description
Default
Required
–input-file
Path to the source file.
None
Yes
–output-path
Path for the HLS files to be created.
Current directory
No
–base-url
Base URL to append in the TS file names in the m3u8 file.
No base URL, relative to the m3u8 file
–media-target-duration
Target duration for each TS segment.
8000 ms
–conf-file
Specifies the configuration file that contains additional settings for the packaging process.
hlspackager_config.xml in working directory
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 88
Getting started streaming media
Last updated 7/19/2012
–config-dump
Output the finally applied configuration. In this case, packaging does not happen.
No output by default
–audio-only
Whether to extract audio only stream (”
true
“/”
false
“) .
false
–protection-scheme
Encryption scheme to be used (”
Vanilla
” or ”
FlashAccessV4
“).
None (No encryption)
Yes
–transport-cert
Specifies the DER-encoded transport certificate file to be used for content protection.
None
Yes, if scheme is
FlashAccessV4
–license-server-url
The URL of the license server that will handle license acquisition for this content.
None
Yes, if scheme is
FlashAccessV4
–license-server-cert
Specifies the DER-encoded license server certificate file to be used for content protection.
None
Yes, if scheme is
FlashAccessV4
–packager-credential
Specifies the PFX file containing the packager’s protection credentials.
None
Yes, if scheme is
FlashAccessV4
–credential-pwd
Specifies the password string used to secure the packager credentials.
None
Yes, if scheme is
FlashAccessV4
–common-key-file
The base key used (along with the content ID) to generate the final content encryption key.
Using the same common key and content ID for an entire set of content allows a single license to decrypt a set on content, which is useful for multi-bitrate use cases.
To generate the common key, see
“Hosting and key generation” on
page
89
None
Yes, if scheme is
FlashAccessV4
–content-id
The content ID for this content. Used along with the common key to generate the final content encryption key.
input-file-name
Optional (only for the
FlashAccessV4
scheme)
–policy-file
Specifies the file containing the policy to be used for this content.
Currently only a single policy can be applied to content packaged with this tool.
None
Yes, if scheme is
FlashAccessV4
–key-rotation-interval
The Key rotation interval for the ”
FlashAccessV4
” protection scheme. Specifies after how many segments, keys should be rotated.
0 , -1, or invalid values mean key rotation will be disabled.
No key rotation
Optional (only for the
FlashAccessV4
scheme)
Option Description Default Required
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 89
Getting started streaming media
Last updated 7/19/2012
Instead of passing the options along with the command, you can also pass a configuration file containing the options to the packager. The configuration file is an XML file that can be used to specify settings for the packaging process.
The packager checks whether a configuration file has been passed by the user. If not, it checks for the
hlspackager_config.xml
file in the same directory as the command-line program. The configuration file is not needed to run the packager. The format of the configuration file is:
<offline>
<input-file>/media/input-file.f4v</input-file>
<output-path>/media/http</output-path>
<fragment-duration></fragment-duration>
… other options…
</offline>
Hosting and key generation
You can host the fragmented content directly from the server’s webroot directory. For instance, if you keep the fragmented content inside the webroot/myOfflineContent/ directory, you can playback the content through the URL –
http://server-name/myOfflineContent/prog_index.m3u8.
Key generation for Vanilla content
The content fragmentation for the Vanilla encryption protection scheme will take base-64 encoded key as input. To generate the base-64 encoded key, run the OpenSSL command as shown below:
openssl rand -out keyfile.bin -base64 16
The generated
keyfile.bin
file has the base-64 key and can be used for content fragmentation. To generate the key for hosting, run:
–embed-leaf-license
Whether to embed the leaf license or not.
false
Optional (only for the
FlashAccessV4
scheme)
–license-server-cred-file
License server credential used when protecting content for the specified location.
None
Yes, if
embed-leaf-license
is set to true (only for the
FlashAccessV4
scheme)
–license-server-cred-pwd
License server credential password for the configured license server credential file.
None
Yes, if
embed-leaf-license
is set to true (only for the
FlashAccessV4
scheme)
–key-file-path
Key file path for “
Vanilla
” encryption (Base-64 encoded key).
To generate the common key, see
“Hosting and key generation” on
page
89
None
Yes, if scheme is
Vanilla
–key-file-url
Key file URL for ”
Vanilla
” encryption (plain 16-bit key only) .
To generate the common key, see
“Hosting and key generation” on
page
89
None
Yes, if scheme is
Vanilla
Option Description Default Required
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 90
Getting started streaming media
Last updated 7/19/2012
openssl base64 -d -in keyfile.bin -out plain-keyfile.bin
The
plain-keyfile.bin
file can be hosted for key delivery.
Key generation for Adobe Access content
To generate the base-64 encoded key, run the OpenSSL command as shown below:
openssl rand -out keyfile.bin -base64 16
Error codes
The following table describes the various error codes raised by the packager:
Troubleshoot issues with streaming media
Troubleshoot live streaming (HTTP)
1
Use the Services window (Windows) or the service window (Linux) to verify that the Adobe Media Server (AMS), Adobe Media Administration Server, and FMSHttpd services are running.
2
Verify that the request URL is correct. See
“URLs for publishing and playing live streams over HTTP” on page
15
.
3
Verify that the server is listening to the port to which the client is trying to connect. The rootinstall/logs/edge.xx.log file shows on which ports the server is listening.
Error Code
Description
Example
1
Input file is not found or invalid
Wrong or invalid input file path is specified.
2
Input file parameter is not mentioned
–input-file
parameter is missing.
3
Input file is not valid or corrupt
Corrupted mp4 file.
4
Cannot access the input file
Unable to open or access the input file .
7
Write error to disk
Unable to write m3u8 or ts segments to disk.
8
Unable to parse input xml file
Parsing issue.
9
Invalid program options
Parsing issues in the command line errors.
10
Invalid encryption parameters
Wrong license file or invalid key file.
12
System standard input or output errors
Inputs casting issue.
16
m3u8 generation error
Not able to generate m3u8 files.
17
ts file generation issues
Not able to generate the ts file.
18
Invalid target duration
Target duration is too less or too large.
19
Protection scheme is not valid
If a scheme other than “FlashAccessV4” or “Vanilla” is specified,
999
Internal processing error
–
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 91
Getting started streaming media
Last updated 7/19/2012
By default, Adobe Media Server listens on port 80 and proxies HTTP requests to Apache HTTP Server on port 8134. Proxying traffic can cause issues with HTTP streaming. If Adobe Media Server is listening on port 80, use port 8134 in the request URL. For example, http://ams.example.com:8134/hds-live/livepkgr/_definst_/liveevent/livestream.f4m.
Otherwise, configure Apache HTTP Server to listen on port 80 and configure Adobe Media Server not to listen on port 80. See
Configure ports for HTTP streaming
.
4
To allow a Adobe Media player hosted on another web server to access content from the Adobe Media Server web server, copy a crossdomain.xml file to the rootinstall/webroot directory. The crossdomain.xml file grants a web client permission to handle data across multiple domains. For more information, see
Cross-domain policy file
specification
.
5
In Flash Media Live Encoder, select the Encoding Options tab, choose Output from the Panel options menu, and verify the following:
•
The value of AMS URL is rtmp://ams-dns-or-ip/livepkgr. If you’re testing on the same server as Adobe Media Server, you can use the value localhost for ams-dns-or-ip.
•
For a single stream, the value of Stream is livestream?adbe-live-event=liveevent.
•
For adaptive bitrate streaming, the value of Stream is livestream%i?adbe-live-event=liveevent.
Flash Media Live Encoder uses this value to create unique stream names. To use another encoder, provide your own unique stream names, for example, livestream1?adbe-live-event=liveevent, livestream2?adbe-live-event=liveevent.
•
Check the logs for errors. Adobe Media Server logs are located in the rootinstall/logs folder. The master.xx.log file and the core.xx.log file show startup failures.
Apache logs are located in the rootinstall/Apache2.2/logs folder.
6
Use the Administration Console to verify that the encoder and the client connected to the livepkgr application.
See
Connect to the Administration Console
.
Troubleshoot live streaming (RTMP)
1
Use the Services window (Windows) or the service window (Linux) to verify that the Adobe Media Server (AMS) and Adobe Media Administration Server services are running.
If you’re using the Apache HTTP server, verify that the FMSHttpd service is running.
2
Use the Administration Console to verify that the encoder and the client connected to the live application.
See
Connect to the Administration Console
.
3
Verify that the server is listening to the port to which the client is trying to connect. The rootinstall/logs/edge.xx.log file shows on which ports the server is listening. By default, the server listens on ports 1935 and 80. If the server is not listening on port 1935, open the rootinstall/ams.ini file, set
ADAPTOR.HOSTPORT
= :1935,80 and restart the server.
In the access.00.log file, the
s-uri
and
cs-uri-stem
fields indicate the port to which the client attempted to connect. Unless you specify a port number in the URL, RTMP and RTMFP clients connect to the server over port 1935 and fall back to port 80.
For more information, see
Port requirements
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 92
Getting started streaming media
Last updated 7/19/2012
4
In Flash Media Live Encoder, select the Encoding Options tab, choose Output from the Panel options menu, and verify the following:
•
The value of AMS URL is rtmp://ams-dns-or-ip/live. If you’re testing on the same server as Adobe Media Server, you can use the value localhost for ams-dns-or-ip.
•
For a single stream, the value of Stream is livestream.
•
For adaptive bitrate streaming, the value of Stream is livestream%i.
5
Verify that the request URL is correc. See
“URLs for publishing and playing live streams over RTMP” on page
21
.
6
The live service does not support DVR recording.
Use the DVRCast application available from
Adobe Media Server Tools
. For more information, see the article
Using DVRCast with Flash Media Live Encoder
in the Adobe Media Server Developer Center.
7
Check the logs for errors. Adobe Media Server logs are located in the rootinstall/logs folder. The master.xx.log file and the core.xx.log file show startup failures.
Apache logs are located in the rootinstall/Apache2.2/logs folder.
Troubleshoot on-demand streaming (HTTP)
Note:
When you play a video over HTTP, the client does not connect to the vod application. Instead, Apache serves the video to the client.
1
Use the Services window (Windows) or the service window (Linux) to verify that the Adobe Media Server (AMS) and FMSHttpd services are running.
2
Verify that the server is listening to the port to which the client is trying to connect. The rootinstall/logs/edge.xx.log file shows on which ports the server is listening.
By default, Adobe Media Server proxies requests on port 80 to Apache HTTP Server on port 8134. Proxying HTTP streaming traffic can cause issues. If Adobe Media Server is listening on port 80, use port 8134 in the request URL. For example, http://ams.example.com:8134/hds-vod/sample1_1500.f4v.f4m. Otherwise, configure Apache HTTP Server to listen on port 80 and configure Adobe Media Server not to listen on port 80. See
Configure ports for HTTP
streaming
.
3
Verify that the request URL is correct. See
“URLs for playing on-demand streams over HTTP” on page
26
.
4
By default, Apache streams on-demand media from the rootinstall/webroot/vod folder. To change this location, see
“Content storage (HDS and HLS)” on page
47
.
5
Check the logs for errors. Apache logs are located in the rootinstall/Apache2.2/logs folder.
Troubleshoot on-demand streaming (RTMP)
1
Use the Services window (Windows) or the service window (Linux) to verify that the Adobe Media Server (AMS) and Adobe Media Administration Server services are running.
If you’re using the Apache HTTP Server, verify that the FMSHttpd service is running.
2
Use the Administration Console to verify that the client is connected to the vod application.
See
Connect to the Administration Console
.
3
Verify that the server is listening to the port to which the client is trying to connect. The rootinstall/logs/edge.xx.log file shows on which ports the server is listening. By default, the server listens on ports 1935 and 80. If the server is not listening on port 1935, open the rootinstall/ams.ini file, set
ADAPTOR.HOSTPORT
= :1935,80 and restart the server.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 93
Getting started streaming media
Last updated 7/19/2012
In the access.00.log file, the
s-uri
and
cs-uri-stem
fields indicate the port to which the client attempted to connect. Unless you specify a port number in the URL, RTMP and RTMFP clients connect to the server over port 1935 and fall back to port 80.
For more information, see
Port requirements
.
4
Open the Administration Console (rootinstall/tools/fms_adminConsole.htm) and choose View Applications to verify that the client is connecting to the vod application. To reset your password, see
Reset Administration Console
password
.
5
Verify that the request URL is correct. See
“URLs for playing on-demand media files over RTMP” on page
29
6
Do not include the /media folder in the stream URL to play the file. When you specify a filename, for example, mp4:mymediafile.f4v, the server is configured to look for /applications/vod/media/mymediafile.f4v.
7
Verify that the rootinstall/applications/vod directory is installed. If any files are missing, uninstall and reinstall the server.
8
Check the logs. Adobe Media Server logs are located in the rootinstall/logs folder. The master.xx.log file and the core.xx.log file show startup failures.
Troubleshoot multicast streaming (RTMFP)
1
Use the Services window (Windows) or the service window (Linux) to verify that the Adobe Media Server (AMS) and Adobe Media Administration Server services are running.
If you’re using the Apache HTTP Server, verify that the FMSHttpd service is running.
2
Use the Administration Console to verify that the encoder and the client connected to the multicast application.
See
Connect to the Administration Console
.
3
Follow the steps in the tutorial
“Multicast media (RTMFP)” on page
39
.
4
Verify that the correct ports are open. The rootinstall/logs/edge.xx.log file shows on which ports the server is listening.
Open UDP 1935 and 19350-65535. If the server is located behind a NAT, specify its public (outside NAT) address in the rootinstall/conf/_defaultRoot_/Adaptor.xml file in the Adaptor/RTMFP/Core/HostPortList element. See
Configure ports
.
5
Check the logs. Adobe Media Server logs are located in the rootinstall/logs folder. The master.xx.log file and the core.xx.log file show startup failures.
Contact Support
•
Post a question to the Adobe Media Server forum at
forums.adobe.com/community/flash/flash_media_server
.
Many members of the Adobe Media Server engineering and support teams answer questions in the forum.
•
Contact Adobe Support at
www.adobe.com/support
.
94
Last updated 7/19/2012
Chapter 2: Content protection
Configuring content protection for HDS
You can use Protected HTTP Dynamic Streaming (PHDS) or Adobe Access for protecting content for HDS.
Overview
Configure PHDS/Adobe Access for live streaming at the following levels:
•
Server—rootinstall/Apache2.2/conf/httpd.conf
•
Application—rootinstall/applications/livepkgr/Application.xml
•
Event—rootinstall/applications/livepkgr/events/_definst_/liveevent/Event.xml
PHDS
Use Adobe Media Server 5 to serve live and on-demand protected content to Flash Player and AIR over HTTP without using a DRM License Server. When Adobe Media Server packages the content, it generates the license and embeds it into the DRM metadata of the content stream. This feature is called Protected HTTP Dynamic Streaming (PHDS). In addition to encrypting content, PHDS also supports SWF verification for HTTP Dynamic Streaming.
The F4F packaging process for on-demand and live PHDS generates a license, embeds it in the DRM metadata, and delivers it with the media. Flash Player 11 and AIR 3 clients can retrieve the license from the content stream, which eliminates communication between the client and a License Server.
The Adobe Media Server installer generates credentials, certificates, and policy files to the rootinstall/creds directory. The installer also creates a common-key.bin file in the /creds directory. You can change the content of this file or create a new common key file. To create a common key file (common-key.bin), which is used to derive the Content Encryption Key, use the Scramble tool. See
Scramble tool
.
Use the following policy files to generate licenses for on-demand and live PHDS (AMS 5 includes four new policy files to support output protection):
Policy name
Description
phds_24hr_policy.pol
24 Hour limited policy
anonymous; 24 hours limited license caching
.
This is the default policy.
Users can start playback within 24 hours of the time the content was packaged. Users can continue watching the content until the end of the content (users may pause content).
The 24 hours window starts when the DRM metadata is generated.
phds_policy.pol
Unlimited policy
anonymous; unlimited license caching; and binding to Protected Streaming is permitted
This policy allows playback at any time.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 95
Content protection
Last updated 7/19/2012
The simple unlimited policy is not intended for a regular use. It is provided as a temporary work around in case there is an issue with the network. When media is cached on network devices between Adobe Media Server and Flash Player, clients may receive expired policy data from the network instead of the expected media from the server. If media that was generated with the 24 hours policy is cached for more than 24 hours the player does not allow playback. Switch to the unlimited PHDS policy as a temporary solution until the network configuration is fixed and the caches are flushed. This solution allows you to distribute media with lower protection instead of not distributing the media. After switching to the Unlimited Policy, flush the caches to allow the unlimited license to propagate to clients.
Adobe Access
To deliver live or on-demand content with HDS, you can enable HDS with Adobe Access for protected streaming. The Adobe Access server for protected streaming is a license server implementation optimized for use with HDS. See the Adobe Access documentation for more details.
Important: Use the HDS packagers to both encrypt and fragment content. Do not use the Adobe Access packaging tools to encrypt content. The HDS packagers cannot fragment encrypted content.
Note: The Adobe Access SDK and the Adobe Access license server reference implementation can issue licenses for HDS.
After you have deployed Adobe Access Server for protected streaming, configure Adobe Media Server to package and encrypt the content in real-time.
phds-24hr-OPBestEffort.pol
(AMS 5)
24 Hours Limited / Best Effort Output Protection Policy
Set in the same way as the 24 Hours Limited / No Output Protection Policy policy with an additional restriction to use hardware content protection, if available. Users are still able to playback media if the client hardware doesn’t support Output Protection. If the client hardware supports Output Protection but it is disabled, Flash Player returns DRM Run Time Error: 3342 (NoDigitalProtectionAvail).
phds-OPBestEffort.pol
(AMS 5)
Unlimited / Best Effort Protection Policy
Set in the same way as the Unlimited / No Output Protection Policy policy with an additional restriction to use hardware content protection, if available. Users arestill able to playback media if the client hardware doesn’t support Output Protection. If the client hardware supports Output Protection, but it is disabled, Flash Player returns DRM Run Time Error: 3342 (NoDigitalProtectionAvail).
phds-24hr-OPRequired.pol
(AMS 5)
24 Hours Limited / Required Output Protection Policy
Set in the same way as the 24 Hours Limited / No Output Protection Policy policy with an additional restriction to use hardware content protection. Users cannot playback media if the client hardware doesn’t support Output Protection. If the client hardware doesn’t support Output Protection or if it supports Output Protection, but it is disabled, Flash Player returns DRM Run Time Error: 3342 (NoDigitalProtectionAvail).
phds-OPRequired.pol
(AMS 5)
Unlimited / Required Output Protection Policy
Set in the same way as the Unlimited / No Output Protection Policy policy with an additional restriction to use hardware content protection. Users cannot playback media if the client hardware doesn’t support Output Protection. If the client hardware doesn’t support Output Protection or if it supports Output Protection but, it is disabled, Flash Player returns DRM Run Time Error: 3342 (NoDigitalProtectionAvail).
Policy name Description
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 96
Content protection
Last updated 7/19/2012
Live use case
In httpd.conf,
ContentProtection
tag is specified under
<Location hds-live>
.
Whereas, both the Application.xml file and the Event.xml file have a
ContentProtection
container that holds the live PHDS configuration settings. In Application.xml, the container is located under
//Application/HDS/Recording/ContentProtection
. In Event.xml, the container is located under
//Event/Recording/ContentProtection
.
Getting Started
To quickly get started with PHDS, you need to understand the following directives:
To configure PHDS with basic settings, perform the following steps:
1
After installing Adobe Media Server, navigate to the <root-install>/Apache 2.2/conf/ directory. Edit the http.conf file and add the following tags under
<Location hds-live>
:
<Location /hds-live>
HttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications”
HttpStreamingContentPath “../applications”
HdsFmsDirPath “..”
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingDrmmetaMaxAge 3600
HttpStreamingFragMaxAge -1
HttpStreamingEncryptionScope serverHttpStreamingProtectionScheme PHDS
</Location>
Note: This configuration change will enable PHDS at the server level.
2
Publish a live stream called “livestream?adbe-live-event=liveevent” to livepkgr.
3
Playback the stream using the URI http://<server-ip>:8134/hds-live/livepkgr/_definst_/liveevent/livetsream.f4m.
Detailed configuration
The following sections provides detailed configurations for both PHDS and Adobe Access schemes.
Directive
Default Value
Description
HttpStreamingEncryptionScope
content
Possible values are off, content, and server. When the value is off, content remains in the unprotected format. When the value is content, configuration settings in the application.xml or event.xml files are used to protect the content. When the value is server, configuration settings in the httpd.conf are used to protect the content.
HttpStreamingProtectionScheme
PHDS
Encryption type for the content. It can be FlashAccessV3, FlashAccessV2 or PHDS. HttpStreamingProtectionScheme is applicable if encryption is enabled. Use HttpStreamingEncryptionScope to determine the scope of the encryption.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 97
Content protection
Last updated 7/19/2012
Server level
Server-level configurations for live PHDS/Adobe Access
When server level configuration is specified, the protection parameters specified are applied server wide. Encryption parameters specified in Application/Event level will be ignored.
Adobe Media Server 4.5.3 and higher allows setting the encryption configurations at the server level. These settings will apply to live events recorded on the server. To enable or disable encryption, configure the following directives for the
f4fhttp_module
in the Apache httpd.conf file:
Common configuration:
PHDS configuration
Adobe Access configuration
Directive
Default Value
Description
HdsFmsDirPath
None
Relative path of the Adobe Media Server root directory. Use ‘..’ as Relative path.
HttpStreamingEncryptionScope
content
Possible values are off, content, and server. When the value is off, content remains in the unprotected format. When the value is content, configuration settings in the application.xml or event.xml files are used to protect the content. When the value is server, configuration settings in the httpd.conf are used to protect the content.
HttpStreamingProtectionScheme
PHDS
Encryption type for the content. It can be FlashAccessV3, FlashAccessV2 or PHDS. HttpStreamingProtectionScheme is applicable if encryption is enabled. Use HttpStreamingEncryptionScope to determine the scope of the encryption.
Directive
Default Value
Description
PHDSCommonKeyFile
<AMSInstallDir>
/creds/common-key.bin
A common key used to protect content at this location. PHDSCommonKeyFile path is relative to rootinstall/Apache2.2.
PHDSVideoEncryptionLevel
2
The level of encryption for the content (0-low,1-medium, 2-high). Lower settings provide partial encryption. A subset of the samples (like video keyframes) are encrypted. Partial encryption can improve playback performance on the client, because there are fewer frames to decrypt.
PHDSPlaybackExpiration
24Hours
The duration within which the content playback is available. Possible values are 24Hours and Unlimited.
PHDSOutputProtection
none
The required hardware Output Protection of media on the client. Possible values are None, BestEffort, and Required.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 98
Content protection
Last updated 7/19/2012
The following example enables and configures PHDS in the httpd.conf file. These settings apply to every live event configured for this server.
<Location /hds-live>
HttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications”
HttpStreamingContentPath “../applications”
HdsFmsDirPath “..”
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingDrmmetaMaxAge 3600
HttpStreamingFragMaxAge -1
Options -Indexes FollowSymLinks
HttpStreamingEncryptionScope server
HttpStreamingProtectionScheme PHDS
PHDSCommonKeyFile “../creds/common-key.bin”
PHDSPlaybackExpiration 24Hours
PHDSOutputProtection None
</Location>
The following example enables and configures Adobe Access (FlashAccessV2) in the httpd.conf file. These settings apply to every live event configured for this server.
Directive
Default Value
Description
FlashAccessCommonKeyFile
None
A common key used to protect content at this location. FlashAccessCommonKeyFile path is relative to rootinstall/Apache2.2.
FlashAccessLicenseServerURL
None
The URL of the license server used for protecting content.
FlashAccessTransportCertFile
None
The transport certificate used for protecting content.
FlashAccessLicenseServerCertFile
None
The License server certificate used for protecting content.
FlashAccessPackagerCredentialFile
None
The Packager credential used for protecting content.
FlashAccessPackagerCredentialPassword
None
The Packager credential password for the configured packager credential file.
FlashAccessPolicyFile
None
Policy for protecting content.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 99
Content protection
Last updated 7/19/2012
<Location /hds-live-faxs>
HttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications”
HttpStreamingContentPath “../applications”
HdsFmsDirPath “..”
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingDrmmetaMaxAge 3600
HttpStreamingFragMaxAge -1
HttpStreamingEncryptionScope server
HttpStreamingProtectionScheme FlashAccessV2
FlashAccessCommonKeyFile “../creds/common-key.bin”FlashAccessLicenseServerURL http://<aaxs-test-server>/FlashAccessTransportCertFile “aaxs-test-server-trnsCert.der”
FlashAccessLicenseServerCertFile “aaxs-test-server-licCert.der”
FlashAccessPackagerCredentialFile ” aaxs-test-server-pkgrCert.pfx”FlashAccessPackagerCredentialPassword pwd=FlashAccessPolicyFile “sample_policy.pol”
Options -Indexes FollowSymLinks
</Location>
The following example enables and configures Adobe Access (FlashAccessV3) in the httpd.conf file. These settings apply to every live event configured for this server.
<Location /hds-live-faxs>
HttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications”
HttpStreamingContentPath “../applications”
HdsFmsDirPath “..”
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingDrmmetaMaxAge 3600
HttpStreamingFragMaxAge -1
HttpStreamingEncryptionScope server
HttpStreamingProtectionScheme FlashAccessV3
FlashAccessCommonKeyFile “../creds/common-key.bin”FlashAccessLicenseServerURL http://<aaxs-test-server>/FlashAccessTransportCertFile “aaxs-test-server-trnsCert.der”
FlashAccessLicenseServerCertFile “aaxs-test-server-licCert.der”
FlashAccessPackagerCredentialFile ” aaxs-test-server-pkgrCert.pfx”FlashAccessPackagerCredentialPassword pwd=FlashAccessPolicyFile “sample_policy.pol”
Options -Indexes FollowSymLinks
</Location>
Application level
When Application level configuration is specified, the protection parameters specified are applied to the particular application (to all the events under the application). Encryption parameters specified in Event/Server level will be ignored.
Common configuration
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 100
Content protection
Last updated 7/19/2012
PHDS configuration
Adobe Access configuration
Element
Default
Description
HDS/
Recording/ContentProtection
“allow”
in Application.xml
“false”
in Event.xml
Container element for content protection configurations.
In Application.xml, set the
enabled
attribute to
“true”
to enable content protection,
“false”
to disable content protection, or
“allow”
to allow settings in the Event.xml file to override the ContentProtection section of the Application.xml file.
When
enabled=”allow”
, the server uses none of the settings in the
ContentProtection
section of the Application.xml file. If a
ContentProtection
section is not specified in Event.xml, content protection is disabled because the default value is
“false”
in Event.xml.
In Event.xml, set the
enabled
attribute to
“true”
or
“false”
.
HDS/Recording/ContentProtection/ProtectionScheme
None
Possible values are
phds
,
FlashAccessV2,and FlashAccessV3
. For PHDS, use
PHDS
.
Element
Default
Description
HDS/
Recording/ContentProtection/PHDS
None
Container for PHDS encryption settings.
HDS/Recording/ContentProtection/PHDS/CommonKeyFile
None
A relative path to the common-key.bin file containing a base key used (along with the content ID) to generate the final content encryption key.
This file is generated during installation to rootinstall/creds/common-key.bin.
If you define the
CommonKeyFile
in the Application.xml file, the server looks for the file relative to the application directory.
If you define the
CommonKeyFile
in the Event.xml file, the server looks for the file relative to the event folder.
HDS/
Recording/ContentProtection/PHDS/PlaybackExpiration
24Hours
The protection policy. The policy determines the duration within which content playback is available. Possible values are
24Hours
and
Unlimited
.
HDS/
Recording/ContentProtection/PHDS/VideoEncryptionLevel
2
The level of encryption for the content (0-low,1-medium,2-high). Lower settings mean “partial encryption”, where a subset of the samples (like video keyframes) are encrypted. This can improve playback performance on the client, since there will be fewer frame to decrypt.
HDS/
Recording/ContentProtection/PHDS/UpdateInterval
60
The frequency at which the server generates the drm metadata, in minutes.
HDS/Recording/ContentProtection/PHDS/OutputProtection
None
The required hardware Output Protection of media on the client. Possible values are None, BestEffort, and Required.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 101
Content protection
Last updated 7/19/2012
Configure the httpd.conf as given below to allow protection configurations at the application level.
<Location /hds-live>
HttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications”
HttpStreamingContentPath “../applications”
HdsFmsDirPath “..”
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingDrmmetaMaxAge 3600
HttpStreamingFragMaxAge -1
Options -Indexes FollowSymLinks
HttpStreamingEncryptionScope content
</Location>
The following example enables and configures PHDS in the Application.xml file. These settings apply to every live event configured for this application.
Element
Default
Description
HDS/Recording/ContentProtection/FlashAccessV2
None
Container for FlashAccessV2 encryption settings.
HDS/Recording/ContentProtection/FlashAccessV3
None
Container for FlashAccessV3 encryption settings.
HDS/Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/ContentID
None
The content ID used when protecting the streams in the live event
HDS/Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/CommonKeyFile
None
The file containing the common key
HDS/Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/LicenseServerURL
None
The URL of the license server that will provide licensing services for the protected content
HDS/Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/TransportCertFile
None
The file containing the transport certificate, in DER format
HDS/Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/LicenseServerCertFile
None
The file containing the license server certificate, in DER format
HDS/Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/PackagerCredentialFile
None
The file containing the packager credentials, in PFX format
HDS/Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/PackagerCredentialPassword
None
The password for the packager credentials
HDS/Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/ PolicyFile
None
The file containing the content protection policy
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 102
Content protection
Last updated 7/19/2012
<Application>
<StreamManager>
<Live>
<AssumeAbsoluteTime>true</AssumeAbsoluteTime>
<PublishTimeout>0</PublishTimeout>
<AdjustForZeroTimeStampMessages>2</AdjustForZeroTimeStampMessages>
<AdjustForRecordingRollover>false</AdjustForRecordingRollover>
</Live>
</StreamManager>
<HDS>
<Recording >
<ContentProtection enabled=”true” >
<ProtectionScheme>PHDS</ProtectionScheme>
<PHDS>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<VideoEncryptionLevel>2</VideoEncryptionLevel>
<PlaybackExpiration>24Hours</PlaybackExpiration>
<OutputProtection>None</OutputProtection>
</PHDS>
</ContentProtection>
</Recording>
</HDS>
</Application>
The following example enables and configures Adobe Access V2 in the Application.xml file. These settings apply to every live event configured for this application.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 103
Content protection
Last updated 7/19/2012
<Appl ication>
<S treamManager>
< Live>
<Assume Ab soluteTime> true</ AssumeAbsoluteTime>
<PublishTimeou t >0</Pu blishTimeout>
<AdjustForZeroTimeStampMessages>2< /AdjustF orZeroTimeStampMessages>
< AdjustForRe cordingRollover>false</AdjustForRecordingRollover>
</Live>
</Str eamManager>
<HDS>
<Re cording>
<ContentProtection enab led=”true”>
<ProtectionScheme>FlashAccessV2</ProtectionScheme>
<FlashAccessV2>
<ContentID>liveevent</ContentID>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<LicenseServerURL>http://<aaxs-test-server>/</LicenseServerURL>
<TransportCertFile>
aaxs-test-server-trnsCert.der
</TransportCertFile>
<LicenseServerCertFile>
aaxs-test-server-licCert.der
</LicenseServerCertFile>
<PackagerCredentialFile>
aaxs-test-server-pkgrCert.pfx</PackagerCredentialFile>
<PackagerCredentialPassword>pwd=</PackagerCredentialPassword>
<PolicyFile>sample_policy.pol</PolicyFile>
</FlashAccessV2>
</ContentProtection>
</Recording>
</HDS>
</Application>
The following example enables and configures Adobe Access V3 in the Application.xml file. These settings apply to every live event configured for this application.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 104
Content protection
Last updated 7/19/2012
<Application >
<StreamManager>
<Live>
<AssumeAbsoluteTime>true</AssumeAbsoluteTime>
<PublishTimeout>0</PublishTimeout>
<AdjustForZeroTimeStampMessages>2</AdjustForZeroTimeStampMessages>
<AdjustForRecordingRollover>false</AdjustForRecordingRollover>
</Live>
</StreamManager>
<HDS>
<Recording>
<ContentProtection enabled=”true”>
<ProtectionScheme>FlashAccessV3</ProtectionScheme>
<FlashAccessV3>
<ContentID>liveevent</ContentID>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<LicenseServerURL>http://<aaxs-test-server>/</LicenseServerURL>
<TransportCertFile>
aaxs-test-server-trnsCert.der
</TransportCertFile>
<LicenseServerCertFile>
aaxs-test-server-licCert.der</LicenseServerCertFile>
<PackagerCredentialFile>
aaxs-test-server-pkgrCert.pfx
</PackagerCredentialFile>
<PackagerCredentialPassword>pwd=</PackagerCredentialPassword>
<PolicyFile>sample_policy.pol</PolicyFile>
</FlashAccessV3>
</ContentProtection>
</Recording>
</HDS>
</Application>
Note: In this case, copy the common-key.bin file from the rootinstall/creds directory to the root-install/applications/livepkgr/ directory.
Event level
When Event level configuration is specified, the protection parameters specified are applied to the particular event. Encryption parameters specified in Application/Server level will be ignored.
Common configuration
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 105
Content protection
Last updated 7/19/2012
PHDS configuration
Adobe Access configuration
Element
Default
Description
Recording/ContentProtection
“allow”
in Application.xml
“false”
in Event.xml
Container element for content protection configurations.
In Application.xml, set the
enabled
attribute to
“true”
to enable content protection,
“false”
to disable content protection, or
“allow”
to allow settings in the Event.xml file to override the ContentProtection section of the Application.xml file.
When
enabled=”allow”
, the server uses none of the settings in the
ContentProtection
section of the Application.xml file. If a
ContentProtection
section is not specified in Event.xml, content protection is disabled because the default value is
“false”
in Event.xml.
In Event.xml, set the
enabled
attribute to
“true”
or
“false”
.
Recording/ContentProtection/ProtectionScheme
None
Possible values are
phds
,
FlashAccessV2,and FlashAccessV3
. For PHDS, use
PHDS
.
Element
Default
Description
Recording/ContentProtection/PHDS
None
Container for PHDS encryption settings.
Recording/ContentProtection/PHDS/CommonKeyFile
None
A relative path to the common-key.bin file containing a base key used (along with the content ID) to generate the final content encryption key.
This file is generated during installation to rootinstall/creds/common-key.bin.
If you define the
CommonKeyFile
in the Application.xml file, the server looks for the file relative to the application directory.
If you define the
CommonKeyFile
in the Event.xml file, the server looks for the file relative to the event folder.
Recording/ContentProtection/PHDS/PlaybackExpiration
24Hours
The protection policy. The policy determines the duration within which content playback is available. Possible values are
24Hours
and
Unlimited
.
Recording/ContentProtection/PHDS/VideoEncryptionLevel
2
The level of encryption for the content (0-low,1-medium,2-high). Lower settings mean “partial encryption”, where a subset of the samples (like video keyframes) are encrypted. This can improve playback performance on the client, since there will be fewer frame to decrypt.
Recording/ContentProtection/PHDS/UpdateInterval
60
The frequency at which the server generates the drm metadata, in minutes.
Recording/ContentProtection/PHDS/OutputProtection
None
The required hardware Output Protection of media on the client. Possible values are None, BestEffort, and Required.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 106
Content protection
Last updated 7/19/2012
Configure the httpd.conf as given below to allow protection configurations at the event level:
Element
Default
Description
Recording/ContentProtection/FlashAccessV2
None
Container for FlashAccessV2 encryption settings.
Recording/ContentProtection/FlashAccessV3
None
Container for FlashAccessV3 encryption settings.
Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/ContentID
None
The content ID used when protecting the streams in the live event
Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/CommonKeyFile
None
The file containing the common key
Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/LicenseServerURL
None
The URL of the license server that will provide licensing services for the protected content
Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/TransportCertFile
None
The file containing the transport certificate, in DER format
Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/LicenseServerCertFile
None
The file containing the license server certificate, in DER format
Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/PackagerCredentialFile
None
The file containing the packager credentials, in PFX format
Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/PackagerCredentialPassword
None
The password for the packager credentials
Recording/ContentProtection/FlashAccessV3(or FlashAccessV2)/ PolicyFile
None
The file containing the content protection policy
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 107
Content protection
Last updated 7/19/2012
<Location /hds-live>
HttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications”
HttpStreamingContentPath “../applications”HdsFmsDirPath “..”
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingDrmmetaMaxAge 3600
HttpStreamingFragMaxAge -1
Options -Indexes FollowSymLinks
HttpStreamingEncryptionScope content
</Location>
The following is an example of an Application.xml file that allows protection configurations at the event level and tells the server to look for configurations in the Event.xml file for each live event:
<Application>
<StreamManager>
<Live>
<AssumeAbsoluteTime>true</AssumeAbsoluteTime>
</Live>
</StreamManager>
<HDS>
<Recording>
<ContentProtection enabled=”allow”>
</ContentProtection>
</Recording>
</HDS>
</Application>
The following Event.xml file configures PHDS for a single live event:
<Event>
<EventID>liveevent</EventID>
<Recording>
<FragmentDuration>4000</FragmentDuration>
<SegmentDuration>400000</SegmentDuration>
<DiskManagementDuration>3</DiskManagementDuration>
<ContentProtection enabled=”true”>
<ProtectionScheme>PHDS</ProtectionScheme>
<PHDS>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<VideoEncryptionLevel>2</VideoEncryptionLevel>
<PlaybackExpiration>24Hours</PlaybackExpiration>
<OutputProtection>None</OutputProtection>
</PHDS>
</ContentProtection>
</Recording>
</Event>
In this case, copy the common-key.bin file from the rootinstall/creds directory to the rootinstall/applications/livepkgr/events/_definst_/liveevent directory.
The following Event.xml file configures Adobe Access V2 for a single live event:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 108
Content protection
Last updated 7/19/2012
<Event>
<EventID>liveevent</EventID>
<Recording>
<FragmentDuration>4000</FragmentDuration>
<SegmentDuration>400000</SegmentDuration>
<DiskManagementDuration>3</DiskManagementDuration>
<ContentProtection enabled=”true”>
<ProtectionScheme>FlashAccessV2</ProtectionScheme>
<FlashAccessV2>
<ContentID>liveevent</ContentID>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<LicenseServerURL>
http://<aaxs-test-server>/
</LicenseServerURL>
<TransportCertFile>
aaxs-test-server-trnsCert.der
</TransportCertFile>
<LicenseServerCertFile>
aaxs-test-server-licCert.der
</LicenseServerCertFile>
<PackagerCredentialFile>
aaxs-test-server-pkgrCert.pfx
</PackagerCredentialFile>
<PackagerCredentialPassword>pwd=</PackagerCredentialPassword>
<PolicyFile>sample_policy.pol</PolicyFile>
</FlashAccessV2>
</ContentProtection>
</Recording>
</Event>
The following Event.xml file configures Adobe Access V3 for a single live event:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 109
Content protection
Last updated 7/19/2012
<Event>
<EventID>liveevent</EventID>
<Recording>
<FragmentDuration>4000</FragmentDuration>
<SegmentDuration>400000</SegmentDuration>
<DiskManagementDuration>3</DiskManagementDuration>
<ContentProtection enabled=”true”>
<ProtectionScheme>FlashAccessV3</ProtectionScheme>
<FlashAccessV3>
<ContentID>liveevent</ContentID>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<LicenseServerURL>
http://<aaxs-test-server>/
</LicenseServerURL>
<TransportCertFile>
aaxs-test-server-trnsCert.der
</TransportCertFile>
<LicenseServerCertFile>
aaxs-test-server-licCert.der
</LicenseServerCertFile>
<PackagerCredentialFile>
aaxs-test-server-pkgrCert.pfx
</PackagerCredentialFile>
<PackagerCredentialPassword>pwd=</PackagerCredentialPassword>
<PolicyFile>sample_policy.pol</PolicyFile>
</FlashAccessV3>
</ContentProtection>
</Recording>
</Event>
Note: In this case, copy the common-key.bin file from the rootinstall/creds directory to the rootinstall/applications/livepkgr/events/_definst_/liveevent directory.
License chaining
Adobe Media Server will support embedding leaf licenses in the DRM metadata from the policy generated using a chained license. Adobe Media Server will need the license server credential and the credential password configured so that the root license from the policy can be used to encrypt the CEK contained in the embedded leaf license.
If the configuration for embedding the leaf license is turned off, Adobe Media Server will still support such a policy except that the leaf license will not be embedded in the DRM metadata.
Note: The support will be limited to a single license server credential and credential-password pair.
The following table provides the required configuration:
Parameter
Description
Default value
FlashAccessEmbedLeafLicense (Server level)
EmbedLeafLicense (Application and event level)
Enables embedding of leaf licenses in DRM metadata. Possible values are “true” or “false”.
Note: The policy file must be created using a chained license.
false
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 110
Content protection
Last updated 7/19/2012
The following example shows the license chaining configuration at the application level:
<Application>
<HDS>
<Recording>
<ContentProtection enabled=”true”>
<ProtectionScheme>FlashAccessV3</ProtectionScheme>
<FlashAccessV3>
<ContentID>liveevent</ContentID>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<LicenseServerURL>http://<aaxs-test-server>/</LicenseServerURL>
<TransportCertFile>
aaxs-test-server-trnsCert.der
</TransportCertFile>
<LicenseServerCertFile>
aaxs-test-server-licCert.der
</LicenseServerCertFile>
<PackagerCredentialFile>
aaxs-test-server-pkgrCert.pfx
</PackagerCredentialFile>
<PackagerCredentialPassword>pwd=</PackagerCredentialPassword>
<PolicyFile>sample_policy.pol</PolicyFile>
<EmbedLeafLicense>true</EmbedLeafLicense>
<LicenseServerCredentialFile>
aaxs-test-server-pkgrCertLic.pfx
</LicenseServerCredentialFile>
<LicenseServerCredentialPassword>
pwd_lic=
</LicenseServerCredentialPassword>
</FlashAccessV3>
</ContentProtection>
</Recording>
</HDS>
</Application>
The following example shows the license chaining configuration at the event level:
FlashAccessLicenseServerCredentialFile (Server level)
LicenseServerCredentialFile (Application and event level)
Required if FlashAccessEmbedLeafLicense is set to true. The license server credential used when protecting content at this location.
NA
FlashAccessLicenseServerCredentialPassword (Server level)
LicenseServerCredentialPassword (Application and event level)
Required if FlashAccessEmbedLeafLicense is set to true. The license server credential password for the configured license server credential file.
NA
Parameter Description Default value
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 111
Content protection
Last updated 7/19/2012
<Event>
<Recording>
<ContentProtection enabled=”true”>
<ProtectionScheme>FlashAccessV3</ProtectionScheme>
<FlashAccessV3>
<ContentID>liveevent</ContentID>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<LicenseServerURL>
http://<aaxs-test-server>/
</LicenseServerURL>
<TransportCertFile>
aaxs-test-server-trnsCert.der
</TransportCertFile>
<LicenseServerCertFile>
aaxs-test-server-licCert.der
</LicenseServerCertFile>
<PackagerCredentialFile>
aaxs-test-server-pkgrCert.pfx
</PackagerCredentialFile>
<PackagerCredentialPassword>
pwd=
</PackagerCredentialPassword>
<PolicyFile>sample_policy.pol</PolicyFile>
<EmbedLeafLicense>true</EmbedLeafLicense>
<LicenseServerCredentialFile>
aaxs-test-server-pkgrCertLic.pfx
</LicenseServerCredentialFile>
<LicenseServerCredentialPassword>
pwd_lic=
</LicenseServerCredentialPassword>
</FlashAccessV3>
</ContentProtection>
</Recording>
</Event>
Note: License chaining is not supported for the
“VOD use case” on page
119
.
Key rotation
Adobe Media Server 5 supports Key Rotation for protected HTTP Dynamic Streaming when used with Flash Access 3.0. You can encrypt content packaged with AMS 5 using a set of keys. You can periodically change the encryption key and specify how often the content encryption key is to be changed. You can also specify the list of keys for encryption.
Server level
Parameter
Description
Default value
FlashAccessEnableKeyRotation
Whether to use Key Rotation with AAXS protection scheme
false
FlashAccessKeyRotationInterval
Key rotation interval to be used (in seconds), when enabling key rotation.
900 seconds
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 112
Content protection
Last updated 7/19/2012
The following httpd.conf will enable key rotation at server level :
<Location /hds-live>
HttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications”
HttpStreamingContentPath “../applications” HdsFmsDirPath “..”
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingDrmmetaMaxAge 3600
HttpStreamingFragMaxAge -1
Options -Indexes FollowSymLinks
HttpStreamingEncryptionScope server
HttpStreamingProtectionScheme FlashAccessV3
FlashAccessCommonKeyFile “../creds/common-key.bin”
FlashAccessLicenseServerURL http://<aaxs-test-server>/
FlashAccessTransportCertFile aaxs-test-server-trnsCert.der
FlashAccessLicenseServerCertFile aaxs-test-server-licCert.der
FlashAccessPackagerCredentialFile aaxs-test-server-pkgrCert.pfx
FlashAccessPackagerCredentialPassword pwd=
FlashAccessPolicyFile sample_policy.pol
FlashAccessEnableKeyRotation true
FlashAccessKeyRotationInterval 500
FlashAccessKeyRotationFilePath sample_keys.txt
</Location>
Application level
FlashAccessKeyRotationFilePath
The file containing the rotation keys to be used. This file will contain a sequence of rotated keys used to encrypt content. If no file is specified, randomly generated keys will be used. The keys must be 16 bytes in length and specified as hex values.
Randomly generated keys will be used (as described below)
Parameter
Description
Default value
HDS/Recording/ContentProtection/FlashAccessV3/EnableKeyRotation
Whether to use Key Rotation with AAXS protection scheme
false
HDS/Recording/ContentProtection/FlashAccessV3/KeyRotationInterval
Key rotation interval to be used (in seconds), when enabling key rotation.
900 seconds
HDS/Recording/ContentProtection/FlashAccessV3/KeyRotationFilePath
The file containing the rotation keys to be used. This file will contain a sequence of rotated keys used to encrypt content. If no file is specified, randomly generated keys will be used. The keys must be 16 bytes in length and specified as hex values.
Randomly generated keys will be used (as described below)
Parameter Description Default value
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 113
Content protection
Last updated 7/19/2012
The following Application.xml will enable key rotation at Application level :
<Application>
<StreamMana ger>
<Live>
<AssumeAbsoluteTime>true</AssumeAbsoluteTime>
<PublishTimeout>0</PublishTim eout>
<Adj ustForZeroTimeStampMessages>2</AdjustForZeroTimeStampMessages>
<AdjustForRecordingRollover>false</AdjustForRecordingRollover>
</Live>
</StreamManager >
<HDS>
<Recording>
<ContentProtection enabled=”true”>
<ProtectionScheme>FlashAccessV3</ProtectionScheme>
<FlashAccessV3>
<ContentID >liveevent</ContentID>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<LicenseServerURL>http://<aaxs-test-server>/</LicenseServerURL>
<TransportCertFile>
aaxs-test-server-trnsCert.der
</TransportCertFile>
<Licens eServerCertFile>
aaxs-test-server-licCert.der
</LicenseServerCertFile>
< PackagerCredentialFile>
aaxs-test-server-pkgrCert.pfx
</PackagerCredentialFile>
<PackagerCredentialPassword>pwd=</PackagerCredentialPassword>
<PolicyFil e>sample _policy.pol</PolicyFile>
<EnableKeyRotation>true</EnableKeyRotation>
<KeyRotationInterval>500</KeyRotationInterval>
<KeyRotationFilePath>sample_keys.txt</KeyRotationFilePath>
</FlashAccessV3>
</ContentProtection>
</Recording>
</HDS>
</Application>
Event level
Parameter
Description
Default value
Recording/ContentProtection/FlashAccessV3/EnableKeyRotation
Whether to use Key Rotation with AAXS protection scheme
false
Recording/ContentProtection/FlashAccessV3/KeyRotationInterval
Key rotation interval to be used (in seconds), when enabling key rotation.
900 seconds
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 114
Content protection
Last updated 7/19/2012
The following Event.xml will enable key rotation at Application level :
<Event>
<EventID>liveevent</EventID>
<Recording>
<FragmentDuration>4000</FragmentDuration>
<SegmentDuration>400000</SegmentDuration>
<DiskManagementDuration>3</DiskManagementDuration>
<ContentProtection enabled=”true”>
<ProtectionScheme>FlashAccessV3</ProtectionScheme>
<FlashAccessV3>
<ContentID>liveevent</ContentID>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<LicenseServerURL>http://<aaxs-test-server>/</LicenseServerURL>
<TransportCertFile>aaxs-test-server-trnsCert.der</TransportCertFile>
<LicenseServerCertFile>
aaxs-test-server-licCert.der
</LicenseServerCertFile>
<PackagerCredentialFile>
aaxs-test-server-pkgrCert.pfx
</PackagerCredentialFile>
<PackagerCredentialPassword>pwd=</PackagerCredentialPassword>
<PolicyFile>sample_policy.pol</PolicyFile>
<EnableKeyRotation>true</EnableKeyRotation>
<KeyRotationInterval>500</KeyRotationInterval>
<KeyRotationFilePath>sample_keys.txt</KeyRotationFilePath>
</FlashAccessV3>
</ContentProtection>
</Recording>
</Event>
Note:
FlashAccessKeyRotationFilePath
takes path relative to <AMS-Install>/applications/<application-name>/.
Disable JIT encryption for F4F content
When PHDS/Adobe Access protection is enabled, the server ingests a stream and packages it into F4F stream data. The unencrypted F4F data is taken as source and encrypted using the PHDS/Adobe Access configurations.In order to force the server to store the ingested stream as encrypted F4F data, and disable the just-in-time encryption of the F4F data, a special configuration is required.
The following table contains the configuration directive for enabling and disabling JIT encryption at server level:
httpd.conf tags:
Recording/ContentProtection/FlashAccessV3/KeyRotationFilePath
The file containing the rotation keys to be used. This file will contain a sequence of rotated keys used to encrypt content. If no file is specified, randomly generated keys will be used. The keys must be 16 bytes in length and specified as hex values.
Randomly generated keys will be used (as described below)
Parameter Description Default value
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 115
Content protection
Last updated 7/19/2012
<AMS-Install>conf/_defaultRoot_/_defaultVHost_/Application.xml tags:
Note: The tags
HttpStreamingJITEncryption
and
JITEncryption
both must be set to false to disable JIT encryption.
When JITEncryption is set to false:
•
Specify server level encryption settings (PHDS/Adobe Access) at <AMS-Install>conf/_defaultRoot_/_defaultVHost_/Application.xml.
•
The ingested stream is stored as encrypted F4F content. So, DRMmeta file is stored on the server inside the F4F content.
The following configurations in httpd.conf will disable JIT encryption server wide:
<Location /hds-live>
HttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications”
HttpStreamingContentPath “../applications” HdsFmsDirPath “..”
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingDrmmetaMaxAge 3600
HttpStreamingFragMaxAge -1
HttpStreamingJITEncryption false
Options -Indexes FollowSymLinks
</Location>
The following configurations for <AMSInstall>conf/_defaultRoot_/_defaultVHost_/Application.xml enables PHDS protection:
Directive
Description
Default value
HttpStreamingJITEncryption
To disable just in time encryption, set the value to “false”
true
Directive
Description
Default value
HDS/Recording/JITEncryption
To disable just in time encryption, set the value to “false”
false
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 116
Content protection
Last updated 7/19/2012
<Application>
<!– This section provides th e means to control the behavior of –>
<!– application-specific HTTP dynamic s treaming f unctionality. –>
<HDS>
<!– This section cont rols the behavior of HTTP live recording –>
<Recording>
<!– The enabled attribute can be set to “true”, “false” or “allow”. –>
<!– Content prote cted is enabled when the attribute is set to “true”, –>
<!– and disabled when set to “false”. –>
<!– If enabled is set to “allow”, only then Event.xml have right to –>
<!– override the ContentProtection tag completely. And none of the –>
<!– settings inside the ContentProtection here will be used. And if –>
<!– ContentProtection is also not specified in Event.xml, content –>
<!– protection will be disabled by default. –>
<JITEncryption>false</JITEncryption>
<ContentProtection enabled=”true”>
<ProtectionScheme>PHDS</ProtectionScheme>
<PHDS>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<VideoEncryptionLevel>2</VideoEncryptionLevel>
<PlaybackExpiration>24Hours</PlaybackExpiration>
<OutputProtection>None</OutputProtection>
</PHDS>
</ContentProtection>
</Recording>
</HDS>
</Application>
The following configurations at
<AMS-Install>
conf/_defaultRoot_/_defaultVHost_/Application.xml enables Adobe Access protection:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 117
Content protection
Last updated 7/19/2012
<Application>
<!– This section provides t he means to control the behavior of – ->
<!– application-specific HTTP dynamic streaming fu nctionality. –>
<HDS>
<!– This section controls the behavior of HTTP live recording –>
<Recording>
<!– The enabled attribute can be set to “true”, “false” or “allow”. –>
<!– Content protection is enabled when the attribute is set to “true “, –>
<!– and disabled when set to “false”. –>
<!– If enabled is set to “allow”, then Event.xml will –>
<!– override the ContentProtection tag completely. And none of the –>
<!– settings inside the ContentProtection will be used. And if –>
<!– ContentProtection is not specified in Event.xml, then content –>
<!– protection will be disabled by default. –>
<JITEncryption>false</JITEncryption>
<ContentProtection enabled=”true”>
<ProtectionScheme>FlashAccessV2</ProtectionScheme>
< FlashAccessV2>
<ContentID>liveevent</ContentID>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<LicenseServerURL>
http://<aaxs-test-server>/
</LicenseServerURL>
<TransportCertFile>
aaxs-test-server-trnsCert.der
</TransportCertFile>
<LicenseServerCertFile>
aaxs-test-server-licCert.der</LicenseServerCertFile>
<PackagerCredentialFile>
aaxs-test-server-pkgrCert.pfx
</PackagerCredentialFile>
<PackagerCredentialPassword>pwd=</PackagerCredentialPassword>
<PolicyFile>sample_policy.pol</PolicyFile>
</ FlashAccessV2>
</ContentProtection>
</Recording>
</HDS>
</Application>
Configure system for encrypted live stream in HLS and HDS
You do not need two different recording applications for HDS and HLS if JIT encryption is ON. The live content is stored unencrypted on the disk, and later encrypted dynamically using the HDS or HLS modules of Apache.By default JIT encryption is on unless the
HttpStreamingJITEncryption
and J
ITEncryption
tags are set to false.Publishing one set of streams to Adobe Media Server for delivery with live PHLS and PHDS requires special configuration when JIT Encryption is off.When PHDS is enabled when JIT encryption is off , the server ingests a stream and packages it into encrpypted F4F data. However, PHLS requires unencrypted data as its source. It’s not possible to take the encrypted F4F data and encrypt it again for PHLS.To deliver protected content to Flash Player/AIR and iOS devices, configure your encoder to publish to two different applications, one for HDS and one for HLS.
1
Create two copies of the livepkgr application. Name them “livepkgr_hds” and “livepkgr_hls”.
2
Configure the <AMS-Install>/conf/_defaultRoot_/_defaultVHost_/Application.xml as following:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 118
Content protection
Last updated 7/19/2012
<Application>
<!– This section provides the ways to control the behavi or of –>
<!– application-specific HTTP dynamic streaming functionality. –>
< HDS>
<!– This section controls the behavior of HTTP live recording –>
<Recording>
<!– The enabled attribute can be set to “true”, “false” or “allow” . –>
<!– Content protected is enabled when the attribute is set to “true”, –>
<!– and disabled when set to “false”. –>
<!– If enabled is set to “allow”, only then Event.xml have right to –>
<!– override the ContentProtection tag completely. And none of the –>
<!– settings inside the ContentProtection here will be used. And if –>
<!– ContentProtection is also not specified in Event.xml, content –>
<!– protection will be disabled by default. –>
< JITEncryption>false</JITEncryption>
<ContentProtection enabled=”allow”>
</ContentProtection>
</Recording>
</HDS>
</Application>
3
Configure the <AMS-Install>/applications/livepkgr_hds/Application.xml as following:
<Application>
<StreamManager>
<Live>
<AssumeAbsoluteTime>true</AssumeAbsoluteTime>
<PublishTimeout>0</PublishTimeout>
<AdjustForZeroTimeStampMessages>2</AdjustForZeroTimeStampMessages>
<AdjustForRecordingRollover>false</AdjustForRecordingRollover>
</Live>
</StreamManager>
<HDS>
<Recording >
<ContentProtection enabled=”true” >
<ProtectionScheme>PHDS</ProtectionScheme>
<PHDS>
<CommonKeyFile>common-key.bin</CommonKeyFile>
<VideoEncryptionLevel>2</VideoEncryptionLevel>
<PlaybackExpiration>24Hours</PlaybackExpiration>
<OutputProtection>None</OutputProtection>
</PHDS>
</ContentProtection>
</Recording>
</HDS>
</Application>
4
Configure the httpd.conf files as follows:
For PHDS, use the following
Location
directive:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 119
Content protection
Last updated 7/19/2012
<Location /hds-live>
HttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications/livepkgr_hds”
HttpStreamingContentPath “../applications/livepkgr_hds”
HttpStreamingURLSandboxLevel “App”
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingDrmmetaMaxAge 3600
HttpStreamingFragMaxAge -1
HttpStreamingJITEncryption false
Options -Indexes FollowSymLinks
</Location>
For PHLS, use the following Location directive:
<Location /hls-live>
HLSHttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications/livepkgr_hls”
HttpStreamingContentPath “../applications/livepkgr_hls”
HttpStreamingURLSandboxLevel “App”
HLSMediaFileDuration 8000
HLSSlidingWindowLength 6
HLSFmsDirPath “..”
HttpStreamingUnavailableResponseCode 503
HLSM3U8MaxAge 2
HLSTSSegmentMaxAge -1
HLSMetaMaxAge 3600
HLSMaxEventAge 300HLSEncryptionScope server
HLSProtectionScheme PHLS
</Location>
5
Restart Apache.
6
Publish streams from Flash Media Live Encoder to the livepkgr_hds and livepkgr_hls applications. Use the stream name livestream%i?adbe-live-event=liveevent.
7
The request URL for PHDS is http://<serveruri>/hds-live/_definst_/<liveevent>.f4m and the request URL for PHLS is http://<serveruri>/hls-live/_definst_/<liveevent>.m3u8. Because the directive
HttpStreamingURLSandboxLevel
is set to “App”, the request URL doesn’t use the application name.
Note: In this case, copy the common-key.bin from <AMS Install>/creds directory to <AMS Install>/applications/livepkgr_hds/.
Similarly, by following the above mentioned steps, Adobe Access configurations can also be used with HDS and HLS.
VOD use case
Configure PHDS for on-demand streaming at the following levels:
Server—rootinstall/Apache2.2/conf/httpd.conf
Stream—create a jit.conf file and copy it to the same directory as the content.
Getting started
To quickly get started with PHDS, you need to understand the following directives:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 120
Content protection
Last updated 7/19/2012
The simplest way to configure on-demand PHDS is to uncomment two lines in the Apache httpd.conf file:
<IfModule jithttp_module>
<Location /hds-vod>
HttpStreamingJITPEnabled true
HttpStreamingContentPath “../webroot/vod”
JitFmsDirPath “..”
Options -Indexes FollowSymLinks
# Uncomment the following directives to enable encryption
# for this location.
EncryptionScope server
ProtectionScheme phds
</Location>
</IfModule>
Note: This configuration will enable PHDS at the server level.
The sample1_1500kbps.f4v media file comes with the default installation of AMS under <root-install>/webroot. Play back the media file sample1_1500kbps.f4v using the following URI:http://<server-ip>/hds-vod/ sample1_1500kbps.f4v.f4m
Detailed configuration
The following sections provides details configurations for both PHDS and Adobe Access.
Server level
The following sections explain how content protection can be applied across the server:
Common configurations
Directive
Default value
Description
EncryptionScope
None
Possible values are
content
and
server
.
When the value is
content
, PHDS configuration settings in the jit.conf file override settings in the httpd.conf. file.
When the value is
server
, the server uses configuration settings in the httpd.conf file.
ProtectionScheme
None
A string determining the type of protection. For PHDS, use
PHDS
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 121
Content protection
Last updated 7/19/2012
PHDS configurations
Configure the following directives for the jithttp_module in the Apache httpd.conf file:
Adobe Access configurations
Directive
Default value
Description
EncryptionScope
content
Possible values are
content
and
server
.
When the value is
content
, PHDS configuration settings in the jit.conf file override settings in the httpd.conf. file.
When the value is
server
, the server uses configuration settings in the httpd.conf file.
Serverwide configuration that sets encryption policy.server – ALL content is protected according to the apache configuration (jit.conf is ignored).content – Content is protected/unprotected according the to jit.conf file.off – ALL content are unprotected (jit.conf is ignored) .
ProtectionScheme
PHDS
A string determining the type of protection. Possible values are PHDS and FlashAccessV2.
Directive
Default value
Description
PHDSCommonKeyFile
creds/common-key.bin
This file is generated during installation.
A common key used to protect content at this location.
PHDSPlaybackExpiration
24Hours
The duration within which content playback is available. Possible values are
24Hours
and
Unlimited
PHDSOutputProtection
None
The required hardware Output Protection of media on the client. Possible values are None, BestEffort, and Required.
PHDSVideoEncryptionLevel
2
The level of encryption for the content (0-low,1-medium, 2-high). Lower settings provide partial encryption. A subset of the samples (like video keyframes) are encrypted. Partial encryption can improve playback performance on the client, because there are fewer frames to decrypt.
Directive
Default Value
Description
FlashAccessCommonKeyFile
None
A common key used to protect content at this location. FlashAccessCommonKeyFile path is relative to rootinstall/Apache2.2.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 122
Content protection
Last updated 7/19/2012
The following example adds a new
Location
directive. Request that include
/phds
serve protected content. This configuration doesn’t define
PHDSPlaybackExpiration
,
PHDSVideoEncryptionLevel
, or
PHDSCommonKeyFile
, but relies on their default values:
LoadModule jithttp_module modules/mod_jithttp.so
<IfModule jithttp_module>
<Location /phds>
HttpStreamingJITPEnabled true
HttpStreamingContentPath “../webroot/vod”
JitFmsDirPath “..”
Options -Indexes FollowSymLinks
EncryptionScope server
ProtectionScheme phds
</Location>
When a media player request content from the /webroot/vod folder, it is protected. For example, request the following URL from the sample video player:
http://localhost:8134/hds-vod/sample1_1500kbps.f4v.f4m
To verify that the content is protected, enter the same URL into the address bar of a web browser. The XML response contains a
<drmAdditionalHeader>
element like the following:
<?xml version=”1.0″ encoding=”UTF-8″ ?>
– <manifest xmlns=”http://ns.adobe.com/f4m/1.0″>
<id>sample1_1500kbps.f4v</id>
<streamType>recorded</streamType>
<duration>114.61450000000001</duration>
<bootstrapInfo profile=”named” id=”bootstrap3628″>AAABq2Fic3QAAAAAAAA</bootstrapInfo>
<drmAdditionalHeader drmContentId=”sample1_1500kbps.f4v” id=”drmMetadata9839″>AgARfEFkZGl0aW9uYWxIZWFkZXIDAAp</drmAdditionalHeader>
– <media streamId=”sample1_1500kbps.f4v” url=”sample1_1500kbps.f4v” bootstrapInfoId=”bootstrap3628″ drmAdditionalHeaderId=”drmMetadata9839″>
<metadata>AgAKb25NZXRhRGF0</metadata>
</media>
</manifest>
Note: The
<bootstrapInfo>
,
<drmAdditionalHeader>
, and
<metadata>
information has been abridged for readability.
The following example adds a new
Location
directive. Request that include
/hds-vod-fax
serve protected content through Adobe Access:
FlashAccessLicenseServerURL
None
The URL of the license server used for protecting content.
FlashAccessTransportCertFile
None
The transport certificate used for protecting content.
FlashAccessPackagerCredentialFile
None
The Packager credential used for protecting content.
FlashAccessPackagerCredentialPassword
None
The Packager credential password for the configured packager credential file.
FlashAccessPolicyFile
None
Policy for protecting content.
Directive Default Value Description
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 123
Content protection
Last updated 7/19/2012
<Location /hds-vod-fax>
HttpStreamingJITPEnabled true
HttpStreamingContentPath “../webroot/vod”
HttpStreamingJITConfAllowed true
JitFmsDirPath “..”
Options -Indexes FollowSymLinks
EncryptionScope server
ProtectionScheme FlashAccessV2
FlashAccessCommonKeyFile common-key.bin //Common key to be used to protect content at this location. No default
FlashAccessLicenseServerURL http://<aaxs-test-server> //License server URL used when protecting content at this location. No default
FlashAccessTransportCertFile aaxs-test-server-trnsCert.der //Transport certification used when protecting content at this location. No default
FlashAccessLicenseServerCertFile aaxs-test-server-licCert.der //License server certificate used when protecting content at this location. No default.
FlashAccessPackagerCredentialFile aaxs-test-server-pkgrCert.pfx //Packager credential used when protecting content at this location. No default
FlashAccessPackagerCredentialPassword pwd= //Packager credential password for the configured packager credential file. No default
FlashAccessPolicyFile sample_policy.pol //Policy to be used when protecting content at this location . No default
</Location>
Note: FlashAccessCommonKeyFile takes path relative to <AMS-Install>/Apache2.2.
Stream level
To configure encryption parameters for individual sets of media, follow the configurations mentioned below.
Common configurations
PHDS configurations
Element
Default value
Description
//manifest/hds:content-protection enabled
false
To enable content protection with Adobe Access or PHDS, set the enabled attribute to
“true”
.
//manifest/hds:content-protection/hds:protection-scheme
PHDS
The type of protection. The possible values are
PHDS
and
FlashAccessV2
only. For PHDS, use
PHDS
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 124
Content protection
Last updated 7/19/2012
Adobe Access configurations
Element
Default value
Description
//manifest/hds:content-protection/hds:phds/hds:common-key-file
creds/common-key.bin
Path to a common key file generated when the server installs. The file contains a16-byte/128-bit random key. This path can be absolute or relative to the jit.conf file.
//manifest/hds:content-protection/hds:phds/hds:video-encryption-level
2
The level of encryption for the content (0-low,1-medium,2-high).
Lower settings provide partial encryption. A subset of the samples (like video keyframes) are encrypted.
Partial encryption can improve playback performance on the client because there are fewer frames to decrypt.
//manifest/hds:content-protection/hds:phds/hds:playback-expiration
24Hours
The protection policy. The policy determines the duration within which content playback is available. Possible values are
24Hours
and
Unlimited
.
//manifest/hds:content-protection/hds:phds/hds:output-protection
None
The required hardware Output Protection of media on the client. Possible values are None, BestEffort, and Required.
Element
Default value
Description
//manifest/hds:content-protection/hds:flash-access/hds:common-key-file
None
The path to common key file. File contains 16-byte/128-bit random key.The path must be absolute or relative to the jit.conf file.
//manifest/hds:content-protection/hds:flash-access/hds:content-id
None
The Content ID to be used for content protection. If not specified, the salt is the filename. If specified, the salt is shared with all content in the directory.
//manifest/hds:content-protection/hds:flash-access/hds:license-server-url
None
The License Server URL.
//manifest/hds:content-protection/hds:flash-access/hds:transport-cert-file
None
The path to transport cert file. The file is in DER format.The path should be absolute or relative to the jit.conf file.
//manifest/hds:content-protection/hds:flash-access/hds:license-server-cert-file
None
The path to license cert file. File is in DER format.The path should be absolute or relative to the jit.conf file.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 125
Content protection
Last updated 7/19/2012
The following httpd.conf file sets
EncryptionScope
to
content
. This setting tells the server that configuration settings in the jit.conf file override settings in the httpd.conf file. Use this setting to configure PHDS/AdobeAccess for individual sets of media.
LoadModule jithttp_module modules/mod_jithttp.so
<IfModule jithttp_module>
<Location /hds-vod>
HttpStreamingJITPEnabled true
HttpStreamingContentPath “../webroot/vod”
JitFmsDirPath “..”
Options -Indexes FollowSymLinks
EncryptionScope content
</Location>
The following is the accompanying jit.conf file, which is in the same directory as the on-demand media files (/webroot/vod), which will enable PHDS:
<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns=”http://ns.adobe.com/f4m/1.0″ xmlns:hds=”http://ns.adobe.com/hds-package/1.0>
<frame-rate>29.97</frame-rate>
<frames-per-keyframe-interval>60</frames-per-keyframe-interval>
<hds:content-protection enabled=”true”>
<hds:protection-scheme>phds</hds:protection-scheme>
<hds:phds>
<hds:common-key-file>
C:\Program Files\Adobe\Adobe Media Server 5\creds\common-key.bin
</hds:common-key-file>
<hds:video-encryption-level>0</hds:video-encryption-level>
<hds:playback-expiration>unlimited</hds:playback-expiration>
</hds:phds>
</hds:content-protection>
</manifest>
The following is the accompanying jit.conf file, which is in the same directory as the on-demand media files (/webroot/vod), which will enable Adobe Access:
//manifest/hds:content-protection/hds:flash-access/hds:packager-credential-file
None
The path to packager credential cert file. File is in PFX format.The path should be absolute or relative to the jit.conf file.
//manifest/hds:content-protection/hds:flash-access/hds:packager-credential-password
None
The packager credential password.
//manifest/hds:content-protection/hds:flash-access/hds:policy-file
None
The path to a policy file. File is in FAXS policy format.The path should be absolute or relative to the jit.conf file.
Element Default value Description
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 126
Content protection
Last updated 7/19/2012
<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns=”http://ns.adobe.com/f4m/1.0″ xmlns:hds=”http://ns.adobe.com/hds-package/1.0″>
<hds:FlashAccessV2>
<hds:content-id>jit_fax2</hds:content-id>
<hds:common-key-file>common-key.bin</hds:common-key-file>
<hds:license-server-url>http://<aaxs-test-server></hds:license-server-url>
<hds:transport-cert-file>aaxs-test-server-trnsCert.der</hds:transport-cert-file>
<hds:license-server-cert-file>aaxs-test-server-licCert.der</hds:license-server-cert-file>
<hds:packager-credential-file>aaxs-test-server-pkgrCert.pfx</hds:packager-credential-file>
<hds:packager-credential-password>pwd=</hds:packager-credential-password>
<hds:policy-file>sample_policy.pol</hds:policy-file>
</hds:FlashAccessV2>
</hds:content-protection>
</manifest>
Note: In this case, hds:common-key-file takes path relative to <AMS-Install>/webroot/vod.
SWF verification for Protected HTTP Dynamic Streaming
SWF verification prevents unauthorized SWF files from accessing content. To use SWF verification, you must enable Protected HTTP Dynamic Streaming (PHDS).
Create a list of authorized SWF files, called a whitelist. These files are specified in the embedded license and sent to the client inside the DRM metadata. On the client, SWF verification is enforced by Adobe Access inside of Flash Player and AIR.
To create the whitelist, use Whitelist tool (rootinstall/tools/Whitelist).
Workflow
1
Enable PHDS.
2
Use the whitelist tool to generate a whitelist of authorized SWF files. The whitelist file can have any name. It must have the .whitelist or .airwhitelist extension.
3
Copy the whitelist to the server.
4
Enable SWF verification and indicate the location of the whitelist in the following locations:
•
(Live)—Application.xml or Event.xml
•
(On-demand)—httpd.conf or jit.conf
5
Publish a stream to the livepkgr application on Adobe Media Server.
6
Request a stream from an OSMF media player. The syntax of the request URL does not change for SWF verification.
The server embeds the SWF hashes from the whitelist into the .drmmeta file. Flash Player attempts to verify the SWF hash during DRM authentication.
7
(Live) The server looks for the whitelist in the following order:
a
The application folder. (The default application for live HTTP streaming is rootinstall/applications/livepkgr).
b
A path in the
/SWFVerification/WhitelistFolder
element of Application.xml
c
A path in the
/SWFVerification/WhitelistFolder
element of Event.xml
8
(On-demand) The server looks for the whitelist in the httpd.conf/jit.conf file in the same folder as the on-demand content.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 127
Content protection
Last updated 7/19/2012
If the hashes don’t match, Flash Player throws an runtime error (3310) and the OSMF media player stops requesting fragments.
SWF verification configurations for live PHDS
To enable SWF verification for live PHDS, enable PHDS at the server level (httpd.conf), the application level (Application.xml) or the event level (Event.xml).
Configure SWF verification for live HDS at the server level (httpd.conf)
Add the following elements to the
hds-live
directive to enable SWF verification:
Configure SWF verification for live HDS at the application level (Application.xml) or at the event level (Event.xml).
In Application.xml,
SWFVerification
is located at
//Application/HDS/Recording/ContentProtection/PHDS/SWFVerification
.In Event.xml,
SWFVerification
is located at
//Event/Recording/ContentProtection/PHDS/SWFVerification
.
Configure the following settings in the Apache httpd.conf file to configure cache control for the bootstrap, fragment, manifest and drmmeta responses:
•
HttpStreamingBootstrapMaxAge
•
HttpStreamingFragMaxAge
•
HttpStreamingF4MMaxAge
•
HttpStreamingDrmmetaMaxAge
For detailed information about each configuration, see
“Configure live and on-demand HTTP Streaming at the server
level (httpd.conf)” on page
66
.
Element
Description
Default
PHDSSWFVerification
The container for SWF verification configuration. To enable SWF verification, set the enabled attribute to “true”.
“false”
PHDSSWFWhiteListFolder
Specify the location of SWF whitelist
The application folder of the live event.
Element
Description
Default
/SWFVerification
The container for SWF verification configuration. To enable SWF verification, set the
enabled
attribute to
“true”
.
“false”
/SWFVerification/WhiteListFolder
A path to the folder containing the whitelist. The folder can contain more than one whitelist file.
The path can be absolute or relative. A relative path in the Application.xml file is relative to the application folder. A relative path in the Event.xml file is relative to the event folder. Backwards relative paths are not supported for security reasons.
This configuration is optional. If no value is given, the server looks in the application folder of the live event.
The application folder of the live event.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 128
Content protection
Last updated 7/19/2012
SWF verification configurations for on-demand PHDS
SWF verification is configured under PHDS. To enable SWF verification, enable PHDS. You can enable on-demand PHDS at the server level (httpd.conf) or at the stream level (jit.conf).
Configure SWF verification for on-demand PHDS at the server level (httpd.conf) or at the stream level (jit.conf).
Use the following elements to enable and configure SWF verification in the httpd.conf file:
Use the following elements to enable and configure SWF verification in the jit.conf file. Copy the jit.conf file to the same directory as the on-demand media.
Whitelist tool
Use the whitelist tool to generate a list of verified SWF and AIR files. The server uses the whitelist to perform SWF verification for Flash Player and AIR applications.
The whitelist tool takes SWF files, AIR certificate files, and AIR signature files and creates a SHA256 hash for each file. The tool writes the hashes as Base64 encoded text to one or more text files and outputs the text files. The text files use the filename extensions .whitelist and .airwhitelist.
The whitelist tool is located in the following directory:
rootinstall/tools/Whitelist
Use the following command line syntax to run the whitelist tool:
whitelist –in <file|dir> [–outDir <output dir>] [–out <output file>] [–version]
Element
Description
Default
PHDSSWFVerification
The container for SWF verification configuration. To enable SWF verification, set the enabled attribute to
“true”
.
“false”
PHDSSWFWhiteListFolder
Optional setting to specify where the SWF whitelist can be found. The folder can contain more than one whitelist files.
This can be overridden by jit.conf if the Apache configuration is overridable.
This configuration is optional. If no value is given, the server looks in the folder containing the jit.conf file.
The folder containing the media.
Element
Description
Default
//manifest/hds:content-protection/hds:phds/hds:swf-verification
The container for SWF verification configuration. To enable SWF verification, set the
enabled
attribute to
“true”
.
“false”
//manifest/hds:content-protection/hds:phds/hds:swf-verification/hds:white-list-folder
A path to the folder containing the whitelist. The folder can contain more than one whitelist file.
The path can be absolute or relative. A relative path is relative to the folder containing the jit.conf file. Backwards relative paths are not supported for security reasons.
This configuration is optional. If no value is given, the server looks in the folder containing the jit.conf file.
The folder containing the media.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 129
Content protection
Last updated 7/19/2012
The following table lists the command line options and arguments for the whitelist tool:
The following table lists examples of running the whitelist tool:
Option
Optional
Description
–in <file|dir>
No
A SWF file, an AIR signature file, or an AIR certificate file. A directory containing SWF files. The
dir
parameter does not support AIR files.
To specify multiple files or directories, use multiple
–in
options.
For SWF files, the tool outputs a file with the extension .whitelist. For AIR signature and certificate files, the tool outputs a file with the extension .airwhitelist.
–log <file|dir>
Yes
An existing directory path where default whitelist.properties file is present or the full path name to the properties file. Customize logging in the .properties file.
The whitelist tool supports log4j Apache logging. By default, logging messages are routed to the console. To reroute them, use the
–log
option.
–out <output file>
Yes
The name for the .whitelist file and the .airwhitelist file. If
–out
is not specified, creates .whitelist and .airwhitelist files for each .swf file and .xml file.
If
–out
is specified,
–outDir
is ignored and the file is saved to the directory the tool is being run from.
–outDir <outputdir>
Yes
Creates an output directory and saves the .whitelist file to the directory.
If
–outDir
is not specified, the .whitelist files and .airwhitelist files are created in the directory the tool is being run from. If
–outDir
is a relative path, it is relative to the directory the tool is being run from.
–version
Yes
Prints the SWF verification version number in the .whitelist file.
Example
Result
whitelist –in foo.swf –in bar.swf
Creates a foo.swf.whitelist and a bar.swf.whitelist in the current directory.
whitelist –in signature.xml –in bar.swf
Creates signature.xml.airwhitelist and bar.swf.whitelist in the current directory.
whitelist –in foo.swf –in mydir
In this example, mydir is a directory containing bar.swf.
Creates a foo.swf.whitelist and a bar.swf.whitelist in the current directory.
whitelist –in signature.xml –in mydir
In this example, mydir is a directory containing bar.swf.
Creates a signature.xml.airwhitelist and a bar.swf.whitelist in the current directory.
whitelist –in foo.swf –in bar.swf –outDir outputdir
Creates an outputdir/foo.swf.whitelist file and an outputdir/bar.swf.whitelist file.
whitelist –in signature.xml –in bar.swf –outDir outputdir
Creates an outputdir/signature.xml.airwhitelist file and an outputdir/bar.swf.whitelist file.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 130
Content protection
Last updated 7/19/2012
If an input files has the same name as a previously input file, both files are added to the whitelist.
whitelist –in c:\myfolder\signature.xml –in c:\yourfolder\signature.xml –outDir c:\out\signature.xml
The following is the output:
# c:\myfolder\signature.xml
XXXXXXXXXXXXXXXXXXXXXX
# c:\yourfolder\signature.xml
XXXXXXXXXXXXXXXXXXXXXXXXXXX
The following is the whitelist format for an individual hash:
# foo.swf
PGfcEwgUKWScivIRucIwG5jT
The following is the whitelist format for an AIR file:
# C:\air\signatures.xml
A167FBF93528C87BBCDAC2B8CD0829479DDA6912.2
The following is the whitelist format for multiple hashes when using the
–out
option:
# foo.swf
PGfcEwgUKWScivIRucIwG5jT
# bar.swf
TcsQWLLi7h7WNjHqcLzzl0J15Srvdzkz2inCTKQLOHw=
# mydir/bar.swf
TcsQWLLi7h7WNjHqcLzzl0J15Srvdzkz2inCTKQLOHw=
whitelist –in foo.swf –in mydir –out outputfile
In this this example, mydir is a directory containing bar.swf.
Creates an outputfile.whitelist file in the current directory containing hashes for foo.swf and mydir/bar.swf.
whitelist –in signature.xml –in mydir –out outputfile
In this this example, mydir is a directory containing bar.swf.
Creates a an outputfile.airwhitelist file containing hashes for signature.xml. Creates an outputfile.whitelist file contaning hashes for bar.swf. Both files are created in the current directory.
whitelist –in foo.swf –in mydir -out outputfile -outDir outputdir
This example, mydir is a directory containing bar.swf.
Creates an outputfile.whitelist in the current directory containing a hash for foo.swf and mydir/bar.swf.
Warning: When the
–out
option is specified, the tool ignores the
–outDir
option.
whitelist –in signature.xml –in mydir –out outputfile –outDir outputdir
In this example, mydir is a directory containing bar.swf.
Creates an outputfile.airwhitelist file that contains the hashes for signature.xml. Creates an outputfile.whitelist file that contains hashes for mydir/bar.swf. Both files are created in the current directory.
Warning: When the
–out
option is specified, the tool ignores the
–outDir
option.
whitelist –version
Displays “version 1.0”.
Example Result
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 131
Content protection
Last updated 7/19/2012
Configuring content protection for HLS
Use Adobe Media Server 5 to serve protected content over HTTP to devices that support Apple HTTP Live Streaming.
The Adobe Media Server installer generates the required certificates and keys to the rootinstall/creds directory. To generate new keys, use the scramble tool. See
Scramble tool
.
Overview
The content can be protected using three modes:
•
Vanilla
•
PHLS
•
Adobe Access 4.0
To enable a specific encryption scheme, use the HLSProtectionScheme directive.
Vanilla
Vanilla mode is used for plain AES encryption.
PHLS
PHLS mode is a non-DRM solution. You do not need to set up a license or key server. The key is always served in a local mode.
Adobe Access
Adobe Access mode offers a complete DRM solution. It supports all the Adobe Access 3.0 features, along with remote key serving for HLS. Local key serving mode also works with Adobe Access 2.0 or higher license servers. The remote key serving mode works only with an Adobe Access 4.0 compliant server.
Adobe Access SDK is a Digital Rights Management (DRM) platform that makes it possible to protect and securely deliver video and audio content for playback on consumer devices such as personal computers. Adobe Access is a flexible platform that enables content owners to protect their content and maintain control over distribution. Content owners can protect and manage their rights by creating licenses for each digital media file, ensuring that a wide variety of the highest-quality content is made available to consumers.
Adobe Access supports a wide range of business models, including video on demand, rental, and electronic sell-through. You can distribute content protected with Adobe Access by streaming through Adobe Media Server software, offering progressive download via HTTP using Adobe’s HTTP Dynamic Streaming technology, or permitting downloads to a content library for local playback at the consumer’s convenience.
To enable DRM support for HTTP Live Streaming, use Adobe Access iOS library. The policy files generated for Adobe Access 2.0 and Adobe Access 3.0 will also work in local key serving mode.
AMS supports different content encryption keys for content at the different levels (server, application, stream, and event). The keys are generated according to the location of the content and the location of the Common Key.
Key rotation
You can periodically change the encryption key and specify how often the content encryption key is to be changed.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 132
Content protection
Last updated 7/19/2012
Out-of-Band DRM metadata
The HLS module of AMS supports serving of BER encoded DRM metadata out-of-band. The requested URL format is same as for a playlist except that the URL format has .drmmeta instead of .m3u8 at the end of the URL. The metadata embedded in the m3u8 file is base64-encoded but the metadata served out-of-band in the .drmmeta file is binary data.
Player binding
Adobe Media Server supports whitelist-based player binding when the protection scheme is PHLS. This is similar to the HTTP SWF Verification.
License chaining
Adobe Media Server will support embedding leaf licenses in the DRM metadata from the policy generated using a chained license. Adobe Media Server will need the license server credential and the credential password configured so that the root license from the policy can be used to encrypt the CEK contained in the embedded leaf license.
Live use case
Getting started
To configure PHLS with basic settings, perform the following steps:
1
Navigate to the <root-install>/Apache 2.2/conf/ directory. Edit the http.conf file and add the following tags under
<Location hls-live>
:
<Location /hls-live>
HLSHttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications”
HttpStreamingContentPath “../applications”
HLSMediaFileDuration 8000
HLSSlidingWindowLength 6
HLSFmsDirPath “..”
HttpStreamingUnavailableResponseCode 503
HLSM3U8MaxAge 2
HLSTSSegmentMaxAge -1
HLSMetaMaxAge 3600
HLSMaxEventAge 300HLSEncryptionScope server
HLSProtectionScheme PHLS
</Location>
Note: This configuration will enable PHLS at the server level.
2
Publish a live stream called “livestream?adbe-live-event=liveevent” to livepkgr.
3
Playback the stream using the URI http://<server-ip>:8134/hls-live/livepkgr/_definst_/liveevent/livetsream.m3u8
Detailed configuration
The following sections provides detailed configurations.
Server level
You can configure HLS at the server level to apply content protection across all deployed applications.
Vanilla
The following table contains the directives for the hlshttp_module in the Apache httpd.conf file:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 133
Content protection
Last updated 7/19/2012
Publishing and playback
1
Open the rootinstall/Apache2.2/conf/httpd.conf file and locate the hlshttp_module:
<IfModule hlshttp_module>
…
<Location /hls-live>
…
2
Uncomment the following:
# Uncomment the following directives to enable encryption
# for this location:
HLSEncryptionScope server
HLSEncryptionCipherKeyFile “../creds/liveeventkey.bin”
HLSEncryptKeyURI “https://<ServerName>/hls-key/liveeventkey.bin”
Substitute the fully qualified domain name of your Adobe Media Server for the
<ServerName>
parameter.
3
Follow the steps in
“Serve encryption keys to the client” on page
149
to configure the server to serve keys with or
without SSL. These steps configure the
/hls-key
path in the
HLSEncryptKeyURI
directive.
4
Open Flash Media Live Encoder and publish a stream with the following settings:
•
Format—H.264
•
Keyframe Frequency—4 seconds
•
AMS URL—rtmp://<server-name>/livepkgr
•
Stream—encryption?adbe-live-event=encryption
5
Request the following URL from an iOS device:
http://<servername>/hls-live/livepkgr/_definst_/encryption/encryption.m3u8
6
To verify that the stream is encrypted, run the Apple Media Stream Validator Tool on the stream. See
Technical
Note TN2224
.
PHLS and Adobe Access
The following table contains the directives for the hlshttp_module in the Apache httpd.conf file:
Directive
Default
Description
HLSEncryptionScope
Off
Defines the encryption scope. The following are possible values:
server
—Apache encryption settings are applied to all content. The server ignores content-specific encryption configurations in Event.xml and Application.xml (live) and jit.conf (on-demand).
content
—Apache encryption settings are ignored. The server uses encryption settings from Event.xml or Application.xml (live) or from jit.conf (on-demand).
Off
—Encryption is off for the whole server.
HLSEncryptCipherKeyFile
None
The path of the default cipher key used to encrypt the content.
HLSEncryptKeyURI
None
The URI that the client uses to fetch the encryption key.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 134
Content protection
Last updated 7/19/2012
PHLS
Edit the http.conf file and add the following tags under
<Location hls-live>
:
Parameter
Required With
Default
Description
HLSProtectionScheme
Adobe Access 4.0, PHLS
Vanilla
Determines the protection scheme used for content. Protection scheme can be Vanilla, FlashAccessV4 or PHLS. HLSProtectionScheme is effective if encryption is enabled.Use HLSEncryptionScope parameter to determine the status of encryption.
HLSFAXSCommonKeyFile
Adobe Access 4.0, (Optional) PHLS
For PHLS ../creds/commonKey.bin
Contains the name of the Common key file in ../creds/common-key.bin.
HLSFAXSContentID
(Optional) Adobe Access 4.0, (Optional) PHLS
eventId
Content ID for mapping the license.
HLSFAXSLicenseServerURL
Adobe Access 4.0
None
URL of License server used for protecting content
HLSFAXSTransportCertFile
Adobe Access 4.0
None
Transport certificate file used for protecting content
HLSFAXSLicenseServerCertFile
Adobe Access 4.0
None
File containing license server certificate used for protecting content
HLSFAXSPackagerCredentialFile
Adobe Access 4.0
None
File containing Packager credential used for protecting content
HLSFAXSPackagerCredentialPassword
Adobe Access 4.0
None
Packager credential password for the configured packager credential file
HLSFAXSPolicyFile
Adobe Access 4.0
None
Path and Name of the Policy File to be used for protecting content
HLSFAXSKeyServerURL
Adobe Access 4.0
None
Key server URL for embedding in the served playlist.
HLSFAXSOutputProtection
(Optional) PHLS
None
The required hardware Output Protection of media on the client. Possible values are None, BestEffort, and Required.
HLSFAXSPlaybackExpiration
(Optional) PHLS
24 Hours
The duration of the time for which the content is available for playback. Possible values are 24Hours and Unlimited.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 135
Content protection
Last updated 7/19/2012
<Location /hls-live>
HLSHttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications”
HttpStreamingContentPath “../applications”
HLSMediaFileDuration 10000
HLSSlidingWindowLength 6
HLSFmsDirPath “..”
HttpStreamingUnavailableResponseCode 503
HLSM3U8MaxAge 2
HLSTSSegmentMaxAge -1
HLSMetaMaxAge 3600
HLSMaxEventAge 300
HLSEncryptionScope server
HLSProtectionScheme PHLS
HLSFAXSContentID httpd_conf
HLSFAXSCommonKeyFile “../creds/liveeventkey.bin”
HLSFAXSKeyServerURL “faxs://example.com”
HLSFAXSOutputProtection None
HLSFAXSPlaybackExpiration Unlimited
</Location>
For details on the configuration elements, see the table mentioned above.
Adobe Access
Edit the http.conf file and add the following tags under
<Location hls-live>
:
<Location /hls-live>
HLSHttpStreamingEnabled true
HttpStreamingLiveEventPath “../applications”
HttpStreamingContentPath “../applications”
HLSMediaFileDuration 10000
HLSSlidingWindowLength 6
HLSFmsDirPath “..”
HttpStreamingUnavailableResponseCode 503
HLSM3U8MaxAge 2
HLSTSSegmentMaxAge -1
HLSMetaMaxAge 3600
HLSMaxEventAge 300
HLSEncryptionScope server
HLSProtectionScheme FlashAccessV4
HLSFAXSContentID httpd_conf
HLSFAXSCommonKeyFile “<path to common key file>”
HLSFAXSLicenseServerURL “<url of license server”
HLSFAXSTransportCertFile “path to transport certificate file”
HLSFAXSLicenseServerCertFile “<path to license server certificate file>”
HLSFAXSPackagerCredentialFile “<path to packager credential file>”
HLSFAXSPackagerCredentialPassword ??????
HLSFAXSPolicyFile “<path to policy file”
HLSFAXSKeyServerURL “<key server url>”
</Location>
For details on the configuration elements, see the table mentioned abo
Note: For local key delivery it is recommended that HLSFAXSKeyServerURL be set to the dummy URL http://faxs.adobe.com.
For information on publishing and playback, see
“Vanilla” on page
132
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 136
Content protection
Last updated 7/19/2012
Application and Event level
You can also configure HLS at an application or event level.
Both the Application.xml file and the Event.xml file have an
HLS
container that holds the live vanilla encryption configuration settings. In Application.xml, the container is located under
//Application/HDS/HLS
. In Event.xml, the container is located under
//Event/HLS
.
Application level
Vanilla
Configure live vanilla encryption at the application level
1
Open the rootinstall/Apache2.2/conf/httpd.conf file and locate the hlshttp_module:
<IfModule hlshttp_module>
…
<Location /hls-live>
…
2
Uncomment the
HLSEncryptionScope
directive and set it to
content
:
# Uncomment the following directives to enable encryption
# for this location:
HLSEncryptionScope content
#HLSEncryptionCipherKeyFile “../creds/liveeventkey.bin”
#HLSEncryptKeyURI “https://<ServerName>/hls-key/liveeventkey.bin”
Substitute the IP address or DNS of your Adobe Media Server for the
<ServerName>
parameter.
3
Edit the Application.xml file in the rootinstall/applications/livepkgr folder to include the following:
Element
Default
Description
/HLS
None
Container for content protection settings.
/HLS/Encryption
None
Set the
enabled
attribute to
“allow”
to allow vanilla encryption configurations in the Event.xml file to override settings in the Application.xml file.
Set the
enabled
attribute to
“true”
to configure vanilla encryption in the Application.xml file. These configurations apply to all live events in the application.
The default value of the
enabled
attribute in the Application.xml file is
“allow”
. The default value in the Event.xml file is
“false”
.
/HLS/Encryption/KeyFile
None
The path of the default cipher key used to encrypt the content.
/HLS/Encryption/KeyURI
None
The URI that the client uses to fetch the encryption key.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 137
Content protection
Last updated 7/19/2012
<Application>
<HDS>
<HLS>
<Encryption enabled=”true”>
<KeyFile>C:\Program Files\Adobe\Adobe Media Server 5\creds\liveeventkey.bin</KeyFile>
<KeyURI>http://<server-ip>/hls-key/liveeventkey.bin</KeyURI>
</Encryption>
</HLS>
</HDS>
</Application>
4
Follow the steps in
“Serve encryption keys to the client” on page
149
to configure the server to serve keys with or
without SSL. These steps configure the
/hls-key
path in the
KeyURI
directive.
5
Open Flash Media Live Encoder and publish a stream with the following settings:
•
Format—H.264
•
Keyframe Frequency—4 seconds
•
AMS URL—rtmp://<server-name>/livepkgr
•
Stream—encryption?adbe-live-event=encryption
6
Request the following URL from an application developed using the SDK on an iOS device:
http://<servername>/hls-live/livepkgr/_definst_/encryption/encryption.m3u8
7
To verify that the stream is encrypted, run the Apple Media Stream Validator Tool on the stream. See
Technical
Note TN2224
.
Note: To create a live event, create a copy of the livepkgr directory located at rootinstall/applications/livepkgr/events/_definst_/liveevent. The name of the copied directory must be the same as the name of the event.
PHLS
Edit the Application.xml file in the rootinstall/applications/livepkgr folder to include the following:
<Application>
<HDS>
<HLS>
<Encryption enabled=”true” protection-scheme=”PHLS” >
<PHLS>
<ContentID>app_event_xml</ContentID>
<CommonKeyPath>common.bin</CommonKeyPath>
<KeyServerURL>faxs://example.com</KeyServerURL>
<OutputProtection>None</OutputProtection>
<PlaybackExpiration>Unlimited</PlaybackExpiration>
</PHLS>
</Encryption >
</HLS>
</HDS>
</Application>
For more information about the elements, see the table in the server level configuration.
For information on publishing and playback, see
“Vanilla” on page
136
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 138
Content protection
Last updated 7/19/2012
Adobe Access
Edit the Application.xml file in the rootinstall/applications/livepkgr folder to include the following:
<Application>
<HDS>
<HLS>
<Encryption enabled=”true” protection-scheme=”FlashAccessV4″ >
<FlashAccessV4>
<ContentID>app_event_xml</ContentID>
<CommonKeyPath>common.bin</CommonKeyPath>
<LicenseServerURL>license server url </LicenseServerURL>
<TransportCertPath>transport.der</TransportCertPath>
<LicenseServerCertPath>server.der</LicenseServerCertPath>
<PackagerCredentialPath>
production_packager.pfx
</PackagerCredentialPath>
<PackagerCredentialPwd>??????</PackagerCredentialPwd>
<PolicyPath>policy.pol</PolicyPath>
<KeyServerURL>http://faxs.adobe.com</KeyServerURL>
</FlashAccessV4>
</Encryption >
</HLS>
</HDS>
</Application>
For more information about the elements, see the table in the server level configuration.
For information on publishing and playback, see
“Vanilla” on page
136
.
Event level
Vanilla
1
Open the rootinstall/Apache2.2/conf/httpd.conf file and locate the hlshttp_module:
<IfModule hlshttp_module>
…
<Location /hls-live>
…
2
Uncomment the
HLSEncryptionScope
directive and set it to
content
:
# Uncomment the following directives to enable encryption
# for this location:
HLSEncryptionScope content
#HLSEncryptionCipherKeyFile “../creds/liveeventkey.bin”
#HLSEncryptKeyURI “https://<ServerName>/hls-key/liveeventkey.bin”
Substitute the IP address or DNS of your Adobe Media Server for the
<ServerName>
parameter.
3
Edit the Event.xml file in the rootinstall/applications/livepkgr/_definst_/encryption folder to include the following:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 139
Content protection
Last updated 7/19/2012
<Event>
<HLS>
<Encryption enabled=”true”>
<KeyFile>
C:\Program Files\Adobe\Adobe Media Server5
\creds\liveeventkey.bin
</KeyFile>
<KeyURI>http://<server-ip>/hls-key/liveeventkey.bin</KeyURI>
</Encryption>
</HLS>
</Event>
4
Follow the steps in
“Serve encryption keys to the client” on page
149
to configure the server to serve keys with or
without SSL. These steps configure the
/hls-key
path in the
KeyURI
directive.
5
Open Flash Media Live Encoder and publish a stream with the following settings:
•
Format—H.264
•
Keyframe Frequency—4 seconds
•
AMS URL—rtmp://<server-name>/livepkgr
•
Stream—encryption?adbe-live-event=encryption
6
Request the following URL from an iOS device:
http://<ServerName>/hls-live/livepkgr/_definst_/encryption/encryption.m3u8
7
To verify that the stream is encrypted, run the Apple Media Stream Validator Tool on the stream. See
Technical
Note TN2224
.
PHLS
Edit the Event.xml file in the rootinstall/applications/livepkgr/_definst_/encryption folder to include the following:
<Event>
<HLS>
<Encryption enabled=”true” protection-scheme=”PHLS” >
<PHLS>
<ContentID>app_event_xml</ContentID>
<CommonKeyPath>common.bin</CommonKeyPath>
<KeyServerURL>faxs://example.com</KeyServerURL>
<OutputProtection>None</OutputProtection>
<PlaybackExpiration>Unlimited</PlaybackExpiration>
</PHLS>
</Encryption >
</HLS>
</Event>
For more information about the elements, see the table in the server level configuration.
For more information on publishing and playback, see
“Vanilla” on page
138
.
Adobe Access
Edit the Event.xml file in the rootinstall/applications/livepkgr/_definst_/encryption folder to include the following:<Event>
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 140
Content protection
Last updated 7/19/2012
<Event>
<HLS>
<Encryption enabled=”true” protection-scheme=”FlashAccessV4″ >
<FlashAccessV4>
<ContentID>app_event_xml</ContentID>
<CommonKeyPath>common.bin</CommonKeyPath>
<LicenseServerURL>license server url </LicenseServerURL>
<TransportCertPath>transport.der</TransportCertPath>
<LicenseServerCertPath>server.der</LicenseServerCertPath>
<PackagerCredentialPath>
production_packager.pfx
</PackagerCredentialPath>
<PackagerCredentialPwd>??????</PackagerCredentialPwd>
<PolicyPath>policy.pol</PolicyPath>
<KeyServerURL>http://faxs.adobe.com</KeyServerURL>
</FlashAccessV4>
</Encryption >
</HLS>
</Event>
For more information about the elements, see the table in the server level configuration.
For more information on publishing and playback, see
“Vanilla” on page
138
.
Live events
To generate unique content encryption keys (CEKs) for Adobe Access, the URL path (relative to the configured content path) up to the stream, but not including the stream name, is used as the Content ID. For example, Content ID for path http://example.com/hls-live/livepkgr/definst/liveevent/livestream.m3u8 would be livepkgr/definst/liveevent.
VOD use case
Configure PHLS for on-demand streaing at the following levels:
Server—rootinstall/Apache2.2/conf/httpd.conf
Stream—create a jit.conf file and copy it to the same directory as the content.
Getting started
To configure PHLS with basic settings, perform the following steps:
❖
Navigate to <root-install>/Apache 2.2/conf/. Edit the file http.conf and add the tags
HLSEncryptionScope
and
HLSProtectionScheme
under the
<Location /hls-vod>
directive:
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 141
Content protection
Last updated 7/19/2012
<Location /hls-vod>
HLSHttpSt reamingEna bled true
HLSMediaFileDuration 8000
HttpStreamingContentPath “../webroot/vod”
HLSFmsDirPath “..”
HLSJITConfAllowed true
HLSM3U8MaxAge 86400
HLSTSSegmentMaxAge 86400
HLSMetaMaxAge 3600
HLSEncryptionScope server
HLSProtectionScheme PHLS
Options -Indexes FollowSymLinks
</Location>
Note: This configuration will enable PHLS at the server level with default configurations.
The sample1_1500kbps.f4v media file comes with the default installation of AMS under <root-install>/webroot. You can play the media file using the following URI:http://<server-ip>/hls-vod/sample1_1500kbps.f4v.m3u8
Detailed configuration
The following sections provides the detailed configurations.
Server level
You can configure HLS at the server level to apply content protection at server level to all streams requested through the location directives.
Vanilla
Configure the following directives for the hlshttp_module in the Apache httpd.conf file:
To configure vanilla content protection at the server level, set
HLSEncryptionScope
to
server
in the httpd.conf file. This configuration tells the server to use the settings in the httpd.conf file for all requests to this
Location
directive.
1
Open the rootinstall/Apache2.2/conf/httpd.conf file and locate the hlshttp_module:
Directive
Default
Description
HLSEncryptionScope
Off
Defines the encryption scope. The following are possible values:
server
—Apache encryption settings are applied to all content. The server ignores content-specific encryption configurations in Event.xml and Application.xml (live) and jit.conf (on-demand).
content
—Apache encryption settings are ignored. The server uses encryption settings from Event.xml or Application.xml (live) or from jit.conf (on-demand).
Off
—Encryption is off for the whole server.
HLSEncryptCipherKeyFile
None
The path of the default cipher key used to encrypt the content.
HLSEncryptKeyURI
None
The URI that the client uses to fetch the encryption key. See
“Serve encryption keys to the client” on page
149
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 142
Content protection
Last updated 7/19/2012
<IfModule hlshttp_module>
…
<Location /hls-vod>
…
2
Uncomment the following:
# Uncomment the following directives to enable encryption
# for this location:
HLSEncryptionScope server
HLSEncryptionCipherKeyFile “../creds/vodkey.bin”
HLSEncryptKeyURI “https://<ServerName>/hls-key/vodkey.bin”
Substitute the IP address or DNS of your Adobe Media Server for the
<ServerName>
parameter.
3
Follow the steps in
“Serve encryption keys to the client” on page
149
to configure the server to serve keys with or
without SSL. These steps configure the
/hls-key
path in the
HLSEncryptKeyURI
directive.
4
Request the following URL from an iOS device:
http://<ServerName>/hls-vod/sample2_1000kbps.f4v.m3u8
5
To verify that the stream is encrypted, run the Apple Media Stream Validator Tool on the stream. See
Technical
Note TN2224
.
The following table contains the directives for the hlshttp_module in the Apache httpd.conf file:
Parameter
Required With
Default
Description
HLSProtectionScheme
Adobe Access 4.0, PHLS
Vanilla
Determines the protection scheme used for content. Protection scheme can be Vanilla, FlashAccessV4 or PHLS. HLSProtectionScheme is effective if encryption is enabled.Use HLSEncryptionScope parameter to determine the status of encryption.
HLSFAXSCommonKeyFile
Adobe Access 4.0, (Optional) PHLS
For PHLS ../creds/commonKey.bin
Contains the name of the Common key file in ../creds/common-key.bin.
HLSFAXSContentID
(Optional) Adobe Access 4.0, (Optional) PHLS
eventId
Content ID for mapping the license.
HLSFAXSLicenseServerURL
Adobe Access 4.0
None
URL of License server used for protecting content
HLSFAXSTransportCertFile
Adobe Access 4.0
None
Transport certificate file used for protecting content
HLSFAXSLicenseServerCertFile
Adobe Access 4.0
None
File containing license server certificate used for protecting content
HLSFAXSPackagerCredentialFile
Adobe Access 4.0
None
File containing Packager credential used for protecting content
HLSFAXSPackagerCredentialPassword
Adobe Access 4.0
None
Packager credential password for the configured packager credential file
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 143
Content protection
Last updated 7/19/2012
PHLS
Edit the file http.conf and update the
<Location /hls-vod>
directive as follows:
<Location /hls-vod>
HLSHttpStreamingEnabled true
HLSMediaFileDuration 8000
HttpStreamingContentPath “../webroot/vod”
HLSFmsDirPath “..”
HLSJITConfAllowed true
HLSM3U8MaxAge 86400
HLSTSSegmentMaxAge 86400
HLSMetaMaxAge 3600
HLSEncryptionScope server
HLSProtectionScheme PHLS
HLSFAXSContentID httpd_conf
HLSFAXSCommonKeyFile “../creds/liveeventkey.bin”
HLSFAXSKeyServerURL “faxs://example.com”
HLSFAXSOutputProtection None
HLSFAXSPlaybackExpiration Unlimited
</Location>
Request the following URL from an iOS device:
http://<ServerName>/hl-vod/sample2_1000kbps.f4v.m3u8
For more information on the elements, see
“Vanilla” on page
141
.
Adobe Access
Edit the file http.conf and update the
<Location /hls-vod>
directive as follows:
HLSFAXSPolicyFile
Adobe Access 4.0
None
Path and Name of the Policy File to be used for protecting content
HLSFAXSKeyServerURL
Adobe Access 4.0
None
Key server URL for embedding in the served playlist.
HLSFAXSOutputProtection
(Optional) PHLS
None
The required hardware Output Protection of media on the client. Possible values are None, BestEffort, and Required.
HLSFAXSPlaybackExpiration
(Optional) PHLS
24 Hours
The duration of the time for which the content is available for playback. Possible values are 24Hours and Unlimited.
Parameter Required With Default Description
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 144
Content protection
Last updated 7/19/2012
<Location /hls-live>
HLSHttpStreamingEnabled true
HLSMediaFileDuration 8000
HttpStreamingContentPath “../webroot/vod”
HLSFmsDirPath “..”
HLSJITConfAllowed true
HLSM3U8MaxAge 86400
HLSTSSegmentMaxAge 86400
HLSMetaMaxAge 3600
HLSEncryptionScope server
HLSProtectionScheme FlashAccessV4
HLSFAXSContentID httpd_conf
HLSFAXSCommonKeyFile “<path to common key file>”
HLSFAXSLicenseServerURL “<url of license server”
HLSFAXSTransportCertFile “path to transport certificate file”
HLSFAXSLicenseServerCertFile “<path to license server certificate file>”
HLSFAXSPackagerCredentialFile “<path to packager credential file>”
HLSFAXSPackagerCredentialPassword ??????
HLSFAXSPolicyFile “<path to policy file”
HLSFAXSKeyServerURL “<key server url>”
</Location>
Request the following URL from an iOS device:
http://<ServerName>/hl-vod/sample2_1000kbps.f4v.m3u8
Note: For local key delivery, it is recommended that
HLSFAXSKeyServerURL
be set to the dummy URL http://faxs.adobe.com.
For more information on the elements, see
“Vanilla” on page
141
.
Stream level
To configure individual sets of media, in the httpd.conf file, set
HLSEncryptionScope
to
content
. This setting tells the server that configuration settings in the jit.conf file override settings in the httpd.conf file.
Configure the following elements in a jit.conf file in the same directory as the on-demand media:
Vanilla
1
To configure live PHLS at the stream level, open the rootinstall/Apache2.2/conf/httpd.conf file and locate the hlshttp_module:
Element
Default value
Description
//manifest/hds:encryption
None
The parent element for configuration. This element has with an
enabled
attribute. To enable content for protection with PHLS, set the enabled attribute to
“true”
. The value is
“false”
by default.
//man
if
est/hds
:
encryption/hds:keyfile
None
The path of the default cipher key used to encrypt the content.
//manifest/hds:encryption/hds:keyuri
None
The URI that the client uses to fetch the encryption key. See
“Serve
encryption keys to the client” on
page
149
.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 145
Content protection
Last updated 7/19/2012
<IfModule hlshttp_module>
…
<Location /hls-vod>
…
2
Uncomment
HLSEncryptionScope
and set it to
content
:
# Uncomment the following directives to enable encryption
# for this location:
HLSEncryptionScope content
#HLSEncryptCipherKeyFile
# HLSEncryptKeyURI
3
Create a jit.conf configuration file and copy it to the same directory as the on-demand media files.
<hds:hls>
<hds:encryption enabled=”true”>
<hds:keyfile>../creds/content.key</hds:keyfile>
<hds:keyuri>https://<server-name>/hls-key/content.key</hds:keyuri>
</hds:encryption>
</hds:hls>
4
Follow the steps in
“Serve encryption keys to the client” on page
149
to configure the server to serve keys with or
without SSL. These steps configure the
/hls-key
path in the
/hds:keyuri
element.
5
Copy the vodkey.bin file from rootinstall/creds to rootinstall/webroot/keys.
6
Request the following URL from an iOS device:
http://<servername>/hls-vod/sample2_1000kbps.f4v.m3u8
7
To verify that the stream is encrypted, run the Apple Media Stream Validator Tool on the stream. See
Technical
Note TN2224
.
PHLS
See the following sample configuration:
<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns=”http://ns.adobe.com/f4m/1.0″
xmlns:hds=”http://ns.adobe.com/hds-package/1.0″>
<hds:hls>
<hds:encryption enabled=”true” protection-scheme=”PHLS” >
<hds:PHLS>
<hds:content-id>jit_conf</hds:content-id>
<hds:common-key-file>
root_install/creds/vodkey.bin
</hds:common-key-file>
<hds:output-protection>None</hds:output-protection>
<hds:playback-expiration>Unlimited</hds:playback-expiration>
</hds:PHLS>
</hds:encryption>
</hds:hls>
</manifest>
Request the following URL from an iOS device:
http://<ServerName>/hl-vod/sample2_1000kbps.f4v.m3u8
For configuring the server with PHLS, see the steps mentioned in the Vanilla section. For details on the configuration elements, see the table above.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 146
Content protection
Last updated 7/19/2012
Adobe Access
See the following sample configuration:
<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns=”http://ns.adobe.com/f4m/1.0″
xmlns:hds=”http://ns.adobe.com/hds-package/1.0″>
<hds:hls>
<hds:encryption enabled=”true” protection-scheme=”FlashAccessV4″>
<hds:FlashAccessV4>
<hds:content-id>jit_conf</hds:content-id>
<hds:common-key-file>
root_install/creds/vodkey.bin
</hds:common-key-file>
<hds:license-server-url>
http://mylicenseserver.myhost.com
</hds:license-server-url>
<hds:transport-cert-file>
production_transport.der
</hds:transport-cert-file>
<hds:license-server-cert-file>
production_license_server.der
</hds:license-server-cert-file>
<hds:packager-credential-file>
production_packager.pfx
</hds:packager-credential-file>
<hds:packager-credential-password>
??????
</hds:packager-credential-password>
<hds:policy-file>policy.pol</hds:policy-file>
<hds:key-server-url>http://faxs.adobe.com</hds:key-server-url>
</hds:FlashAccessV4>
</hds:encryption>
</hds:hls>
</manifest>
For local key delivery, it is recommended that HLSFAXSKeyServerURL be set to the dummy URL http://faxs.adobe.com.
Request the following URL from an iOS device:
http://<ServerName>/hl-vod/sample2_1000kbps.f4v.m3u8
For configuring the server with PHLS, see the steps mentioned in the Vanilla section. For details on the configuration elements, see the table above.
VOD streams
To generate unique content encryption keys (CEKs) for Adobe Access, the URL path (relative to the configured content path) including the stream name is used as Content ID. For example, Content ID for path http://example.com/hls-vod/mymedia/sample.f4v.m3u8 would be mymedia/sample.f4v.
To change the default Content ID, specify the new Content ID in the configuration files event.xml, application.xml or jit.conf.
Multiple renditions of the same content require the same CEK for each rendition. To enable the same CEK across multiple renditions of the same content, configure the content-id in:
•
application.xml
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 147
Content protection
Last updated 7/19/2012
•
event.xml (for Live Events) or jit.conf (for VOD Events).
You can protect the renditions using the Adobe Access configurations.
License chaining
If the configuration for embedding the leaf license is turned off, Adobe Media Server will still support such a policy except that the leaf license will not be embedded in the DRM metadata.
Note: The support will be limited to a single license server credential and credential-password pair.
The following table provides the configuration details:
Key rotation
To enable the feature, you must add the following configuration directives in the httpd.conf file:
Parameter
Description
Required with
Default value
HLSFAXSEmbedLeafLicense (Server level)
HLS/Encryption/FlashAccessV4/EmbedLeafLicense( Application and Eventlevel)
hds:hls/hds:encryption/hds:FlashAccessV4/hds:embed-leaf-license (VOD Use case -Stream level)
(Optional) Enables embedding of leaf licenses for policies generated using chained licenses. Possible values are “true” or “false”.
FlashAccessV4
false
HLSFAXSLicenseServerCredentialFile (Server level)
HLS/Encryption/FlashAccessV4/LicenseServerCredentialFile (Application and Eventlevel)
hds:hls/hds:encryption/hds:FlashAccessV4/hds:license-server-credential-file (VOD Use case -Stream level)
Required if HLSFAXSEmbedLeafLicense is set to true. The license server credential used when protecting content at this location.
FlashAccessV4
NA
HLSFAXSLicenseServerCredentialPassword (Server level)
HLS/Encryption/FlashAccessV4/LicenseServerCredentialPassword (Application and Eventlevel)
hds:hls/hds:encryption/hds:FlashAccessV4/hds:li cense-server-credential-password (VOD Use case -Stream level)
Required if HLSFAXSEmbedLeafLicense is set to true. The license server credential password for the configured license server credential file.
FlashAccessV4
NA
Directive
Required with
Default Value
Description
HLSFAXSEnableKeyRotation (Server level)
EnableKeyRotation (Application and Eventlevel)
hds:hls/hds:encryption/hds:FlashAccessV4/hds:enable-key-rotation (VOD Use case -Stream leve)
Optional with FlashAccessV4 and PHLS
true
Enabled by default. To enable key rotation set the attribute to “false”.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 148
Content protection
Last updated 7/19/2012
For HDS streams, the key rotation does not have any impact on the performance of the client or on scaling impact of the license server because rotating the key is handled in-band.
In HLS key rotation results in a key request from the key server when using remote key delivery. For local, the rotated key is in the updated M3U8 file.
Out-of-Band DRM metadata
To enable this feature, you must add the following configuration directives in the httpd.conf file:
Player binding
A whitelist file (with extension .airwhitelist) is a text file that contains multiple entries where each entry corresponds to an application identifying four fields (publisher-id, app-id, min-ver, max-ver). The publisher-id is mandatory and rest of the fields are optional. The file can be generated by passing the certificate(s) used to sign the application(s) to the whitelist tool . Currently the whitelist tool only supports extracting publisher-id but the rest of the fields (if required) can be updated manually. Player binding can be enabled by configuration and a folder needs to be specified from where Adobe Media Server can locate the whitelist files (multiple whitelist files and multiple entries in a whitelist files are supported). Adobe Media Server will add the list of identifiers picked up from the whitelist files to the license it embeds in the metadata.
To enable the feature, you must add the following configuration directives in the httpd.conf file:
HLSFAXSKeyRotationInterval (Server level)
KeyRotationInterval (Application and Eventlevel)
hds:hls/hds:encryption/hds:FlashAccessV4/hds:key-rotation-interval (VOD Use case -Stream leve)
Optional with FlashAccessV4 and PHLS
15
The key is changed after the specified number of seconds.
Directive
Required
Default Value
Description
HLSFAXSEmbedMetadata
No
For VOD, true For Live, false
Enables embedding of metadata in the playlist. The false value is applicable only when HLSMetaPackagingEnabled is set to true.
HLSMetaMaxAge
No
3600 seconds
The maximum age in the Cache-Control header for m3u8 responses. A value of -1 specifies that no Cache-Control header is set. If no value is specified, default value,3600 seconds, is assumed.
HLSMetaPackagingEnabled
No
true
This configuration is applicable only when HLSMetaPackagingEnabled is set to true.
Directive Require
d with
Default Value Description
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 149
Content protection
Last updated 7/19/2012
Serve encryption keys to the client
The following PHLS configurations specify the path the client uses to fetch the encryption key:
•
HLSEncryptKeyURI
•
//manifest/hds:hls/hds:encryption/hds:keyuri
•
//Application/HDS/HLS/Encryption/KeyURI
•
//Event/HLS/Encryption/KeyURI
For both on-demand and live vanilla encryption, serve encryption keys to the client through the Apache HLS module. The module unscrambles the key before serving the request.
Note: Note that the key files used for configuring encryption always needs to scrambled.
You can enable client authentication over SSL to ensure that key files are served securely. A reference configuration file and the Apple CA bundle are installed to the following locations:
rootinstall/Apache2.2/conf/httd-hls-secure.conf
rootinstall/creds/certs/ca
The httpd-hls-secure.conf file demonstrates how to configure a virtual host at the default SSL port with client authentication enabled for the location /hls-key with cipher key hosting enabled. However, this is only a reference configuration. To guarantee authentication for a production system, customize the configuration for your deployment.
Note: The SSL certificate presented by the iOS client must be current. If the client presents an expired certificate, client authentication fails and an error message displays to the user (on the client). iOS clients with older iOS installations may encounter this problem.
Serve key files with SSL client authentication
1
Uncomment the following lines in the Apache httpd.conf file:
“#LoadModule ssl_module”
“#Include conf/httpd-hls-secure.conf”
Directive
Required with
Default Value
Description
HLSFAXSPlayerBindingEnabled (Server level)
HLS/Encryption/PHLS/PlayerBindingEnabled (Application and Eventlevel)
hds:hls/hds:encryption/hds:phls/hds:player-binding (VOD Use case -Stream leve)
PHLS
false
Enables player binding using white-list. Possible values are “true” or “false”.
HLSFAXSWhitelistFolder (Server level)
HLS/Encryption/PHLS/WhitelistFolder (Application and Eventlevel)
hds:hls/hds:encryption/hds:phls/hds:whitelist-folder (VOD Use case -Stream leve)
PHLS
NA
(Required if
HLSFAXSPlayerBindingEnabled
is true) The directory location containing the white-list files. This will work only when
HLSFAXSPlayerBindingEnabled
is set to true.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 150
Content protection
Last updated 7/19/2012
2
Customize the SSL properties in the rootinstall/Apache2.2/conf/httpd-hls-secure.conf file based on the deployment. This customization includes getting an SSL certificate from a recognized CA.
Important: The SSL certificate generated for the server must have a CN that is a FQDN (Fully Qualified Domain Name), even in a test environment. If not, the iOS client may not present its client certificate and client authentication fails. If client authentication fails, the key file is not served and the iOS client crashes. This is a known Apple bug.
3
Restart Apache.
Serve key files without SSL
1
Add the following to the Apache httpd.conf file under the line
<IfModule hlshttp_module>
:
<Location /hls-key>
HLSEncryptHostCipherKey true
HLSFmsDirPath “..”
HLSEncryptKeyRepository “../creds”
</Location>
The
Location
path can be any value. Point the
HLSEncryptKeyRepository
directive to the location of the keys. The keys are in the rootinstall/creds folder by default.
2
Restart Apache.
Use the following parameters in the Apache httpd.conf file to configure key hosting:
Dynamic Content Encryption Key
AMS supports different content encryption keys for content at the different levels (server, application, stream, and event). The keys are generated according to the location of the content and the location of the Common Key.
Delivering Content Encryption Keys
The Content Encryption Key delivery mode is specified in the policy file. For the Adobe Access 4.0 protection scheme, set the policy using HLSFAXSPolicyFile parameter. To select the policy file for the PHDS protection scheme, HLSFAXSOutputProtection and HLSFAXSPlaybackExpiration are used.
The key server URL is based on the key delivery mode specified in the policy file. For remote key serving, use the KeyServerURL parameter to specify the URL of key server. The URL format for remote key serving is https://<customers-keyserver-uri>. For example, https://faxs.adobe.com. For local key serving, the value of KeyServerURL should always be faxs://faxs.adobe.com.
Note: PHLS supports only local key delivery and AMS cannot deliver CEKs as long as DRM is enabled.
Parameter
Description
Default value
HLSEncryptHostCipherKey
Enable (
true
) or disable (
false
) cipher key hosting from this location.
false
HLSEncryptKeyRepository
The path of the folder that contains the key file.
None
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 151
Content protection
Last updated 7/19/2012
Adaptive bitrate streaming
In order to support adaptive bitrate, HTTP Live Streaming requires a variant playlist file that referes to individual playlist files having different renditions of the same content. The Adobe Access for iOS SDK requires that each stream referred to in a variant playlist must be encrypted using the same policy and the same content encryption key. Hence each encrypted stream will have the same DRM metadata referred in
#EXT-X-FAXS-CM
tag (embedded or served out of band).
The Adobe Access Server protected variant playlist also needs to include the
#EXT-X-FAXS-CM
tag. The value of
#EXT-X-FAXS-CM
tag in variant playlist is the relative URI referring to the DRM metadata of one of the individual streams.At the client, the
#EXT-X-FAXS-CM
tag in variant playlist will be used to create the DRM session. The same DRM session will be used for all encrypted M3U8 files inside the variant playlist.
Here’s an example of Adobe Access protected variant playlist:
#EXTM3U
#EXT-X-FAXS-CM:URI=”hls-vod-faxsv4/sample_mbr_mp4_main_3_1/8_mp4_AAC_212Kbps_720_480_main_3_1.mp4.drmmeta”
#EXT-X-STREAM-INF:PROGRAM-ID=41,BANDWIDTH=212000, CODECS=”avc1.77.31, mp4a.40.5″ hls-vod-faxsv4/sample_mbr_mp4_main_3_1/8_mp4_AAC_212Kbps_720_480_main_3_1.mp4.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=41,BANDWIDTH=307000, CODECS=”avc1.77.31, mp4a.40.5″ hls-vod-faxsv4/sample_mbr_mp4_main_3_1/8_mp4_AAC_307Kbps_720_480_main_3_1.mp4.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=41,BANDWIDTH=512000, CODECS=”avc1.77.31, mp4a.40.5″ http://my.server.com/hls-vod-faxsv4/sample_mbr_mp4_main_3_1/8_mp4_AAC_512Kbps_720_480_main_3_1.mp4.m3u8
Note: This variant playlist needs to be served in Adobe Access M3U8 format. For instance, you need to append ?faxs=1 to the URL like http://my.server.com/variantPlaylist.m3u8?faxs=1.
152
Last updated 7/19/2012
Chapter 3: Getting started developing applications
Application architecture
The client application is written in ActionScript™ and compiles to a SWF file. The server application is written in Server-Side ActionScript (which is like ActionScript 1.0, but runs on the server, rather than on the client). A media application usually has recorded or live audio and video that it streams from server to client, client to server, or server to server.
A typical Adobe Media Server application has these parts:
Client
The client displays a user interface, such as controls to start, stop, or pause a video. The client can run in Flash Player, Adobe AIR, or Flash Lite 3. You can develop clients with Adobe Flash Professional, Adobe Flash Builder, or the Flex SDK. You can also use prebuilt clients. Adobe recommends using a player that is based on OSMF (Open Source Media Framework), such as
Strobe Media Playback
.
Client-side ActionScript
The client contains ActionScript code that handles user interaction and connects to the server. Adobe Media Server 3 and later support ActionScript 3.0, ActionScript 2.0, and ActionScript 1.0.
Video or audio files
Many media applications stream recorded audio or video from the server to clients or between clients. Adobe Media Server supports playback of a variety of stream formats, including Flash Video (FLV), MPEG-3 (MP3), MPEG-4 (MP4 and F4V), and RAW.
Camera or microphone
You can use Flash Media Live Encoder to stream live video or audio to the server. You can also create your own client that captures live audio and video. In both cases, you need a camera and a microphone to capture the video and audio.
Server-Side ActionScript
Most applications use Server-Side ActionScript code written in a file with the suffix .asc, called an ActionScript Communication File. The file is named either main.asc, or myApplication.asc. You can use server-side code to control access to applications, define what happens when users connect and disconnect, create playlists, connect to external data sources, and so on.
Adobe Media Server installs with four server-side applications (also called streaming services): live, vod, livepkgr, and multicast. Each service provides a different type of streaming.
More Help topics
“Overview of creating an application” on page
155
“Getting started streaming media” on page
1
Set up a development environment
You can use any edition of the server, including the free developer edition, to develop and test applications. To write client-side code, use Flash Professional, Flash Builder, or the Flex SDK. To write server-side code, you can use any text editor or IDE, including Flash Professional and Flash Builder.
ADOBE ME DIA SERV ER 5 DEVELOPER’S GUIDE 153
Getting started developing applications
Last updated 7/19/2012
You can write client-side code and server-side code on the same computer running Adobe Media Server, or you can write it on a remote computer. To test the application, copy the server-side code to Adobe Media Server.
If you have an account with a
Adobe Media Server solution partner
, the partner tells you how to configure your
development environment to use their resources.
Set up a development environment:
1
Run the Adobe Media Server installer to install the server.
2
Verify that the server is installed successfully.
3
Do one of the following:
•
Install Flash Professional from
www.adobe.com/go/flash
.
•
Install Flash Builder from
www.adobe.com/go/flashbuilder
.
•
Install the Flex SDK from
opensource.adobe.com.
4
To capture and encode live video, do the following:
a
Connect a camera and a microphone to the computer.
b
Download and install Adobe Media Live Encoder from
www.adobe.com/go/fmle
.
Note: Adobe Media Live Encoder captures audio and video, encodes it, and sends it to Adobe Media Server. You can also build custom applications that capture and encode audio and video.
Example: Hello World application
Overview
Note: The following sections do not apply to Adobe Media Streaming Server because you cannot write server-side code for that server edition.
This sample shows simple communication from the client to the server and back again. When a user clicks a button, the client connects to the server. The client calls a server-side function that returns a string. When the server replies, the client displays the string sent from the server.
The sample files are in the rootinstall\documentation\samples\HelloWorld folder.
Create the user interface
1