Skip to content
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

A decode error occurs in Mac Safari. #6510

Open
5 tasks done
brodiddev opened this issue Jun 18, 2024 · 1 comment
Open
5 tasks done

A decode error occurs in Mac Safari. #6510

brodiddev opened this issue Jun 18, 2024 · 1 comment
Labels
Browser issue If there is an underlying issue with the browser that hls.js is running on, this tag should be used. browser: Safari Bug

Comments

@brodiddev
Copy link

brodiddev commented Jun 18, 2024

What version of Hls.js are you using?

1.5.11

What browser (including version) are you using?

Mac Safari 17.1 (19616.2.9.11.7)

What OS (including version) are you using?

Mac Safari

Test stream

https://api.com/media/live/brodi/master.m3u8

Configuration

{
debug: true
enableWorker: true
lowLatencyMode: true
backBufferLength: 90
}

Additional player setup steps

I did not set up the player and tested it on the demo page.

Checklist

Steps to reproduce

Enter the above stream URL in Mac Safari and press the apply button.

Afterwards, if you change the level, a decode error will occur.

Expected behaviour

A decoding error occurs more than 4 out of 10 times.

What actually happened?

If an error occurs, video playback will not be restored.

Status:
100.612 | Media element detached
100.616 | Loading https://beta-api.com/media/live/huhani3/master.m3u8
100.617 | Loading manifest and attaching video element...
100.625 | Media element attached
100.666 | 4 quality levels found
100.666 | Manifest successfully loaded
100.667 | No of audio tracks found: 1
100.667 | Audio track switching...
100.947 | Audio track switched, trying to recover media error.
109.194 | Media element detached
109.197 | The video playback was aborted due to a corruption problem or because the video used features your browser did not support - Media failed to decode
109.203 | Media element attached, trying to swap audio codec and recover media error.
109.323 | Media element detached
109.325 | The video playback was aborted due to a corruption problem or because the video used features your browser did not support - Media failed to decode
109.332 | Media element attached, cannot recover. Last media error recovery failed.
109.433 | The video playback was aborted due to a corruption problem or because the video used features your browser did not support - Media failed to decode

Console output

When no error occurs while changing the image quality, < ReferenceError: Can't find variable: ㄴㄴ is output, and when a decoding error occurs, < ReferenceError: Can't find variable: ㅇㅇ is displayed. 

The domain you're playing from the log and the domain you entered in the form are different, but the stream structure is the same.

<details>
<summary>open/close</summary>

<!-- summary  -->
## log
[Log] [log] > – "[stream-controller]:" – "Loaded fragment 112479 of level 2" (hls.js, line 9707)
[Log] [log] > – "Debug logs enabled for \"main\" in hls.js version 1.5.11" (de447129-9612-4dd7-a189-9e7712ce360e, line 555)
[Log] [log] > – "[stream-controller]:" – "FRAG_LOADING->PARSING" (hls.js, line 10722)
[Log] [log] > – "[stream-controller]:" – "Init video buffer, container:video/mp4, codecs[level/parsed]=[avc1.4d401f/avc1.4D001F]" (hls.js, line 28235)
[Log] [log] > – "[buffer-controller]" – "1 bufferCodec event(s) expected video" (hls.js, line 18557)
[Log] [log] > – "[transmuxer.ts]: Flushed fragment 112479 of level 2" (hls.js, line 16178)
[Log] [log] > – "[stream-controller]:" – "PARSING->PARSED" (hls.js, line 10722)
[Log] [log] > – "[level-controller]:" – "Loading level index 2 with https://beta-api.com/media/live/video/42bc2864-a37e-4456-8bdd-c79ef3d7d40f/huhani3/ltsfzZ7I29VLFLMbDx3Ho…" (hls.js, line 26448)
"Loading level index 2 with https://beta-api.com/media/live/video/42bc2864-a37e-4456-8bdd-c79ef3d7d40f/huhani3/ltsfzZ7I29VLFLMbDx3Horf1RQDjvRTgvjNO2ByFhn2y_eQtjt1RVUo6lgrMWODXWnTxXwlaV7rStPZRq3KC3g==/1280x720/0_0/playlist.m3u8"
[Info] [info] > – "[abr] switch candidate:2->3 adjustedbw(13514774)-bitrate=5514774 ttfb:0.0 avgDuration:1.0 maxFetchDuration:1.0 fetchDuration:0.…" (hls.js, line 7731)
"[abr] switch candidate:2->3 adjustedbw(13514774)-bitrate=5514774 ttfb:0.0 avgDuration:1.0 maxFetchDuration:1.0 fetchDuration:0.6 firstSelection:false codecSet:avc1,mp4a videoRange:SDR hls.loadLevel:2"
[Info] [info] > – "[abr] buffer is empty, optimal quality level 3" (hls.js, line 7583)
[Log] [log] > – "[level-controller]:" – "live playlist 2 REFRESHED 112484--1" (hls.js, line 6458)
[Log] [log] > – "[level-controller]:" – "reload live playlist 2 in 968 ms" (hls.js, line 6532)
[Log] [log] > – "[stream-controller]:" – "Level 2 loaded [112480,112484][part-112484--1], cc [0, 0] duration:5" (hls.js, line 27714)
[Log] [log] > – "[buffer-controller]" – "Updating Media Source duration to 48.000" (hls.js, line 18936)
[Log] [log] > – "[audio-stream-controller]:" – "Loading fragment 114619 cc: 0 of [114619-114623] track: 0, target: 42.445" (hls.js, line 9976)
[Log] [log] > – "[audio-stream-controller]:" – "IDLE->FRAG_LOADING" (hls.js, line 10722)
[Log] [log] > – "injecting Web Worker for \"audio\"" (hls.js, line 15961)
[Log] [log] > – "[transmuxer-interface, audio]: Starting new transmux session for sn: 114619 p: -1 level: 0 id: 1↵        discontinuity: true↵      …" (hls.js, line 16062)
"[transmuxer-interface, audio]: Starting new transmux session for sn: 114619 p: -1 level: 0 id: 1
        discontinuity: true
        trackSwitch: true
        contiguous: false
        accurateTimeOffset: false
        timeOffset: 42.44499999999243
        initSegmentChange: true"
