15 April 2013
Basic knowledge of using the Adobe Media Server and know how to run a Flash based SWF client will help you make the most of this article.
Additional required other products
With late-binding audio support in Adobe Media Server you can include alternative audio tracks with a single HTTP video stream.
A simplistic way to implement multiple audio track support within a client player is by creating two streams (either streams sourced from on-demand video (VOD) media files or live streams) with identical video content, but in different languages. You could then fetch both video streams in the player and offer the ability to toggle between both audio options. This implementation, however, requires unnecessary production and fetching of duplicate video content for the second stream.
A more efficient means for delivery of multiple audio tracks with Adobe Media Server is available by using the
audio-only tag while fetching streams. Because only the audio content of secondary streams is sent, a significant amount of bandwidth can be saved by using this feature.
This article describes a step-by-step process for configuring and using late-binding audio support in Adobe Media Server for HTTP streaming. To use this feature all related streams must be time synchronized. For VOD content, you'll need to ensure that media files are played individually. I recommend that you individually test each stream's URI. Similarly, for live streaming content, you should test individual streams if they are played separately.
For HTTP Dynamic Streaming (HDS) of on-demand video, the HDS-VOD module is configured (via
HttpStreamingContentPath as per the Apache configuration) to get VOD media content from the
($AMS)/webroot/vod folder (assuming Adobe Media Server is installed in the
Consider a situation in which you want to publish a video with English audio content named video1.mp4. In addition, you also want to offer the same content in French and Spanish, using alternative media files named video1_french.mp4 and video1_spanish.mp4 respectively. These secondary media files can have both audio and video content or just audio content.
The goal is enable viewers to switch the audio from the default language (in this case English) to the alternative languages (French and Spanish). To accomplish this, the first step is to create a set-level manifest file (for example, video1_master.f4m). This manifest file must include the video and audio track information as per the OSMF player specification. Although you can create this file manually, I find it easier to generate the manifest with the Configurator tool supplied with Adobe Media Server 5. This tool (f4mconfig.html) is located in the path
($AMS)\tools\f4mconfig\configurator. The following steps can be used to create the video1_master.f4m manifest file.
The next step is to add video1_french.mp4 as an alternate media file.
Now you're ready to set up the Spanish stream using the same process.
<manifest xmlns="http://ns.adobe.com/f4m/2.0"> <baseURL>http://www.example.com/hds-vod/</baseURL> <media href="video1.mp4.f4m" bitrate="500"/> <media href="audio-only/video1_french.mp4.f4m" bitrate="50" type="audio" label="French" lang="fr" alternate="true"/> <media href="audio-only/video1_spanish.mp4.f4m" bitrate="50" type="audio" label="Spanish" lang="esp" alternate="true"/> </manifest>
For HDS streaming of live video, the HDS-LIVE module is configured (via
HttpStreamingLiveEventPath as per the Apache configuration) to get content from the
To understand how late-binding audio works with live streaming, consider a scenario in which stream1 is a video stream published via the Adobe Media Server livepkgr application. Additionally, the stream1_audio_french and stream1_audio_spanish audio streams are also published via livepkgr. All three streams are published over the same live event (stream1) by appending the query string parameter
adbe-live-event=stream1 when publishing.
Similar to the HDS-VOD scenario, you need to define a set-level manifest file that meets the late-binding audio requirements of OSMF. As before, you can create the manifest file manually or use the Adobe Media Server Configurator tool. Follow these steps to use the tool to create a manifest file named stream1_master.f4m:
Next, you need to add stream1_audio_french as an alternate stream.
Next add the Spanish audio stream.
The generated manifest file will look something like this:
<manifest xmlns="http://ns.adobe.com/f4m/2.0"> <baseURL>http://www.example.com/hds-live/livepkgr/_definst_/stream1/</baseURL> <media href="stream1.f4m" bitrate="500"/> <media href="stream1_audio_french.f4m" bitrate="50" type="audio" label="French" lang="fr" alternate="true"/> <media href="stream1_audio_spanish.f4m" bitrate="50" type="audio" label="Spanish" lang="esp" alternate="true"/> </manifest>
For HTTP Live Streaming (HLS) of on-demand video, the HLS-VOD module is configured via the
HttpStreamingContentPath parameter (as per the Apache configuration) to fetch VOD media content from the
Consider the same scenario used in the HDS-VOD example using video1.mp4, video1_french.mp4, and video1_spanish.mp4 media files.
The first step is to create a variant playlist file, with information required by the M3U8 specification. The AMS Configurator tool can be used for creating such a playlist too.
Note: After adding a media file, you can optionally enable DRM. If it is enabled, a variant playlist file will be generated according to its activation.
#EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=500000,AUDIO="video1" http://www.example.com/hls-vod/video1.mp4.m3u8 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="video1", NAME="English", DEFAULT=YES, AUTOSELECT=YES, LANGUAGE="en", URI="http://www.example.com/hls-vod/audio-only/video1.mp4.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="video1", NAME="French", DEFAULT=NO, AUTOSELECT=NO, LANGUAGE="fr", URI="http://www.example.com/hls-vod/audio-only/video1_french.mp4.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="video1", NAME="Spanish", DEFAULT=NO, AUTOSELECT=NO, LANGUAGE="esp", URI="http://www.example.com/hls-vod/audio-only/video1_spanish.mp4.m3u8"
For HTTP Live Streaming (HLS) of live video, the HLS-LIVE module is configured via the
HttpStreamingLiveEventPath parameters, as per the Apache configuration, to get content from the
Under the same scenario as the HDS-LIVE example, you can make a variant M3U8 playlist file (in this case named stream1_master.m3u8) with the Configurator tool.
http://www.example.com/hls-live/audio-only/livepkgr/_definst_/stream1/stream1_audio_french.mp4.m3u8 http://www.example.com/hls-live/audio-only/livepkgr/_definst_/stream1/stream1_audio _spanish.mp4.m3u8
The generated M3U8 file looks like the following:
#EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=500000,AUDIO="stream1" http://www.example.com/hls-live/livepkgr/_definst_/stream1/stream1.m3u8 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="stream1", NAME="English", DEFAULT=YES, AUTOSELECT=YES, LANGUAGE="en", URI=" http://www.example.com/hls-live/livepkgr/_definst_/stream1/stream1.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="stream1", NAME="French", DEFAULT=NO, AUTOSELECT=NO, LANGUAGE="fr", URI=" http://www.example.com/hls-live/audio-only/livepkgr/_definst_/stream1/stream1_audio_french.mp4.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="stream1", NAME="Spanish", DEFAULT=NO, AUTOSELECT=NO, LANGUAGE="esp", URI=" http://www.example.com/hls-live/audio-only/livepkgr/_definst_/stream1/stream1_audio_spanish.mp4.m3u8"
For more details on configuring alternate audio in Adobe Media Server for HDS-VOD, see Configuring alternate audio in the Adobe Media Server Developer's Guide.
For HDS, an OSMF player can be used. OSMF detects the presence of alternate audio tracks from the F4M manifest. If an alternate audio track is selected, OSMF obtains the fragments for that track, and replaces the audio packets from the main video stream with the selected alternate. OSMF applies (multiplexes) the selected alternate track before passing the video stream to your player. To download a sample OSMF player, visit the SourceForge OSMF page.
If you are interested in building your own OSMF based player, see Supporting alternate audio tracks in HTTP Streaming videos in the Open Source Media Framework Developer's Guide.
For more information on IOS delivery, see the Apple Streaming Media Guide on HLS playback.
Lastly, for examples of M3U8 formatting for HLS, see the HTTP Live Streaming draft.
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.
Tutorials & Samples