Use alternative audio or video tracks with Apple HLS streams in Wowza Streaming Engine

The Apple HLS protocol supports alternative audio and video tracks in a stream, so you can select a different audio source or camera view. This article describes how to use custom SMIL files in Wowza Streaming Engine™ media server software to enable these features in streams that have alternative tracks available.

Notes:
  • Not all Apple HLS players support alternative tracks, and some players may support alternative audio tracks but not alternative video tracks.
     
  • Alternative audio and video tracks require advanced configuration for each stream. It's not currently possible to do the full configuration in Wowza Streaming Engine Manager.

Overview


With alternative audio tracks, you can provide your users the option to listen to the stream in a different language or to select a different commentary. On the other hand, alternative video tracks can give your users the ability to select different camera angles. Examples might be a video broadcast with multiple languages or a sports event with multiple video feeds. Wowza Streaming Engine uses a SMIL file with extra HLS-specific tags in the HLS playlist to enable these features.

For everything to be synchronized, the alternative tracks must be timecode-aligned. This means that they must come from the same encoder or from separate encoders that produce aligned streams.

For live streams, Wowza Streaming Engine can ingest a single MPEG-TS stream with multiple tracks and then separate them into individual tracks. This article describes this method. It's also possible to ingest streams from separate encoders if their timecodes are aligned.

For on-demand streams, separate audio and video files can be used as long as their timecodes are aligned. It's also possible to use a single file with all of the tracks in the file. However, you must use extra modules to separate out the tracks.

Before you start


You should be familiar with the following concepts:

Live configuration


The following steps outline enabling multiple alternative tracks using a UDP or SRT protocol. The UDP example uses an imaginary MPEG-TS stream that has three audio tracks and two video tracks.

Configure required properties in Wowza Streaming Engine Manager

To packetize the tracks correctly, a separate packetizer must be configured for each track type (combined audio/video, audio only, and video only). This section applies to configuring properties for both UDP and SRT workflows.

  1. In Wowza Streaming Engine Manager, click the Applications tab and then click the name of your application in the contents panel.
     
    Note: You can't select which packetizers are created for each source so there will be up to three packetizers created for each one. The SMIL file determines which ones are used.
  2. On the application page Properties tab, click Cupertino Streaming Packetizer in the Quick Links bar.
     
    Note: Access to the Properties tab is limited to administrators with advanced permissions. For more information, see Manage credentials.
  3. Click Edit in the Cupertino Streaming Packetizer area, select the Enabled check box next to cupertinoCreateAudioOnlyRendition, and then set it to True. This creates the audio-only rendition and is required for the audio renditions to be created properly. Click Save to apply the changes.
     
  4. On the application page Properties tab, click Custom in the Quick Links bar.
     
  5. In the Custom area, click Edit.
     
  6. Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and click Add.
     
    • Path - Select /Root/Application/LiveStreamPacketizer.
       
    • Name - Enter cupertinoCreateAudioVideoRendition.
       
    • Type - Select Boolean.
       
    • Value - Enter true.

This creates the combined audio/video rendition. This is the default type that's created. It should be set to true to support players that don't support alternative tracks.

  1. Repeat the previous step to add the remaining custom property using the following values, then click Save to apply the changes.

    • Path - Select /Root/Application/LiveStreamPacketizer.
       
    • Name - Enter cupertinoCreateVideoOnlyRendition.
    • Type - Select Boolean.
       
    • Value - Enter true.
       

This creates the video-only rendition and is required for the video renditions to be created properly.

By default, the audio-only packetizer creates elementary stream chunks, and the video-only packetizer creates transport stream chunks. When these track types are played separately (as an alternative low-bitrate option), synchronization isn't an issue. However, synchronization problems can occur when they're played together. To ensure the tracks are synchronized, set the audio-only packetizer to create transport stream chunks.

  1. On the live application page Properties tab, click Cupertino Streaming Packetizer in the Quick Links bar.
     
  2. Click Edit in the Cupertino Streaming Packetizer area, select the Enabled check box next to cupertinoPacketizeAllStreamsAsTS, and set it to True.
  3. Click Save, and then restart the application to apply the changes.
  4. In the Application.xml file, the properties should appear like so:
