New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Playback is disrupted when an audio stream uses multiple container formats #2887
Comments
A single rendition should not change audio codecs. Google DAI should match the codec of the playlist it appends to. |
AAC-LC is used throughout the audio playlist. The only change is that the AAC is packaged within an MPEG Transport Stream during the second segment (between the first and second discontinuities) but it's the same mp4a.40.2 codec. I believe that's valid HLS, and Apple's mediastreamvalidator seems ok with the stream. Is it a special constraint of hls.js that would be difficult to overcome? |
Hi @redoPop, Sorry I misunderstood or didn't understand what you meant by "MTS" and Raw AAC.
So the majority of audio segments are .aac files, and the ads are .ts - Raw AAC / MPEGTS. OK. And Chrome produces a So what's happening is hls.js doesn't think it needs to switch from an AAC demuxer to a TS demuxer because the AAC demuxer's probe test passes with the ts file. That happens right here: https://github.com/video-dev/hls.js/blob/master/src/demux/demuxer-inline.js#L72 We should probably always run the ts demuxer probe check first since it should pass immediately. |
I've come up with a fix: There's a build up that you can test: Let me know how it goes. |
Oh wow, thank you so much! Yes, this resolves our issue. Just tested with one of our affected DAI streams: playback ran smoothly without errors. |
* bugfix/fix-demuxer-probe-and-switch: Fix demuxer switching on level switch and discontinuities video-dev#2887
Audio segments for some of our streams are packaged in MTS. When an ad or other content with raw AAC audio is stitched into these streams, hls.js encounters a media error and attempts recovery.
Ad stitching (Google DAI etc.) is likely the most common use case for such streams.
What version of Hls.js are you using?
v0.14.1
What browser and OS are you using?
Chrome v83.0.4103.116 on macOS Catalina v10.15.5
Test stream:
https://hls-js.netlify.app/demo/?src=https%3A%2F%2Fpb.tedcdn.com%2Ftest%2Fmultiple-audio-containers%2Fmanifest.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOnRydWUsImR1bXBmTVA0IjpmYWxzZSwibGV2ZWxDYXBwaW5nIjotMSwibGltaXRNZXRyaWNzIjotMX0=
Checklist
Steps to reproduce
Begin playback and observe behavior at discontinuities.
The test stream consists of 3 parts, separated by discontinuities:
The first and third part are identical (same audio and video).
Expected behavior
Audio is heard through the stream, no media errors occur.
Actual behavior
Audio stops after the first discontinuity, a media error occurs.
Console output
The text was updated successfully, but these errors were encountered: