Search code examples
iosaudiovideohttp-live-streaming

HLS Streaming: Multiple Audio Alternatives in Video Stream


I have a problem with a certain HLS streaming setup. So far, my setup is that I'm using a video rendition of the stream which contains all the different audio alternatives as stream in the name .mp4. According to the specs, this should be possible by setting up my HLS master manifest like so:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO

#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",CODECS="mp4a.40.5",LANGUAGE="deu",NAME="Deutsch",DEFAULT=YES,AUTOSELECT=YES
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",CODECS="mp4a.40.5",LANGUAGE="spa",NAME="Español",DEFAULT=NO
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",CODECS="mp4a.40.5",LANGUAGE="eng",NAME="English",DEFAULT=NO

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1391346,RESOLUTION=1022x574,CODECS="avc1.4d001f,mp4a.40.5",AUDIO="aac"
0009_orig/manifest.m3u8

However, testing this on an iPad, the video player offered me the different languages, but after choosing them, the player did not actually switch the language.

My guess is that the player is not able to actually find the corresponding track in the original stream. Is this even possible? Can I set this information in the manifest?


Solution

  • UPDATE: The answer below applies to the version 3 of the protocol. The IETF draft you linked is for version 7. If the device supports version 7 you may be able to use a muxed media file although I haven't tried it yet. Use #EXT-X-VERSION:7 instead.

    According to developer.apple.com:

    Alternate Audio and Video Renditions

    The audio tracks contain unmuxed (signals have not been combined) audio segments. The master playlist file controls the playback.

    I take it this means you have to provide the URI for a single audio stream:

    #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac",NAME="Deutsch", \
          DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="de", \
          URI="main/german-audio.m3u8"