<LiveStreamPacketizer>
  <!-- Properties defined here will override any properties 
  defined in conf/LiveStreamPacketizers.xml for any LiveStreamPacketizers 
  loaded by this applications -->
  <Properties>
    <Property>
      <Name>cupertinoCreateAudioOnlyRendition</Name>
      <Value>true</Value>
      <Type>Boolean</Type>
    </Property>
    <Property>
      <Name>cupertinoCreateAudioVideoRendition</Name>
      <Value>true</Value>
      <Type>Boolean</Type>
    </Property>
    <Property>
      <Name>cupertinoCreateVideoOnlyRendition</Name>
      <Value>true</Value>
      <Type>Boolean</Type>
    </Property>
    <Property>
      <Name>cupertinoPacketizeAllStreamsAsTS</Name>
      <Value>true</Value>
      <Type>Boolean</Type>
    </Property>
  </Properties>
</LiveStreamPacketizer>

Create .stream and SMIL files for startup and playback

This section guides you through creating .stream and SMIL files for startup and playback. You can switch between the UDP and SRT tabs to see different steps for each workflow.

UDP workflow

After the packetizers are configured for each track type, you must create separate .stream files for each audio and video track in the source stream, and SMIL files to start and play the .stream files as a group.

  1. Create a separate .stream file for each audio and video track in the source stream. This step helps you to configure the incoming encoder by telling it which packet identifiers (PIDs) or tracks to pull. If the source is a single MPEG-TS source, you must enable port sharing. Each .stream file must list an audio PID and video PID for the rendition. If a PID isn't listed, then the first one of each type is used. To reduce the number of packetizers created, you can create separate audio-only and video-only renditions. To create either an audio-only or video-only rendition, set the other PID to a non-existent value (1 or 0).

    main.stream - English and main video
    {
      uri : "udp://0.0.0.0:10004",
      mpegtsVideoPID : "0x104",
      mpegtsAudioPID : "0xfc"
    
    }

    de.stream - German and main video
    {
      uri : "udp://0.0.0.0:10004",
      mpegtsVideoPID : "0x104",
      mpegtsAudioPID : "0xfd"
    
    }

    commentary.stream - Commentary and main video
    {
      uri : "udp://0.0.0.0:10004",
      mpegtsVideoPID : "0x104",
      mpegtsAudioPID : "0xfe"
    
    }

    video2.stream - English and second video
    {
      uri : "udp://0.0.0.0:10004",
      mpegtsVideoPID : "0x105",
      mpegtsAudioPID : "0xfc"
    
    }
     
    Note: If the video encoding isn't already H.264 or the audio encoding isn't already either AAC or MP3, then they must be transcoded to use these codecs before they can be used. See Transcoding below for more information.
  2. Start the separate .stream files as a group so that they all start packetizing at the same time. To do this, create a SMIL file (startup.smil) to start the streams.

    startup.smil
    <smil>
        <head>
        </head>
        <body>
        <switch>
        	<video src="mp4:main.stream" system-bitrate="2380678">
            </video>
            <video src="mp4:de.stream" system-bitrate="2380678">
            </video>
            <video src="mp4:commentary.stream" system-bitrate="2380678">
            </video>
            <video src="mp4:video2.stream" system-bitrate="2380678">
            </video>
        </switch>
        </body>
    </smil>

    The preceding SMIL file contains three separate audio streams (English, German, and commentary), and the second video stream with English audio and a different camera angle. This SMIL file is used to start the streams as a group using the Startup Streams feature in Wowza Streaming Engine. It also allows them to be reset as a group if there's a problem. It shouldn't be used to play the streams.
     
  3. Add the startup.smil file to the Startup Streams list according to Start streams when Wowza Streaming Engine starts.
  4. Create the SMIL file to play the streams. This SMIL file has a lot more information than the SMIL file that's used to start the streams. In the following examples, the parameters in the SMIL file that start with cupertinoTag are used to enable the specific parts of the HLS playlist. 

The following example has the three audio tracks and the main video track.

alternative-audio.smil

<smil>
<head>
</head>
<body>
<switch>
	<video src="mp4:main.stream" system-language="en" title="English" audio-bitrate="105768">
		<param name="audioOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="aac" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="YES" valuetype="data"/>
		<param name="cupertinoTag.AUTOSELECT" value="YES" valuetype="data"/>
	</video>
	<video src="mp4:de.stream" system-language="de" title="Deutsch" audio-bitrate="105768">
		<param name="audioOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="aac" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="NO" valuetype="data"/>
		<param name="cupertinoTag.AUTOSELECT" value="YES" valuetype="data"/>
	</video>
	<video src="mp4:commentary.stream" system-language="en" title="Commentary" audio-bitrate="105768">
		<param name="audioOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="aac" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="NO" valuetype="data"/>
		<param name="cupertinoTag.AUTOSELECT" value="NO" valuetype="data"/>
	</video>
	<video src="mp4:main.stream" system-language="en" title="Main" video-bitrate="2274910" width="768" height="432">
		<param name="videoCodecId" value="avc1.66.30" valuetype="data"/>
		<param name="videoOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag.AUDIO" value="aac" valuetype="data"/>
		<param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
	</video>
