• How to use alternative audio or video tracks with Apple HLS streams

    The Apple HLS protocol now 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:
    • Wowza Streaming Engine™ software is required.

    • 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.

    Contents


    Overview
    Prerequisites
    Live configuration
    VOD configuration

    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. With alternative video tracks, you can provide your users the option 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 that has multiple tracks, and then separate them into individual tracks. This article describes this method. It's also possible to ingest streams from separate encoders, as long as they are timecode-aligned.

    For on demand streams, separate audio and video files can be used, as long as they are timecode-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.

    Prerequisites


    Because these features require manual configuration, you should be comfortable with creating SMIL files using a text editor. The SMIL files that you create will be displayed in Wowza Streaming Engine Manager; however, you shouldn't use the manager to edit the files as that may break the SMIL file syntax.

    You should also know how to do the following:

    Live configuration


    The following steps outline what must be done to enable multiple alternative tracks. The example uses an imaginary MPEG-TS stream that has three audio tracks and two video tracks.

    Configure required properties in Wowza Streaming Engine Manager

    1. To packetize the tracks correctly, a separate packetizer must be configured for each track type (combined audio/video, audio-only, and video-only). In Wowza Streaming Engine Manager, click the Applications tab and then click the name of your application (such as live) in the contents panel.

      Note: You can't select which packetizers are created for each source so there will be up to 3 packetizers created for each one. The SMIL file determines which ones are used.
    2. On the live 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 live 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 then 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.

    7. Repeat the previous step to add the remaining custom property using the following values:
      Path
      Name
      Type
      Value
      Notes
      /Root/Application/LiveStreamPacketizer cupertinoCreateVideoOnlyRendition Boolean true Creates the video-only rendition. This is required for the video renditions to be created properly.
      Click Save to apply the changes.

    8. 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 make sure that the tracks are synchronized, set the audio-only packetizer to create transport stream chunks.

      On the live application page Properties tab, click Cupertino Streaming Packetizer in the Quick Links bar. Click Edit in the Cupertino Streaming Packetizer area, select the Enabled check box next to cupertinoPacketizeAllStreamsAsTS, and then set it to True.

    9. Click Save, and then restart the live application to apply the changes.

    10. Create separate .stream files files for each audio and video track in the source stream. Then create SMIL files to start and play the .stream files as a group. See Create .stream and SMIL files for startup and playback.

    Create .stream and SMIL files for startup and playback

    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. (If the source is a single MPEG-TS source, then you must enable port sharing.) Each .stream file must list an audio packet identifier (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. The separate .stream files should be started as a group so that they all start packetizing at the same time so 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 SMIL file above contains the three separate audio streams (English, German, and commentary) and the second video stream that has English audio and a different camera angle. This SMIL file is used to start the streams as a group, using either Stream Manager or 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. 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 and audioOnly parameter. Tells the server which packetizer to use.
      • cupertinoTag parameter. This is set to EXT-X-MEDIA and tells the server how to enter the information in the playlist.
      • cupertinoTag.GROUP-ID parameter. Should be the same for each audio source.
      • cupertinoTag.DEFAULT parameter. Indicates to the player which is the default audio stream.
      • cupertinoTag.AUTOSELECT parameter and system-language attribute. Tells the player to try and automatically determine which language to use (the commentary track is not set to auto select).
      • title attributes. Used by the player to display information about each track and are also used in the media URLs to make them unique.


      The video track must have the following information:
      • video-bitrate attribute and videoOnly parameter. Tells the server which packetizer to use.
      • cupertinoTag.AUDIO parameter. Set to the same value as the cupertinoTag.GROUP-ID from the audio tracks. This 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 audio codec id 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: this is different than 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

    Transcoding

    You can also provide adaptive bitrate renditions with alternative audio or video tracks by using Wowza 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 (such as vod) 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 the server 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 if 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="FALSE" 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="FALSE" 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>

    Originally Published: 06-19-2014.
    Updated: For Wowza Streaming Engine on 08-24-2015.

    If you're having problems or want to discuss this article, post in our forum.