Macromedia Media Server - 5.0.6 User Guide

ADOBE®MEDIA SERVER
Developer’s Guide

Legal notices

Legal notices
For legal notices, see http://help.adobe.com/en_US/legalnotices/index.html.
Last updated 9/4/2014

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) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Stream on-demand media (HTTP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Stream on-demand media (RTMP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Stream on-demand encrypted media (pRTMP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Multicast media (RTMFP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Configure closed captioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Configure alternate audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Configure content protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Configure HTTP Dynamic Streaming and HTTP Live Streaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
HTTP streaming configuration file reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Build custom media players . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Offline packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Troubleshoot issues with streaming media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Chapter 2: Content protection
Configuring content protection for HDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Configuring content protection for HLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Chapter 3: Getting started developing applications
Application architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Set up a development environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Example: Hello World application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Overview of creating an application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Test an application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Deploy an application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Chapter 4: Developing streaming media applications
Connecting to the server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Managing connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Streaming media files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Checking video files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Handling errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Working with playlists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Dynamic streaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Reconnecting streams when a connection drops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Fast switching between streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Smart Seeking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Detecting bandwidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Detecting stream length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Contents
Chapter 5: Working with live video
Capturing live video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Adding DVR features to live video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Adding metadata to a live stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
Capturing timecode sent from Flash Media Live Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Publishing live video in RAW file format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Multi-point publishing between servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
Chapter 6: Building peer-assisted networking applications
Real-Time Media Flow Protocol (RTMFP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
RTMFP groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Distribute peer introductions across servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Chapter 7: Developing social applications
About social applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
About shared objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Remote shared objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
SharedBall example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Broadcast messages to many users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
iv
Chapter 8: Securing applications
Allow or deny access to assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Authenticate clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Authenticate users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Chapter 9: Developing Plug-ins
What’s new with plug-ins in Flash Media Server 4.5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
What’s new with plug-ins in Flash Media Server 4.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Versioning, upgrading, and server editions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Working with plug-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
General development tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Developing an Access plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Developing an Authorization plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Developing a File plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Last updated 9/4/2014

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:
1
Streaming type Service
On-demand streaming over RTMP.
See Stream on-demand media
(RTMP).
On-demand streaming over HTTP.
See “Stream on-demand media
(HTTP)” on page 19.
Live streaming over RTMP.
See “Stream live media (RTMP)” on page 17
Live streaming over HTTP.
See “Stream live media (HTTP)” on page 5.
name
vod 3 All Flash Player 6
None 4.5 All Flash Player 10.1
live 3 All Flash Player 6
livepkgr 4 4—Adobe Media
Server version Server
edition(earliest supported)
Server Extended, Adobe Media Server Professional
4.5—All
Client runtime (earliest supported)
AIR 1
AIR 2
iOS 3.0
QuickTime X
AIR 1
4—Flash Player 10.1, AIR 2
4.5—Flash Player
10.1, AIR 2, iOS 3.0, QuickTime X
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
2
Streaming type Service
Multicast streaming over RTMFP.
See “Multicast media (RTMFP)” on page 36.
name
multicast 4 Adobe Media Server
Server version Server
edition(earliest supported)
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.
Client runtime (earliest supported)
Flash Player 10.1
AIR 2
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
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.
File Packager reference.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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
A custom-built Flash Player or AIR application. See “Working with live video” on page 235.
Third-party encoding solutions. See Adobe Media Server Solution Partners.
Stream.play(), the stream is considered “live”.
3

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.
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.
Adobe Media Server multicast sample player
Flash FLVPlayback component RTMP/x fl.video.FLVPlayback
Flex components RTMP/x mx.controls.VideoDisplay
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.
RTMFP rootinstall/tools/multicast/multicastplaye
www.adobe.com/products/flashmediapl ayback/
rootinstall/samples/videoPlayer
r
FLV playback 2.5 supports DVR
spark.components.VideoPlayer
spark.components.VideoDisplay
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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.
4
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 26, “URLs for publishing
and playing live streams over RTMP” on page 18, “URLs for publishing and playing live streams over HTTP” on
page 12, and “URLs for playing on-demand streams over HTTP” on page 23.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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 SampleMediaPlayback.swf file at swfs/SampleMediaPlayback.swf. The SampleMediaPlayback.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.
Media player Supported streaming type
5
Devices running iOS 3.0 and later include built-in client software.
On Mac OS 10.6 and later, Safari 4.0 and QuickTime X. On-demand and live (HTTP)
For more information about Apple media players, see Apple HTTP Live Streaming Overview.
On-demand and live (HTTP)

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.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media

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
MainConcept AAC Encoder.
the
6
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.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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”.
7
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 12.
c Select Yes under the question “Are you using HTTP Streaming or Adobe Access 2.0?”.
d Click Preview. Click Play.
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 12.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
c Select LIVE and Click PLAY STREAM.
6 (Apple HTTP Live Streaming) Use the following URL:
http://10.0.1.11/hls-live/livepkgr/_definst_/liveevent/livestream.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.
For information about the request URL, see “URLs for publishing and playing live streams over HTTP” on page 12.
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 111
Disk management” on page 70
Content storage (HDS and HLS)” on page 56
Configure HTTP Dynamic Streaming and HTTP Live Streaming” on page 51
Stream live media (RTMP)” on page 17
8

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.
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.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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:
Stream URI Bitrate
livestream1.f4m 150
livestream2.f4m 500
livestream3.f4m 700
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>
9
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.
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:
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
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 11.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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
MainConcept AAC Encoder.
the
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.
10
c For Bit Rate, choose 150, 500, and 700.
d In the AMS URL text box, enter the following:
rtmp://localhost/livepkgr
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
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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
11

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 embedded tags:
Tag Description
audio-only Specifies whether the stream/file is audio-only. If the tag is not present, the
audio-only-mp3/audio-only-aac Specifies the audio codec of the requested stream file. If this tag is not present,
Here is an example of a valid M3U8 URL:
http://myserver/hls-vod/audio-only-aac/sample1_1500kbps.f4v.m3u8
Here is an example M3U8 file snippet:#EXTM3U_#EXT-X-STREAM-INF:PROGRAM­ID=1,BANDWIDTH=1500000,CODECS="avc1.42001e, mp4a.40.2"http://10.40.23.222/hls­vod/sample1_1500kbps.f4v.m3u8#EXT-X-STREAM-INF:PROGRAM­ID=1,BANDWIDTH=150000,CODECS="avc1.42001e, mp4a.40.2"_http://10.40.23.222/hls­vod/sample1_150kbps.f4v.m3u8#EXT-X-STREAM-INF:PROGRAM­ID=1,BANDWIDTH=1000000,CODECS="avc1.42001e, mp4a.40.2"_http://10.40.23.222/hls­vod/sample1_1000kbps.f4v.m3u8#EXT-X-STREAM-INF:PROGRAM­ID=1,BANDWIDTH=64000,CODECS="mp4a.40.2"http://10.40.23.222/hls-vod/audio-only­aac/sample1_1000kbps.f4v.m3u8
audio-only stream will be extracted from the A/V stream.
the file/segment will be segmented as TS.

Publish an audio-only stream (HLS)

To publish an audio-only stream, enter the following in the Adobe Media Encoder Stream field:
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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”.
Parameter Description
adbe-audio-stream-name The name of the audio-only stream.
12
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
adbe-audio-stream-name parameter was specified.
the
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 8.
Note: It is highly recommended to use the "Audio-only packaging" as mentioned in previous section rather than publishing audio-only streams.

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:
Client Single stream or
Adaptive Bitrate
Adobe HDS Single stream http://<ams-dns-or-ip>/hds-
Apple HLS Single stream http://<ams-dns-or-ip>/hls-
Adobe HDS Adaptive bitrate The media player requests a set-level manifest file:
Request URL
live/livepkgr/<instname>/<eventname>/<streamname>.f4m
live/livepkgr/<instname>/<eventname>/<streamname>.m3u8
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
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
13
Client Single stream or
Adaptive Bitrate
Apple HLS Adaptive bitrate The media player requests a set-level variant playlist file:
Request URL
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
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.
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 Flash Media Server 4.0 and 4.5” on page 54.

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.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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
HDSWindowDuration <= (DiskManagementDuration - SegmentDuration)
DiskManagementDuration:
For more information about disk managment, see “Disk management” on page 70.
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 86.

Configure a sliding window (HLS)

Configure a sliding window on the server
14
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:
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.
Use the following parameters:
Parameter Configuration file Description
HLSSlidingWindowLength httpd.conf The number of TS files available for seeking
SlidingWindowLength Application.xml and Event.xml The number of TS files available for seeking
HLSMediaFileDuration httpd.conf The length of a TS file, in milliseconds.
in a sliding window.
in a sliding window.
MediaFileDuration Application.xml and Event.xml The length of a TS file, in milliseconds.
The time within the sliding window is:
HLSSlidingWindowLength * HLSMediaFileDuration SlidingWindowLength * MediaFileDuration
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
By default, HLSSlidingWindowLength is set to 6 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 70.
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:
<Event>
<EventID>liveevent</EventID> <Recording>
<FragmentDuration>4000</FragmentDuration> <SegmentDuration>400000</SegmentDuration>
<DiskManagementDuration>3</DiskManagementDuration> </Recording> <HLS>
<MediaFileDuration>8000</MediaFileDuration>
<SlidingWindowLength>450</SlidingWindowLength> </HLS>
</Event>
15
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:
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
... <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.
16

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>
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media

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
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.
Installing the server.
17
Publish a live stream to Adobe Media Server
1 Connect a camera to the computer.
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,
Duplicate the live service” on page 18.
see
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 24.
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.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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:
rtmp://localhost/live/livestream
18
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 111
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
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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.
19

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.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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
b In Video Source, enter:
Adobe Flash Player.
http://localhost/hds-vod/sample2_1000kbps.f4v.f4m
20
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
<Location> directive in the Apache httpd.conf file. When a request URL begins with /hds-vod, the server
a looks for media in the /webroot/vod folder and packages it for HTTP Dynamic Streaming. For information about the request URL syntax, see
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
URLs for playing on-demand streams over HTTP” on page 23.
Flash Media Playback.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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
21
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 111
Supported file formats and codecs” on page 2
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
Content storage (HDS and HLS)” on page 56
Configure HTTP Dynamic Streaming and HTTP Live Streaming” on page 51
Stream on-demand media (RTMP)” on page 24

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.
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
22
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:
Stream URI Bitrate
sample1_150kbps.f4v.f4m 150
sample1_700kbps.f4v.f4m 700
sample1_1500kbps.f4v.f4m 1500
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.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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.
This tutorial uses the following Stream URI settings:
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
23
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:
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
24
Client Live or
Adobe HTTP Dynamic Streaming
Apple HTTP Live Streaming
Adobe HTTP Dynamic Streaming
Apple HTTP Live Streaming
VOD
VOD Single stream http://<ams-dns-or-ip>/hds-
VOD Single stream http://<ams-dns-or-ip>/hls-
VOD Adaptive bitrate The media player requests a set-level manifest file:
VOD Adaptive bitrate The media player requests a set-level variant playlist file:
Single stream or Adaptive Bitrate
Request URL
vod/<streamname>.<fileextension>.f4m
vod/<streamname>.<fileextension>.m3u8
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
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
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 56

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.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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/.
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.
25
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.
Last updated 9/4/2014
ADOBE MEDIA SERVER 5.0.6 DEVELOPER’S GUIDE
Getting started streaming media
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
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 111
Stream on-demand media (HTTP)” on page 19
26

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
server-domain-or-IP Yes The domain name or IP address of the computer hosting Adobe
ams-app-name Yes The Adobe Media Server application that the client connects to.
ams-app-instance-name No Applications can have an unlimited number of instances. For
codec-prefix Required for
F4V/MP4 and MP3 files
protocols Adobe Media Server supports, see
HTTP in the Technical Overview.
Media Server. If the client is on the same computer as Adobe Media Server, you can use localhost for testing purposes.
The default folder that holds Adobe Media Server applications is
rootinstall/applications. This tutorial uses the application rootinstall/applications/vod.
example, you could have clients connect to rtmp://localhost/vod/instance1, rtmp://localhost/vod/instance2, and so on.
The F4V/MP4 and MP3 file formats require a codec prefix in the request URL. For F4V/MP4 files, use the prefix use the prefix
mp3:. FLV files do not require a codec prefix.
RTMP, RTMFP, and
mp4:. For MP3 files,
Last updated 9/4/2014
Loading...
+ 308 hidden pages