</switch>
</body>
</smil>

Each audio track must have the following information:

  • audio-bitrate attribute – Defines the audio bitrate to report in the master playlist.
  • audioOnly parameter – Tells Wowza Streaming Engine to list audio as having a separate media playlist from the video media playlist (if any).
  • cupertinoTag parameter – This is set to EXT-X-MEDIA and tells Wowza Streaming Engine how to enter the information in the playlist.
  • cupertinoTag.GROUP-ID parameter – Defines the group ID of the audio entry. For a video entry to be paired with this audio entry, the value of the video entry's cupertinoTag.AUDIO parameter must match this value.
  • cupertinoTag.DEFAULT parameter – Indicates to the player which is the default audio stream.
  • cupertinoTag.AUTOSELECT parameter and system-language attribute – Tell the player to try and automatically determine which language to use (the commentary track is not set to auto select).
  • title attribute – Used by the player to display information about each track and are also used in the media URLs to make them unique. Required if there are multiple audio tracks.

The video track must have the following information:

  • video-bitrate attribute – Defines the video bitrate to report in the master playlist.
  • videoOnly parameter – Tells Wowza Streaming Engine to list video as having a separate media playlist from the audio media playlist (if any)
  • cupertinoTag.AUDIO parameter – When set to the same value as the cupertinoTag.GROUP-ID of an audio entry, specifies that the video entry can be paired with that audio entry. This parameter can be used to differentiate separate audio groups if needed.
  • The video track tag provides the information for the EXT-X-STREAM-INF section in the playlist so the audioCodecId paramter should be included in the video track tag instead of on the audio track tags.

When inspecting the generated playlist, it should look like the following:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",LANGUAGE="en",NAME="English",DEFAULT=YES,AUTOSELECT=YES,URI="chunklist_w589005980_b105768_ao_slen_t64RW5nbGlzaA==.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",LANGUAGE="de",NAME="Deutsch",DEFAULT=NO,AUTOSELECT=YES,URI="chunklist_w589005980_b105768_ao_slde_t64RGV1dHNjaA==.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",LANGUAGE="en",NAME="Commentary",DEFAULT=NO,AUTOSELECT=NO,URI="chunklist_w589005980_b105768_ao_slen_t64Q29tbWVudGFyeQ==.m3u8"
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2274910,NAME="Main",CODECS="avc1.66.30,mp4a.40.2",RESOLUTION=768x432,AUDIO="aac"

chunklist_w589005980_b2274910_vo_slen_t64TWFpbg==.m3u8

The following example has one audio track and multiple video tracks that are available as alternative camera angles. Note that alternative camera angles are different from alternative bitrate renditions.

alternative-video.smil

<smil>
<head>
</head>
<body>
<switch>
	<video src="mp4:main.stream" title="Main" system-bitrate="2380678">
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.TYPE" value="VIDEO" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="video" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="YES" valuetype="data"/>
	</video>
	<video src="mp4:video2.stream" title="Camera 2" system-bitrate="2380678">
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.TYPE" value="VIDEO" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="video" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="NO" valuetype="data"/>
	</video>
	<video src="mp4:main.stream" title="Main" system-bitrate="2380678" width="768" height="432">
		<param name="videoCodecId" value="avc1.66.30" valuetype="data"/>
		<param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
		<param name="cupertinoTag.VIDEO" value="video" valuetype="data"/>
	</video>
</switch>
</body>
</smil>

The first two <video> tags describe each of the available video tracks and their title values should be unique. The third <video> tag tells the player which video track to start with (the default track). The title and system-bitrate values in this tag should match the one that is marked as default.

When inspecting the generated playlist, it should look like the following:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="video",NAME="Main",DEFAULT=YES,URI="chunklist_w1047104184_b2380678_t64TWFpbg==.m3u8"
#EXT-X-MEDIA:TYPE=VIDEO,GROUP-ID="video",NAME="Camera 2",DEFAULT=NO,URI="chunklist_w1047104184_b2380678_t64Q2FtZXJhIDI=.m3u8"
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2380678,NAME="Main",CODECS="avc1.66.30, mp4a.40.2",RESOLUTION=768x432,VIDEO="video"

