-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
hls HEVC fmp4 not play in chrome but plays in edge #5418
Comments
This error means you have provided an HLS Multivariant Playlist that does not contain any variants with codecs which are compatible with the the browsers MSE API. |
@robwalch sorry, I paste the wrong console. The test stream link work for you in chrome? It only works on edge This is the correct fail console: Using Hls.js config: {debug: true, enableWorker: true, lowLatencyMode: true, backBufferLength: 90}
logger.ts:74 [log] > Debug logs enabled for "Hls instance" in hls.js version 1.4.0
hls.ts:411 [log] > stopLoad
hls.ts:379 [log] > loadSource:https://bitmovin-a.akamaihd.net/content/dataset/multi-codec/hevc/v180p_fmp4.m3u8
stream-controller.ts:566 [log] > [stream-controller]: Trigger BUFFER_RESET
hls.ts:351 [log] > attachMedia
buffer-controller.ts:794 [log] > [buffer-controller]: Media source opened
base-stream-controller.ts:1713 [log] > [subtitle-stream-controller]: STOPPED->IDLE
level-controller.ts:269 [log] > [level-controller]: manifest loaded, 1 level(s) found, first bitrate: 0
buffer-controller.ts:142 [log] > 1 bufferCodec event(s) expected
hls.ts:401 [log] > startLoad(-1)
level-controller.ts:351 [log] > [level-controller]: Switching to level 0 from level -1
base-stream-controller.ts:1713 [log] > [stream-controller]: STOPPED->IDLE
base-stream-controller.ts:1713 [log] > [subtitle-stream-controller]: IDLE->STOPPED
base-stream-controller.ts:1713 [log] > [subtitle-stream-controller]: STOPPED->IDLE
stream-controller.ts:631 [log] > [stream-controller]: Level 0 loaded [0,52], cc [0, 0] duration:210.28
buffer-controller.ts:686 [log] > [buffer-controller]: Updating Media Source duration to 210.280
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment initSegment cc: 0 of [0-52] level: 0, target: 0
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->IDLE
base-stream-controller.ts:543 [log] > [stream-controller]: Buffered main sn: initSegment of level 0 (frag:[NaN-NaN] > buffer:)
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 0 cc: 0 of [0-52] level: 0, target: 0
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
transmuxer-interface.ts:85 [log] > injecting Web Worker for "main"
transmuxer-interface.ts:227 [log] > [transmuxer-interface, main]: Starting new transmux session for sn: 0 p: -1 level: 0 id: 1
discontinuity: true
trackSwitch: true
contiguous: false
accurateTimeOffset: true
timeOffset: 0
initSegmentChange: true
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 0 of level 0
timeline-chart.ts:754 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
drawLineX @ timeline-chart.ts:754
drawCurrentTime @ timeline-chart.ts:728
afterRender @ timeline-chart.ts:73
notify @ Chart.js:8032
onComplete @ Chart.js:9785
render @ Chart.js:9811
update @ Chart.js:9681
update @ timeline-chart.ts:252
(anonymous) @ timeline-chart.ts:263
requestAnimationFrame (async)
updateOnRepaint @ timeline-chart.ts:263
updateFragment @ timeline-chart.ts:519
updateFragment @ main.js:1609
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
(anonymous) @ base-stream-controller.ts:386
Promise.then (async)
_loadFragForPlayback @ base-stream-controller.ts:367
loadFragment @ base-stream-controller.ts:342
loadFragment @ stream-controller.ts:367
doTickIdle @ stream-controller.ts:346
doTick @ stream-controller.ts:201
tick @ task-loop.ts:106
fragBufferedComplete @ base-stream-controller.ts:569
onFragBuffered @ stream-controller.ts:874
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
(anonymous) @ base-stream-controller.ts:512
Promise.then (async)
_loadInitSegment @ base-stream-controller.ts:497
loadFragment @ stream-controller.ts:359
doTickIdle @ stream-controller.ts:346
doTick @ stream-controller.ts:201
tick @ task-loop.ts:106
onLevelLoaded @ stream-controller.ts:686
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
handlePlaylistLoaded @ playlist-loader.ts:676
handleTrackOrLevelPlaylist @ playlist-loader.ts:498
onSuccess @ playlist-loader.ts:314
readystatechange @ xhr-loader.ts:230
XMLHttpRequest.send (async)
openAndSendXhr @ xhr-loader.ts:157
loadInternal @ xhr-loader.ts:116
load @ xhr-loader.ts:76
load @ playlist-loader.ts:347
onManifestLoading @ playlist-loader.ts:154
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
loadSource @ hls.ts:390
loadSelectedStream @ main.js:372
(anonymous) @ main.js:225
j @ jquery.min.js:2
fireWith @ jquery.min.js:2
ready @ jquery.min.js:2
I @ jquery.min.js:2
Show 8 more frames
blob:https://hlsjs.video-dev.org/cc32d73d-9f0f-45eb-aed7-587a9529bab7:540 [log] > Debug logs enabled for "main" in hls.js version 1.4.0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
stream-controller.ts:1251 [log] > [stream-controller]: Init video buffer, container:video/mp4, codecs[level/parsed]=[/hvc1.1.c.L120.90]
buffer-controller.ts:759 [log] > [buffer-controller]: creating sourceBuffer(video/mp4;codecs=hvc1.1.c.L120.90)
buffer-controller.ts:776 [error] > [buffer-controller]: error while trying to add sourceBuffer: Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp4;codecs=hvc1.1.c.L120.90') is unsupported.
createSourceBuffers @ buffer-controller.ts:776
checkPendingTracks @ buffer-controller.ts:719
onBufferCodecs @ buffer-controller.ts:296
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
_bufferInitSegment @ stream-controller.ts:1268
_handleTransmuxComplete @ stream-controller.ts:1077
handleTransmuxComplete @ transmuxer-interface.ts:407
onWorkerMessage @ transmuxer-interface.ts:367
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:88
Show 1 more frame
hls.ts:411 [log] > stopLoad
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->STOPPED
base-stream-controller.ts:1713 [log] > [subtitle-stream-controller]: IDLE->STOPPED
main.js:734 Error event: {type: 'mediaError', details: 'bufferAddCodecError', fatal: true, error: DOMException: Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp4;c…, mimeType: 'video/mp4;codecs=hvc1.1.c.L120.90', …}
(anonymous) @ main.js:734
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
createSourceBuffers @ buffer-controller.ts:779
checkPendingTracks @ buffer-controller.ts:719
onBufferCodecs @ buffer-controller.ts:296
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
_bufferInitSegment @ stream-controller.ts:1268
_handleTransmuxComplete @ stream-controller.ts:1077
handleTransmuxComplete @ transmuxer-interface.ts:407
onWorkerMessage @ transmuxer-interface.ts:367
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:88
Show 2 more frames
main.js:847 Fatal error : bufferAddCodecError
(anonymous) @ main.js:847
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
createSourceBuffers @ buffer-controller.ts:779
checkPendingTracks @ buffer-controller.ts:719
onBufferCodecs @ buffer-controller.ts:296
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
_bufferInitSegment @ stream-controller.ts:1268
_handleTransmuxComplete @ stream-controller.ts:1077
handleTransmuxComplete @ transmuxer-interface.ts:407
onWorkerMessage @ transmuxer-interface.ts:367
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:88
Show 2 more frames
hls.ts:432 [log] > recoverMediaError
hls.ts:360 [log] > detachMedia
buffer-controller.ts:169 [log] > [buffer-controller]: media source detaching
hls.ts:351 [log] > attachMedia
base-stream-controller.ts:1713 [log] > [stream-controller]: STOPPED->ERROR
base-stream-controller.ts:1713 [log] > [audio-stream-controller]: STOPPED->ERROR
hls.ts:411 [log] > stopLoad
base-stream-controller.ts:1713 [log] > [stream-controller]: ERROR->STOPPED
base-stream-controller.ts:1713 [log] > [audio-stream-controller]: ERROR->STOPPED
main.js:734 Error event: {type: 'mediaError', details: 'bufferIncompatibleCodecsError', fatal: true, error: Error: could not create source buffer for media codec(s)
at BufferController.checkPendingTracks…, reason: 'could not create source buffer for media codec(s)'}
(anonymous) @ main.js:734
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
checkPendingTracks @ buffer-controller.ts:732
onBufferCodecs @ buffer-controller.ts:296
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
_bufferInitSegment @ stream-controller.ts:1268
_handleTransmuxComplete @ stream-controller.ts:1077
handleTransmuxComplete @ transmuxer-interface.ts:407
onWorkerMessage @ transmuxer-interface.ts:367
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:88
Show 2 more frames
main.js:847 Fatal error : bufferIncompatibleCodecsError
(anonymous) @ main.js:847
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
checkPendingTracks @ buffer-controller.ts:732
onBufferCodecs @ buffer-controller.ts:296
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
_bufferInitSegment @ stream-controller.ts:1268
_handleTransmuxComplete @ stream-controller.ts:1077
handleTransmuxComplete @ transmuxer-interface.ts:407
onWorkerMessage @ transmuxer-interface.ts:367
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:88
Show 2 more frames
hls.ts:421 [log] > swapAudioCodec
hls.ts:432 [log] > recoverMediaError
hls.ts:360 [log] > detachMedia
buffer-controller.ts:169 [log] > [buffer-controller]: media source detaching
hls.ts:351 [log] > attachMedia
audio-stream-controller.ts:128 [log] > [audio-stream-controller]: InitPTS for cc: 0 found from main: 0
buffer-controller.ts:794 [log] > [buffer-controller]: Media source opened
buffer-controller.ts:686 [log] > [buffer-controller]: Updating Media Source duration to 210.280
base-stream-controller.ts:1713 [log] > [stream-controller]: STOPPED->IDLE
base-stream-controller.ts:714 [log] > [stream-controller]: Loading fragment 0 cc: 0 of [0-52] level: 0, target: 0
base-stream-controller.ts:1713 [log] > [stream-controller]: IDLE->FRAG_LOADING
base-stream-controller.ts:1713 [log] > [subtitle-stream-controller]: STOPPED->IDLE
transmuxer-interface.ts:85 [log] > injecting Web Worker for "main"
transmuxer-interface.ts:227 [log] > [transmuxer-interface, main]: Starting new transmux session for sn: 0 p: -1 level: 0 id: 1
discontinuity: true
trackSwitch: true
contiguous: false
accurateTimeOffset: true
timeOffset: 0
initSegmentChange: true
base-stream-controller.ts:385 [log] > [stream-controller]: Loaded fragment 0 of level 0
blob:https://hlsjs.video-dev.org/d6040800-de08-42b6-a8b6-1180f932cb17:540 [log] > Debug logs enabled for "main" in hls.js version 1.4.0
base-stream-controller.ts:1713 [log] > [stream-controller]: FRAG_LOADING->PARSING
stream-controller.ts:1251 [log] > [stream-controller]: Init video buffer, container:video/mp4, codecs[level/parsed]=[/hvc1.1.c.L120.90]
buffer-controller.ts:759 [log] > [buffer-controller]: creating sourceBuffer(video/mp4;codecs=hvc1.1.c.L120.90)
buffer-controller.ts:776 [error] > [buffer-controller]: error while trying to add sourceBuffer: Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp4;codecs=hvc1.1.c.L120.90') is unsupported.
createSourceBuffers @ buffer-controller.ts:776
checkPendingTracks @ buffer-controller.ts:719
onBufferCodecs @ buffer-controller.ts:296
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
_bufferInitSegment @ stream-controller.ts:1268
_handleTransmuxComplete @ stream-controller.ts:1077
handleTransmuxComplete @ transmuxer-interface.ts:407
onWorkerMessage @ transmuxer-interface.ts:367
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:88
Show 1 more frame
hls.ts:411 [log] > stopLoad
base-stream-controller.ts:1713 [log] > [stream-controller]: PARSING->STOPPED
base-stream-controller.ts:1713 [log] > [subtitle-stream-controller]: IDLE->STOPPED
main.js:734 Error event: {type: 'mediaError', details: 'bufferAddCodecError', fatal: true, error: DOMException: Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp4;c…, mimeType: 'video/mp4;codecs=hvc1.1.c.L120.90', …}
(anonymous) @ main.js:734
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
createSourceBuffers @ buffer-controller.ts:779
checkPendingTracks @ buffer-controller.ts:719
onBufferCodecs @ buffer-controller.ts:296
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
_bufferInitSegment @ stream-controller.ts:1268
_handleTransmuxComplete @ stream-controller.ts:1077
handleTransmuxComplete @ transmuxer-interface.ts:407
onWorkerMessage @ transmuxer-interface.ts:367
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:88
Show 2 more frames
main.js:847 Fatal error : bufferAddCodecError
(anonymous) @ main.js:847
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
createSourceBuffers @ buffer-controller.ts:779
checkPendingTracks @ buffer-controller.ts:719
onBufferCodecs @ buffer-controller.ts:296
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
_bufferInitSegment @ stream-controller.ts:1268
_handleTransmuxComplete @ stream-controller.ts:1077
handleTransmuxComplete @ transmuxer-interface.ts:407
onWorkerMessage @ transmuxer-interface.ts:367
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:88
Show 2 more frames
base-stream-controller.ts:1713 [log] > [stream-controller]: STOPPED->ERROR
base-stream-controller.ts:1713 [log] > [audio-stream-controller]: STOPPED->ERROR
hls.ts:411 [log] > stopLoad
base-stream-controller.ts:1713 [log] > [stream-controller]: ERROR->STOPPED
base-stream-controller.ts:1713 [log] > [audio-stream-controller]: ERROR->STOPPED
main.js:734 Error event: {type: 'mediaError', details: 'bufferIncompatibleCodecsError', fatal: true, error: Error: could not create source buffer for media codec(s)
at BufferController.checkPendingTracks…, reason: 'could not create source buffer for media codec(s)'}
(anonymous) @ main.js:734
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
checkPendingTracks @ buffer-controller.ts:732
onBufferCodecs @ buffer-controller.ts:296
emit @ index.js:203
emit @ hls.ts:287
trigger @ hls.ts:295
_bufferInitSegment @ stream-controller.ts:1268
_handleTransmuxComplete @ stream-controller.ts:1077
handleTransmuxComplete @ transmuxer-interface.ts:407
onWorkerMessage @ transmuxer-interface.ts:367
TransmuxerInterface.onwmsg @ transmuxer-interface.ts:88
Show 2 more frames
main.js:847 Fatal error : bufferIncompatibleCodecsError |
@82andre If you provide HLS.js with a media playlist rather than the multivariant playlist, which has an unsupported codec, then bufferIncompatibleCodecsError is the expected error. Why are you trying to play media playlists when there is a multivariant playlist available? Does https://bitmovin-a.akamaihd.net/content/dataset/multi-codec/hevc/stream_fmp4.m3u8 work in this case? You can use https://ott.dolby.com/codec_test/index.html to see what your browser is capable of playing. If the |
hello i have the same problem, when i use chrome, the error: Buffer add codec error for video/mp4;codecs=mp4a.40.5,hvc1.1.c.L120.90:Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp4;codecs=mp4a.40.5,hvc1.1.c.L120.90') is unsupported. |
@robwalch my goal is run one real time stream encoded in h265 with hls in chrome, it didn't work in my application, so I try something similar in the demo, that didn't work either. I don't use multivariant because I will only use one media playlist, https://bitmovin-a.akamaihd.net/content/dataset/multi-codec/hevc/v180p_fmp4.m3u8 is closer to my scenario. |
“video/mp4;codecs=mp4a.40.5,hvc1.1.c.L120.90” is a invalid type hardcode in hls.js( hls.js/src/remux/passthrough-remuxer.ts Line 269 in 163442d
For short term solution, @robwalch could you simply change the hardcode code to “video/mp4;codecs=mp4a.40.5,hvc1.1.6.L120.90”? For long term solution, please refer to these two PR: They seems to be there for a long time, but still not able to got merged. |
hvc1.1.6.L120.90 = HEVC main profile = Chrome on Windows support it. hvc1.2.4.L120.90 = HEVC main10 profile = Chrome on Windows support it. hvc1.1.c.L120.90 = Chrome think it is HEVC main still picture profile = Chrome on Windows doesn’t support it. If you want to know more about the internally how chrome parse codecs type, please refer this unittest code: Thanks! |
|
From browser implement aspect, on Windows, Chrome using D3D11 (DXVA) do hardware decoding, per DXVA Spec (https://www.microsoft.com/en-us/download/details.aspx?id=39947), the spec only support HEVC main and main10, thus Chrome only report main and main10 as supported. I am not sure why edge report main still-picture is supported. on macOS chrome do support HEVC main still-picture though. |
If you would like to see this change in a patch, prior to v1.5, please submit a PR. |
The canary for the next patch with @StaZhu's fix is available at https://hlsjs-dev.video-dev.org/demo/ |
In version 1.4.1, the problem still exists. |
Hi @devin87, The issue has been addressed as described.
In that case, the incorrect codec string is in the HLS Multivarinat Playlist (MVP), and should be addressed by the HLS authors. If you think HLS should replace codec strings in the MVP when parsing the Playlist for maximum compatibility, please file a new issue or submit a PR. |
What version of Hls.js are you using?
1.4.0
What browser (including version) are you using?
Chrome 112.0.5615.138 (oficial) 64 bits
What OS (including version) are you using?
Windows 10
Test stream
https://hlsjs.video-dev.org/demo/?src=https%3A%2F%2Fbitmovin-a.akamaihd.net%2Fcontent%2Fdataset%2Fmulti-codec%2Fhevc%2Fv180p_fmp4.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOnRydWUsInN0b3BPblN0YWxsIjpmYWxzZSwiZHVtcGZNUDQiOmZhbHNlLCJsZXZlbENhcHBpbmciOi0xLCJsaW1pdE1ldHJpY3MiOi0xfQ==
Configuration
Additional player setup steps
No response
Checklist
Steps to reproduce
Test it in Demo
Error:
0.409 | Buffer add codec error for video/mp4;codecs=hvc1.1.c.L120.90:Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp4;codecs=hvc1.1.c.L120.90') is unsupported.
0.409 | A media error occurred: bufferAddCodecError
0.415 | A media error occurred: bufferIncompatibleCodecsError
0.578 | Buffer add codec error for video/mp4;codecs=hvc1.1.c.L120.90:Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp4;codecs=hvc1.1.c.L120.90') is unsupported.
0.579 | A media error occurred: bufferAddCodecError
0.58 | A media error occurred: bufferIncompatibleCodecsError
Test it in my carrousel player (HLS in realtime)
Expected behaviour
Play normally in Chrome as in Edge
What actually happened?
segment download stuck or loop in first file
Console output
Chrome media internals output
The text was updated successfully, but these errors were encountered: