Packager : Bug HLS manifest with alternate audio

XAVIER LAFFARGUE 51 Reputation points
2022-03-24T13:58:03.803+00:00

Hi,

I signal a descriptive audio tracks (https://learn.microsoft.com/en-us/azure/media-services/latest/signal-descriptive-audio-howto?tabs=net)

So I use this in my ism file :

<?xml version="1.0" encoding="utf-8"?>  
<smil xmlns="http://www.w3.org/2001/SMIL20/Language">  
  <head>  
    <meta name="formats" content="mp4" />  
  </head>  
  <body>  
    <switch>  
      <video src="filename_256.mp4" systemBitrate="256097" />  
      <video src="filename_400.mp4" systemBitrate="400137" />  
      <video src="filename_500.mp4" systemBitrate="500121" />  
      <video src="filename_800.mp4" systemBitrate="800242" />  
      <video src="filename_1200.mp4" systemBitrate="1200379" />  
      <video src="filename_2000.mp4" systemBitrate="1999913" />  
      <audio src="filename_1200.mp4" systemBitrate="128000" systemLanguage="fre">  
        <param name="trackName" value="audio1_fr" valuetype="data" />  
      </audio>  
      <audio src="filename_dv.mp4" systemBitrate="128000" systemLanguage="fre">  
        <param name="role" value="alternate" valuetype="data" />  
        <param name="accessibility" value="description" valuetype="data" />  
        <param name="trackName" value="audio0_frdv" valuetype="data" />  
      </audio>  
    </switch>  
  </body>  
</smil>  

The hls manifest generated is :

#EXTM3U  
#EXT-X-VERSION:7  
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="audio1_fr",LANGUAGE="fre",CHANNELS="2",URI="QualityLevels(128000)/Manifest(audio1_fr,format=m3u8-cmaf)"  
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="audio0_frdv",LANGUAGE="fre",DEFAULT=YES,AUTOSELECT=YES,CHARACTERISTICS="public.accessibility.describes-video",CHANNELS="2",URI="QualityLevels(128000)/Manifest(audio0_frdv,format=m3u8-cmaf)"  
#EXT-X-STREAM-INF:BANDWIDTH=408867,RESOLUTION=384x216,CODECS="avc1.42c01e,mp4a.40.2",AUDIO="audio"  
QualityLevels(256097)/Manifest(video,format=m3u8-cmaf)  
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=408867,RESOLUTION=384x216,CODECS="avc1.42c01e",URI="QualityLevels(256097)/Manifest(video,format=m3u8-cmaf,type=keyframes)"  
#EXT-X-STREAM-INF:BANDWIDTH=556076,RESOLUTION=480x270,CODECS="avc1.42c01e,mp4a.40.2",AUDIO="audio"  
QualityLevels(400137)/Manifest(video,format=m3u8-cmaf)  
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=556076,RESOLUTION=480x270,CODECS="avc1.42c01e",URI="QualityLevels(400137)/Manifest(video,format=m3u8-cmaf,type=keyframes)"  
#EXT-X-STREAM-INF:BANDWIDTH=658259,RESOLUTION=512x288,CODECS="avc1.42c01e,mp4a.40.2",AUDIO="audio"  
QualityLevels(500121)/Manifest(video,format=m3u8-cmaf)  
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=658259,RESOLUTION=512x288,CODECS="avc1.42c01e",URI="QualityLevels(500121)/Manifest(video,format=m3u8-cmaf,type=keyframes)"  
#EXT-X-STREAM-INF:BANDWIDTH=964983,RESOLUTION=640x360,CODECS="avc1.42c01e,mp4a.40.2",AUDIO="audio"  
QualityLevels(800242)/Manifest(video,format=m3u8-cmaf)  
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=964983,RESOLUTION=640x360,CODECS="avc1.42c01e",URI="QualityLevels(800242)/Manifest(video,format=m3u8-cmaf,type=keyframes)"  
#EXT-X-STREAM-INF:BANDWIDTH=1373923,RESOLUTION=852x480,CODECS="avc1.4d401f,mp4a.40.2",AUDIO="audio"  
QualityLevels(1200379)/Manifest(video,format=m3u8-cmaf)  
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=1373923,RESOLUTION=852x480,CODECS="avc1.4d401f",URI="QualityLevels(1200379)/Manifest(video,format=m3u8-cmaf,type=keyframes)"  
#EXT-X-STREAM-INF:BANDWIDTH=2191047,RESOLUTION=852x480,CODECS="avc1.4d401f,mp4a.40.2",AUDIO="audio"  
QualityLevels(1999913)/Manifest(video,format=m3u8-cmaf)  
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=2191047,RESOLUTION=852x480,CODECS="avc1.4d401f",URI="QualityLevels(1999913)/Manifest(video,format=m3u8-cmaf,type=keyframes)"  
#EXT-X-STREAM-INF:BANDWIDTH=138976,CODECS="mp4a.40.2",AUDIO="audio"  
QualityLevels(128000)/Manifest(audio0_frdv,format=m3u8-cmaf)  

Bug : The first audio track should have "DEFAULT" attribute with YES value !! Actually, the default attribute is only on the second audio track.
And I can't reverse audio track because iOS/MacOS hls native player play the first audio track if this one not contain "DEFAULT=NO"

Note HLS specification :
"9.17. Within a group of Renditions (EXT-X-MEDIA tags having the same TYPE and GROUP-ID), those tags having the same LANGUAGE value should be ordered from most general to most specific. (Because CHARACTERISTICS are open-ended, the matching algorithm needs the ordering since it can’t interpret all the semantics.)"

Please fix this issue or found a workarround :) thanks!

Community Center | Not monitored
{count} votes

1 answer

Sort by: Most helpful
  1. John Deutscher (MSFT) 2,126 Reputation points
    2022-03-24T18:40:39.94+00:00

    As a workaround, try to swap order of <audio/> entry in ism.

    For the Default issue, we are aware of this bug and are actually working on adding an API for controlling the late binding of audio tracks to Assets from 3rd party or external encoder sources. That new API is planned for our next 6-month semester. We can update this Q&A when it is ready for use in the SDKs.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.