chunklist_w1047104184_b2380678_t64TWFpbg==.m3u8

SRT workflow

After the packetizers are configured for each track type, the SRT workflow requires that you only create one .stream file for each audio and video track in the source stream. In comparison, the UDP workflow demands separate .stream files for this purpose. As with the UDP workflow, you must also create a SMIL file to start and play back the .stream file.

Create the MPEG-TS filters

For your SRT solution, use these directions to first add multiple MPEG-TS filters in Wowza Streaming Engine Manager.

  1. In Wowza Streaming Engine Manager, click the Applications tab.
  2. Select the name of your application in the contents panel.
  3. From the contents panel, click Stream Files.
  4. Create or open an SRT file, and go to the Properties tab. For help creating an SRT file, see Ingest and publish an SRT stream with Wowza Streaming Engine.
  5. Click Edit to configure MPEG-TS filter properties for your SRT workflow.
  1. Click the Add new filter button.
  2. In the modal, enter the Name, Program ID, Audio PID, and Video PID values. Click Add to save each filter.
  • Name is a required field. It's used as part of the stream name for the generated incoming stream. We validate this property is unique.
  • Program ID, Audio PID, and Video PID specify the identifiers to filter. You must enter at least one of these fields. If you don't enter some of these values, the first value that appears in the incoming MPEG-TS file is used as the default. The possible values are blank, decimal, or hexadecimal.
  1. When you've added all MPEG-TS filters, click Save. The stream file and its MPEG-TS properties are displayed in a table.

To check your mySRT.stream file, go to the [install-dir]/applications/[application-name]/content folder. It should look similar to the following snippet. Note that the filter name must match the key in the mpegTSFilters map. In our example, the main filter contains a channel for English audio, while main1 contains French audio.

{
  uri : "srt://0.0.0.0:10000",
  mpegTSFilters : {
    main : {
      name : "main",
      mpegtsProgramID : "1",
      mpegtsVideoPID : "283",
      mpegtsAudioPID : "0x101"
    },
    main1 : {
      name : "main1",
      mpegtsProgramID : "1",
      mpegtsVideoPID : "283",
      mpegtsAudioPID : "0x102"
    }
  }
}

Connect the stream

After you've created your MPEG-TS filters, use these steps to connect your stream in Wowza Streaming Engine.

  1. From the contents panel of your application, click Stream Files.
  2. In the Actions column, click the Connect Stream icon.

  1. In the Connect a Stream File modal, select srt from the MediaCaster Type dropdown.

  1. Send your MPEG-TS file with multiple audio PIDs, video PIDs, and program IDs to Wowza Streaming Engine.
  2. From the contents panel of your application, click Incoming Streams, where you can see the newly filtered SRT MPEG-TS streams.

Create the SMIL file

Ensure you've configured the required properties in Wowza Streaming Engine. Then, after connecting your stream as described in the previous section, create the SMIL file to allow playback using your SRT MPEG-TS filters.

You can create your SMIL file with Wowza Streaming Engine Manager or using a text editor. We use the second approach here, creating a SMIL file named alternative-audio.smil to support one main video track and two alternative audio tracks (English and French). The parameters in the SMIL file that start with cupertinoTag are used to enable the specific parts of the HLS playlist.

In your text editor, create a SMIL file named alternative-audio.smil in the [install-dir]/content folder with the following content:

<smil title="smil">
<head>
</head>
  <body>
    <switch>
      <video src="mp4:StreamFilter-main-mySRT.stream" systemLanguage="en" video-bitrate="2274910" width="768" height="432">
        <param name="videoBitrate" value="105768" valuetype="data"></param>
        <param name="videoCodecId" value="avc1.66.30" valuetype="data"></param>
      </video>
      <audio src="mp4:StreamFilter-main-mySRT.stream" system-language="en" title="English" audio-bitrate="105768">
        <param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
        <param name="cupertinoTag.GROUP-ID" value="aac" valuetype="data"/>
        <param name="cupertinoTag.DEFAULT" value="YES" valuetype="data"/>
        <param name="cupertinoTag.AUTOSELECT" value="YES" valuetype="data"/>
      </audio>
      <audio src="mp4:StreamFilter-main1-mySRT.stream" system-language="fr" title="French" audio-bitrate="105768">
        <param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
        <param name="cupertinoTag.GROUP-ID" value="aac" valuetype="data"/>
        <param name="cupertinoTag.DEFAULT" value="NO" valuetype="data"/>
        <param name="cupertinoTag.AUTOSELECT" value="NO" valuetype="data"/>
      </audio>
    </switch>
  </body>
