question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HLS muxed audio missing format label

See original GitHub issue

We have the following HLS (live) master playlist:

#EXTM3U
#EXT-X-VERSION:6
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-STREAM-INF:BANDWIDTH=130780,CODECS="mp4a.40.2",AUDIO="aac-primary"
../../<path>/chunklist_ao.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=130780,CODECS="mp4a.40.2",AUDIO="aac-backup"
../../<path>/chunklist_ao.m3u8
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac-primary",NAME="Home",LANGUAGE="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac-backup",NAME="Home",LANGUAGE="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac-primary",NAME="Away",LANGUAGE="eng",URI="../../<path>/chunklist_ao.m3u8",DEFAULT=NO,AUTOSELECT=YES,CHANNELS="2"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="aac-backup",NAME="Away",LANGUAGE="eng",URI="../../<path>/chunklist_ao.m3u8",DEFAULT=NO,AUTOSELECT=YES,CHANNELS="2"

Based on the HlsPlaylistParser (line 514), if an audio track has no URI defined, then it will be stored in the muxedAudioFormat. However in this case, whenever we query the audio tracks, the muxed one has no id/label in the Format.

See the event logger’s output:

MediaCodecAudioRenderer [
  Group:0, adaptive_supported=YES_NOT_SEAMLESS [
    [ ] Track:0, id=0, mimeType=audio/mp4a-latm, bitrate=130909, codecs=mp4a.40.2, channels=2, sample_rate=48000, supported=YES
    [ ] Track:1, id=1, mimeType=audio/mp4a-latm, bitrate=130909, codecs=mp4a.40.2, channels=2, sample_rate=48000, supported=YES
  ]
  Group:1, adaptive_supported=YES_NOT_SEAMLESS [
    [X] Track:0, id=aac-primary:Away, mimeType=audio/mp4a-latm, codecs=mp4a.40.2, channels=2, sample_rate=48000, language=en, label=Away, supported=YES
    [ ] Track:1, id=aac-backup:Away, mimeType=audio/mp4a-latm, codecs=mp4a.40.2, channels=2, sample_rate=48000, language=en, label=Away, supported=YES
  ]

This is causing a problem for us, as we would need to select the tracks based on the labels. The question is whether the missing labels of muxed audio tracks is intentional or if it’s a bug? How could we workaround this issue on our side (without changing the manifest itself)?

Thanks in advance.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
guoen21commented, Nov 8, 2021

I apply and test this commit locally, seems it also works for me, thanks very much!

Now we get two following muxed tracks, but the id is same, because we use one muxedAudioFormat, but from our master m3u8 it included two tracks which has no URI defined.

Group:0, adaptive_supported=YES_NOT_SEAMLESS [
  [X] Track:0, id=aac-backup:Home, mimeType=audio/mp4a-latm, bitrate=128206, codecs=mp4a.40.2, channels=2, sample_rate=48000, label=Home, supported=YES
  [X] Track:1, id=aac-backup:Home, mimeType=audio/mp4a-latm, bitrate=128206, codecs=mp4a.40.2, channels=2, sample_rate=48000, label=Home, supported=YES
]

expected

Group:0, adaptive_supported=YES_NOT_SEAMLESS [
  [X] Track:0, id=aac-primary:Home, mimeType=audio/mp4a-latm, bitrate=128206, codecs=mp4a.40.2, channels=2, sample_rate=48000, label=Home, supported=YES
  [X] Track:1, id=aac-backup:Home, mimeType=audio/mp4a-latm, bitrate=128206, codecs=mp4a.40.2, channels=2, sample_rate=48000, label=Home, supported=YES
]
0reactions
ojw28commented, Nov 19, 2021

In here the language attribute of muxedAudioFormat may be miss, because of the playlistFormat.sampleMimeType is null.

This is a good observation. We’ll take a look; thanks!

In my commit I enhance it to support multiple muxed audio tracks

There is a TODO about this here. If you’ve implemented it, please feel free to send us a pull request. If you’ve implemented it in a different way then that might also be interesting, or you could try and adapt your approach to match what’s written in the TODO.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP Live Streaming (HLS) Authoring Specification for Apple ...
Learn the requirements for live and on-demand audio and video content ... The container format for H.264 video MUST be fragmented MP4 (fMP4)...
Read more >
Using HLS inputs with AWS Elemental MediaConvert
Learn how to specify an HLS package as an input to AWS Elemental ... For example, given the following EXT-X-MEDIA tags, you can...
Read more >
No sound in HLS (.ts) generated by GStreamer (h264 + Opus ...
voaacenc ! aacparse \ ! mux. On the receiving side, I have tried many variations for the 2nd to last line (decoding Opus,...
Read more >
Transmuxing Guide - Brightcove Zencoder Documentation
Each of the H.264 video and the audio outputs above have labels in their ... "s3://example-bucket/hls-low/hls-low.m3u8", "label": "hls-low", ...
Read more >
draft-pantos-hls-rfc8216bis-12 - IETF Datatracker
Supported Packed Audio formats are Advanced Audio Coding (AAC) with Audio Data Transport Stream ... If it is missing, its value should be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found