hls.js icon indicating copy to clipboard operation
hls.js copied to clipboard

Firefox: "Buffer append error"

Open doublex opened this issue 3 months ago • 2 comments

Hello,

Current Firefox (115 on Windows) fails to play some HLS streams with hls.js 1.6. Older Firefox (e.g. 100) or older versions of hls.js (e.g. 1.5) work.

Test case: https://doppelbauer.name/hls/master.m3u8

Console from hlsjs.video-dev.org/demo/:

| The video playback was aborted due to a corruption problem or because the video used features your browser did not support - NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - Error no decoder found for audio/mp4a-latm

Best wishes, Marcus

doublex avatar Dec 05 '25 17:12 doublex

Comparing logs with 'pts' from v1.5.20 to v1.6.15 shows timestamp rollover detection:

v1.5.20: https://5982f183.hls-js-dev.pages.dev/demo/?src=https%3A%2F%2Fdoppelbauer.name%2Fhls%2Fmaster.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOmZhbHNlLCJzdG9wT25TdGFsbCI6ZmFsc2UsImR1bXBmTVA0IjpmYWxzZSwibGV2ZWxDYXBwaW5nIjotMSwibGltaXRNZXRyaWNzIjotMX0=

[log] > [mp4-remuxer]: initPTS & initDTS reset [hls.js:16234:38](https://5982f183.hls-js-dev.pages.dev/dist/hls.js)
[log] > [audio-stream-controller]: InitPTS for cc: 0 found from main: 9090

v1.6.15: https://hlsjs.video-dev.org/demo/?src=https%3A%2F%2Fdoppelbauer.name%2Fhls%2Fmaster.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOmZhbHNlLCJzdG9wT25TdGFsbCI6ZmFsc2UsImR1bXBmTVA0IjpmYWxzZSwibGV2ZWxDYXBwaW5nIjotMSwibGltaXRNZXRyaWNzIjotMX0=

[log] > [mp4-remuxer]: Reset initPTS: null > null [hls.js:17169:46](https://hlsjs.video-dev.org/dist/hls.js)
[log] > [mp4-remuxer]: Adjusting PTS for rollover in timeline near -0.101 audio [hls.js:17169:46](https://hlsjs.video-dev.org/dist/hls.js)
[log] > [mp4-remuxer]: Adjusting PTS for rollover in timeline near -0.101 video [hls.js:17169:46](https://hlsjs.video-dev.org/dist/hls.js)
[log] > [mp4-remuxer]: Adjusting PTS for rollover in timeline near -0.221 video [hls.js:17169:46](https://hlsjs.video-dev.org/dist/hls.js)
[log] > [mp4-remuxer]: Found initPTS at playlist time: 0 offset: 95443.81868888889 (8589943682/90000) trackId: 1 [hls.js:17169:46](https://hlsjs.video-dev.org/dist/hls.js)
[log] > [audio-stream-controller]: InitPTS for cc: 0 found from main: 95443.81868888889 (8589943682/90000) trackId: 1
[log] > [buffer-controller]: Updating audio SourceBuffer timestampOffset to -95443.81868888889 (sn: 1 cc: 0) [hls.js:20319:14](https://hlsjs.video-dev.org/dist/hls.js)
[log] > [buffer-controller]: Updating video SourceBuffer timestampOffset to -95443.81868888889 (sn: 1 cc: 0)

Some difference in the base timestamp offset (InitPTS) is expected since SourceBuffer.timestampOffset is now set to offset the media timestamps rather than changing them to align with the MediaElement timeline (0).

I'm not sure what result is causing a media parser error in Firefox. The offset change is probably fine. It's the "Adjusting PTS for rollover in timeline" logs and timestamp output following that I would look at.

These are some of the relevant changes:

  • https://github.com/video-dev/hls.js/pull/7537
  • https://github.com/video-dev/hls.js/pull/7311
  • https://github.com/video-dev/hls.js/pull/7436

robwalch avatar Dec 09 '25 17:12 robwalch

I can repro in Firefox on Mac 26.1 as well.

robwalch avatar Dec 09 '25 17:12 robwalch