</smil>

After you create the SMIL file, you can test your playback and switch between the two audio tracks.

Transcoding

You can also provide adaptive bitrate renditions with alternative audio or video tracks by using Transcoder to transcode the tracks. Each track that requires transcoding only needs to be transcoded once, and then you can combine these with the original tracks.

alternative-audio-abr.smil

<smil>
<head>
</head>
<body>
<switch>
	<video src="mp4:main.stream" system-language="en" title="English" audio-bitrate="105768">
		<param name="audioOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="aac" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="YES" valuetype="data"/>
		<param name="cupertinoTag.AUTOSELECT" value="YES" valuetype="data"/>
	</video>
	<video src="mp4:de.stream" system-language="de" title="Deutsch" audio-bitrate="105768">
		<param name="audioOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="aac" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="NO" valuetype="data"/>
		<param name="cupertinoTag.AUTOSELECT" value="YES" valuetype="data"/>
	</video>
	<video src="mp4:commentary.stream" system-language="en" title="Commentary" audio-bitrate="105768">
		<param name="audioOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="aac" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="NO" valuetype="data"/>
		<param name="cupertinoTag.AUTOSELECT" value="NO" valuetype="data"/>
	</video>
	<video src="mp4:main.stream" system-language="en" title="Main" video-bitrate="2274910" width="768" height="432">
		<param name="videoCodecId" value="avc1.66.30" valuetype="data"/>
		<param name="videoOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag.AUDIO" value="aac" valuetype="data"/>
		<param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
	</video>
	<video src="mp4:main.stream_360p" system-language="en" title="Main" video-bitrate="1800000" width="640" height="360">
		<param name="videoCodecId" value="avc1.66.30" valuetype="data"/>
		<param name="videoOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag.AUDIO" value="aac" valuetype="data"/>
		<param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
	</video>
	<video src="mp4:main.stream_240p" system-language="en" title="Main" video-bitrate="800000" width="320" height="240">
		<param name="videoCodecId" value="avc1.66.30" valuetype="data"/>
		<param name="videoOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag.AUDIO" value="aac" valuetype="data"/>
		<param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
	</video>
	<video src="mp4:main.stream" system-language="en" title="Audio" audio-bitrate="105768">
		<param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
		<param name="audioOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag.AUDIO" value="aac" valuetype="data"/>
	</video>
</switch>
</body>
</smil>

This SMIL has two extra video tracks added (main.stream_360p and main.stream_240p). They are set to video-only and use the same audio group as the original track. There's also an extra audio-only track that provides a low bitrate audio-only stream. This is set to also use the alternative audio tracks so the user can select an alternative.

alternative-video-abr.smil

<smil>
<head>
</head>
<body>
<switch>
	<video src="mp4:main.stream" title="Main" system-bitrate="2380678">
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.TYPE" value="VIDEO" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="hi" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="YES" valuetype="data"/>
	</video>
	<video src="mp4:video2.stream" title="Camera 2" system-bitrate="2380678">
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.TYPE" value="VIDEO" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="hi" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="NO" valuetype="data"/>
	</video>
	<video src="mp4:main.stream" title="Main" system-bitrate="2380678" width="768" height="432">
		<param name="videoCodecId" value="avc1.66.30" valuetype="data"/>
		<param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
		<param name="cupertinoTag.VIDEO" value="hi" valuetype="data"/>
	</video>
	<video src="mp4:main.stream_360p" title="Main" system-bitrate="1905768">
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.TYPE" value="VIDEO" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="mid" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="YES" valuetype="data"/>
	</video>
	<video src="mp4:video2.stream_360p" title="Camera 2" system-bitrate="1905768">
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.TYPE" value="VIDEO" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="mid" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="NO" valuetype="data"/>
	</video>
	<video src="mp4:main.stream_360p" title="Main" system-bitrate="1905768" width="640" height="360">
		<param name="videoCodecId" value="avc1.66.30" valuetype="data"/>
		<param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
		<param name="cupertinoTag.VIDEO" value="mid" valuetype="data"/>
	</video>
	<video src="mp4:main.stream_240p" title="Main" system-bitrate="905768">
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.TYPE" value="VIDEO" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="low" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="YES" valuetype="data"/>
	</video>
	<video src="mp4:video2.stream_240p" title="Camera 2" system-bitrate="905768">
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.TYPE" value="VIDEO" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="low" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="NO" valuetype="data"/>
	</video>
	<video src="mp4:main_240p.stream" title="Main" system-bitrate="905768" width="320" height="240">
		<param name="videoCodecId" value="avc1.66.30" valuetype="data"/>
		<param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
		<param name="cupertinoTag.VIDEO" value="low" valuetype="data"/>
	</video>