[Log] [log] > – "[audio-stream-controller]:" – "Loaded fragment 114619 of level 0" (hls.js, line 9707)
[Log] [log] > – "Debug logs enabled for \"audio\" in hls.js version 1.5.11" (20b00ced-8e84-42b4-ab03-7b5565b7eff7, line 555)
[Log] [log] > – "[audio-stream-controller]:" – "FRAG_LOADING->PARSING" (hls.js, line 10722)
[Log] [log] > – "[audio-stream-controller]:" – "Init audio buffer, container:audio/mp4, codecs[level/parsed]=[mp4a.40.2/mp4a.40.2]" (hls.js, line 16911)
[Log] [log] > – "[buffer-controller]" – "0 bufferCodec event(s) expected audio" (hls.js, line 18557)
[Log] [log] > – "[buffer-controller]" – "creating sourceBuffer(video/mp4;codecs=avc1.4d401f)" (hls.js, line 19008)
[Log] [log] > – "[buffer-controller]" – "creating sourceBuffer(audio/mp4;codecs=mp4a.40.2)" (hls.js, line 19008)
[Log] [log] > – "[stream-controller]:" – "Alternate track found, use video.buffered to schedule main fragment loading" (hls.js, line 27864)
[Log] [log] > – "[transmuxer.ts]: Flushed fragment 114619 of level 0" (hls.js, line 16178)
[Log] [log] > – "[audio-stream-controller]:" – "PARSING->PARSED" (hls.js, line 10722)
[Log] [log] > – "[audio-stream-controller]:" – "Buffered audio sn: 114619 of track 0 (frag:[42.445-43.426] > buffer:[42.445-43.426])" (hls.js, line 9851)
[Log] [log] > – "[audio-stream-controller]:" – "PARSED->IDLE" (hls.js, line 10722)
[Log] [log] > – "[stream-controller]:" – "Buffered main sn: 112479 of level 2 (frag:[42.000-43.000] > buffer:[42.000-42.999])" (hls.js, line 9851)
[Log] [log] > – "[stream-controller]:" – "PARSED->IDLE" (hls.js, line 10722)
[Log] [log] > – "[stream-controller]:" – "seek to target start position 42.05 from current time 0" (hls.js, line 28004)
[Log] [log] > – "[stream-controller]:" – "Live playlist, switching playlist, load frag with same PDT: 1718706993602" (hls.js, line 10307)
[Log] [log] > – "[stream-controller]:" – "Loading fragment 112480 cc: 0 of [112480-112484] level: 2, target: 43" (hls.js, line 9976)
[Log] [log] > – "[stream-controller]:" – "IDLE->FRAG_LOADING" (hls.js, line 10722)
[Log] [log] > – "[stream-controller]:" – "media seeking to 42.050, state: FRAG_LOADING" (hls.js, line 9614)
[Log] [log] > – "[audio-stream-controller]:" – "media seeking to 42.050, state: IDLE" (hls.js, line 9614)
[Log] [log] > – "[subtitle-stream-controller]:" – "media seeking to 42.050, state: IDLE" (hls.js, line 9614)
[Log] [log] > – "[audio-stream-controller]:" – "Loading fragment 114620 cc: 0 of [114619-114623] track: 0, target: 43.426" (hls.js, line 9976)
[Log] [log] > – "[audio-stream-controller]:" – "IDLE->FRAG_LOADING" (hls.js, line 10722)
[Log] [log] > – "[stream-controller]:" – "Loaded fragment 112480 of level 2" (hls.js, line 9707)
[Log] [log] > – "[stream-controller]:" – "FRAG_LOADING->PARSING" (hls.js, line 10722)
[Log] [log] > – "[transmuxer.ts]: Flushed fragment 112480 of level 2" (hls.js, line 16178)
[Log] [log] > – "[stream-controller]:" – "PARSING->PARSED" (hls.js, line 10722)
[Log] [log] > – "[stream-controller]:" – "Buffered main sn: 112480 of level 2 (frag:[43.000-44.000] > buffer:[42.000-43.999])" (hls.js, line 9851)
[Log] [log] > – "[stream-controller]:" – "PARSED->IDLE" (hls.js, line 10722)
[Log] [log] > – "[stream-controller]:" – "Loading fragment 112481 cc: 0 of [112480-112484] level: 2, target: 44" (hls.js, line 9976)
[Log] [log] > – "[stream-controller]:" – "IDLE->FRAG_LOADING" (hls.js, line 10722)
[Log] [log] > – "[audio-track-controller]:" – "loading audio-track playlist 0 \"mp4a.40.2\" lang:ko group:origin" (hls.js, line 17271)
[Log] [log] > – "[buffer-controller]" – "Media source ended" (hls.js, line 18301)
[Log] [log] > – "[buffer-controller]" – "Media source closed" (hls.js, line 18298)
[Log] [log] > – "[stream-controller]:" – "FRAG_LOADING->STOPPED" (hls.js, line 10722)
[Log] [log] > – "[audio-stream-controller]:" – "FRAG_LOADING->STOPPED" (hls.js, line 10722)
[Log] [log] > – "[subtitle-stream-controller]:" – "IDLE->STOPPED" (hls.js, line 10722)
[Log] [log] > – "swapAudioCodec" (hls.js, line 28692)
[Log] [log] > – "recoverMediaError" (hls.js, line 28703)
[Log] [log] > – "detachMedia" (hls.js, line 28606)
[Log] [log] > – "[buffer-controller]" – "media source detaching" (hls.js, line 18433)
[Log] [log] > – "attachMedia" (hls.js, line 28595)
[Log] [log] > – "[buffer-controller]" – "created media source: ManagedMediaSource" (hls.js, line 18397)
[Error] The video playback was aborted due to a corruption problem or because the video used features your browser did not support - Media failed to decode
	handleVideoEvent (hls-demo.js:24997)