</switch>
</body>
</smil>

This SMIL file uses three separate GROUP-IDs to provide separate adaptive bitrate renditions of both camera views.

VOD configuration


For on-demand streams, the tracks can be in separate files with a single track of each type in each file or in a single file with multiple audio or video tracks. For the multiple tracks to synchronize properly, configure the cupertinoAddTSOffset property for your VOD application.
 
  1. In Wowza Streaming Engine Manager, click the Applications tab and then click the name of your on demand application in the contents panel.
     
  2. On the application page Properties tab, click Custom in the Quick Links bar.
     
    Note: Access to the Properties tab is limited to administrators with advanced permissions. For more information, see Manage credentials.
  3. In the Custom area, click Edit.
     
  4. Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and then click Add.
     
    • Path - Select /Root/Application/HTTPStreamer.
       
    • Name - Enter cupertinoAddTSOffset.
       
    • Type - Select Boolean.
       
    • Value - Enter false.
  5. Click Save to apply the changes.
The default value (true) means Wowza Streaming Engine adds an offset to the transport stream chunks that will cause synchronization issues with the audio tracks. Setting the value to false disables this offset.

Create SMIL files for playback

To enable multiple alternative tracks for VOD, create a playback SMIL file (this is very similar to the live example above). Use one of the following methods, depending on whether you have multiple files or a single file.

Multiple tracks in separate files

This example uses an imaginary set of files, a single video-only file and two separate audio-only files. All of the files must be timecode-aligned.


multi-file-alternative-audio.smil

<smil>
<head>
</head>
<body>
<switch>
	<video src="mp4:audio_eng.mp4" system-language="en" title="English" audio-bitrate="128000">
		<param name="audioOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="aac" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="YES" valuetype="data"/>
	</video>
	<video src="mp4:audio_de.mp4" system-language="de" title="Deutsch" audio-bitrate="128000">
		<param name="audioOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="aac" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="NO" valuetype="data"/>
	</video>
	<video src="mp4:video.mp4" width="656" height="274" video-bitrate="800000">
		<param name="videoCodecId" value="avc1.66.30" valuetype="data"/>
		<param name="videoOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag.AUDIO" value="aac" valuetype="data"/>
		<param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
	</video>
</switch>
</body>
</smil>

Multiple tracks in single file

This example uses an imaginary file that has a single video track and two separate audio tracks. Each audio track is defined using the audioindex query parameter. Mutiple video tracks can be defined by using the videoindex query parameter. Each track is indexed in the order that they appear in the VOD file starting from 0 for the first track of each type, 1 for the next, and so on.
 
Note: You must enable the ModuleMultiTrackVOD module so that the tracks are selected properly. This module is available as part of the Wowza Module Collection.
single-file-alternative-audio.smil
<smil>
<head>
</head>
<body>
<switch>
	<video src="mp4:myVideo.mp4?audioindex=0" system-language="en" title="English" audio-bitrate="128000">
		<param name="audioOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="aac" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="YES" valuetype="data"/>
	</video>
	<video src="mp4:myVideo.mp4?audioindex=1" system-language="de" title="Deutsch" audio-bitrate="128000">
		<param name="audioOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag" value="EXT-X-MEDIA" valuetype="data"/>
		<param name="cupertinoTag.GROUP-ID" value="aac" valuetype="data"/>
		<param name="cupertinoTag.DEFAULT" value="NO" valuetype="data"/>
	</video>
	<video src="mp4:myVideo.mp4" width="656" height="274" video-bitrate="800000">
		<param name="videoCodecId" value="avc1.66.30" valuetype="data"/>
		<param name="videoOnly" value="TRUE" valuetype="data"/>
		<param name="cupertinoTag.AUDIO" value="aac" valuetype="data"/>
		<param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
	</video>
</switch>
</body>
</smil>