[Log] [log] > – "[buffer-controller]" – "Media source opened" (hls.js, line 18282)
[Log] [log] > – "[buffer-controller]" – "Updating Media Source duration to 48.000" (hls.js, line 18936)
[Log] [log] > – "[stream-controller]:" – "Override startPosition with lastCurrentTime @42.050" (hls.js, line 27339)
[Log] [log] > – "[stream-controller]:" – "STOPPED->IDLE" (hls.js, line 10722)
[Log] [log] > – "[stream-controller]:" – "Loading fragment 112480 cc: 0 of [112480-112484] level: 2, target: 43" (hls.js, line 9976)
[Log] [log] > – "[stream-controller]:" – "IDLE->FRAG_LOADING" (hls.js, line 10722)
[Log] [log] > – "[audio-stream-controller]:" – "Override startPosition with lastCurrentTime @42.050" (hls.js, line 16331)
[Log] [log] > – "[audio-stream-controller]:" – "STOPPED->IDLE" (hls.js, line 10722)
[Log] [log] > – "[audio-stream-controller]:" – "Loading fragment 114619 cc: 0 of [114619-114623] track: 0, target: 42.445" (hls.js, line 9976)
[Log] [log] > – "[audio-stream-controller]:" – "IDLE->FRAG_LOADING" (hls.js, line 10722)
</details>

Chrome media internals output

This only reproduces in Mac Safari.
@brodiddev brodiddev added Bug Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Jun 18, 2024
@robwalch robwalch added Browser issue If there is an underlying issue with the browser that hls.js is running on, this tag should be used. browser: Safari and removed Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Jun 18, 2024
@robwalch
Copy link
Collaborator

robwalch commented Jun 18, 2024

Please file a bug against Safari using Feedback Assistant and copy the ID here. You may also wish to report the issue to CloudFlare (or whomever is handling encoding and packaging) and ask they also file Feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser issue If there is an underlying issue with the browser that hls.js is running on, this tag should be used. browser: Safari Bug
Projects
None yet
Development

No branches or pull requests

2 participants