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

hls HEVC fmp4 not play in chrome but plays in edge #5418

Closed
5 tasks done
82andre opened this issue Apr 24, 2023 · 15 comments · Fixed by #4996 or #5438
Closed
5 tasks done

hls HEVC fmp4 not play in chrome but plays in edge #5418

82andre opened this issue Apr 24, 2023 · 15 comments · Fixed by #4996 or #5438

Comments

@82andre
Copy link

82andre commented Apr 24, 2023

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

in test stream demo
{
  "debug": true,
  "enableWorker": true,
  "lowLatencyMode": true,
  "backBufferLength": 90
}
and in my carrousel player
<HlsPlayer
  loop={true}
  width="100%"
  height="auto"
  autoPlay
  playerRef={ref}
  src={src}
  {...others}
/>

Additional player setup steps

No response

Checklist

Steps to reproduce

Test it in Demo

  1. Run the hlsjs demo "HLS HEVC fMP4 by Bitmovin (Safari and Edge? only as of 2020-08)" this only works on edge
  2. Get the m3u8 https://bitmovin-a.akamaihd.net/content/dataset/multi-codec/hevc/stream_fmp4.m3u8
  3. Get some of m3u8 inside of it, like https://bitmovin-a.akamaihd.net/content/dataset/multi-codec/hevc/v180p_fmp4.m3u8
  4. Run this m3u8 on the demo, and it only works on Edge
  5. On Chrome it loads only the first segment 2 times and stop
  6. There's a codec error but I have a hardware decoder (intel iris xe graphics) why this is different for edge?
    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)

  1. I don't know how to create this cenario in public, the difference is that it loop, downloading the init.mp4 e first segment forever. But play normally in Edge.

Expected behaviour

Play normally in Chrome as in Edge

What actually happened?

segment download stuck or loop in first file

Console output

****REMOVED WRONG CONSOLE****

Chrome media internals output

render_id: 7
player_id: 17
created: 2023-04-24 15:02:30.352 UTC
origin_url: https://hlsjs.video-dev.org/
kFrameUrl: https://hlsjs.video-dev.org/demo/?src=https%3A%2F%2Fbitmovin-a.akamaihd.net%2Fcontent%2Fdataset%2Fmulti-codec%2Fhevc%2Fv180p_fmp4.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOnRydWUsInN0b3BPblN0YWxsIjpmYWxzZSwiZHVtcGZNUDQiOmZhbHNlLCJsZXZlbENhcHBpbmciOi0xLCJsaW1pdE1ldHJpY3MiOi0xfQ==
kFrameTitle: hls.js demo
url: blob:https://hlsjs.video-dev.org/4f6029ab-3e80-42d1-b681-ac652aba23d3
kTextTracks: 
info: ChunkDemuxer
kRendererName: RendererImpl
pipeline_state: kStopped
error: MediaSource endOfStream before demuxer initialization completes (before HAVE_METADATA) is treated as an error. This may also occur as consequence of other MediaSource errors before HAVE_METADATA.
event: kWebMediaPlayerDestroyed
duration: 210.28
@82andre 82andre added Bug Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Apr 24, 2023
@robwalch
Copy link
Collaborator

main.js:734 Error event: {type: 'mediaError', details: 'manifestIncompatibleCodecsError', fatal: true, url: 'https://bitmovin-a.akamaihd.net/content/dataset/multi-codec/hevc/stream_fmp4.m3u8', error: Error: no level with compatible codecs found in manifest

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.

@82andre
Copy link
Author

82andre commented Apr 26, 2023

@robwalch sorry, I paste the wrong console.
I got the stream v180p_fmp4.m3u8 from this multiple example.

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

@robwalch
Copy link
Collaborator

robwalch commented Apr 26, 2023

Get some of m3u8 inside of it, like https://bitmovin-a.akamaihd.net/content/dataset/multi-codec/hevc/v180p_fmp4.m3u8

@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 HEVC/H265 | video/mp4; codecs="hvc1.1.6.L93.B0" line reports probably | true | supported then our check for
video/mp4;codecs=hvc1.1.c.L120.90 should work as well. Please verify that the browser you are testing actually has the required capabilities.

@wahjrzd
Copy link

wahjrzd commented Apr 27, 2023

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.
edge safari can play;
firefox also can't play

@82andre
Copy link
Author

82andre commented Apr 27, 2023

@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.
Just to answer your question, the https://bitmovin-a.akamaihd.net/content/dataset/multi-codec/hevc/stream_fmp4.m3u8 also worked in Edge, and also does not worked on Chrome, "A media error occurred: manifestIncompatibleCodecsError".

For Chrome and Edge HEVC/H265 has the same results
image

@StaZhu
Copy link
Contributor

StaZhu commented Apr 28, 2023

“video/mp4;codecs=mp4a.40.5,hvc1.1.c.L120.90” is a invalid type hardcode in hls.js(

return 'hvc1.1.c.L120.90';
), chrome internally recognized this type as HEVC Main still-picture profile which is not supported by Chrome on Windows.

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:

#4996
#5024

They seems to be there for a long time, but still not able to got merged.

@StaZhu
Copy link
Contributor

StaZhu commented Apr 28, 2023

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:
https://source.chromium.org/chromium/chromium/src/+/main:media/base/video_codecs_unittest.cc;l=520?q=hvc1

Thanks!

@wahjrzd
Copy link

wahjrzd commented Apr 28, 2023

“video/mp4;codecs=mp4a.40.5,hvc1.1.c.L120.90” is a invalid type hardcode in hls.js(

return 'hvc1.1.c.L120.90';

), chrome internally recognized this type as HEVC Main still-picture profile which is not supported by Chrome on Windows.
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:

#4996 #5024

They seems to be there for a long time, but still not able to got merged.

on my pc
edge://gpu
image
chrome://gpu
image

@StaZhu
Copy link
Contributor

StaZhu commented Apr 28, 2023

“video/mp4;codecs=mp4a.40.5,hvc1.1.c.L120.90” is a invalid type hardcode in hls.js(

return 'hvc1.1.c.L120.90';

), chrome internally recognized this type as HEVC Main still-picture profile which is not supported by Chrome on Windows.
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:
#4996 #5024
They seems to be there for a long time, but still not able to got merged.

on my pc edge://gpu image chrome://gpu image

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.

@robwalch
Copy link
Collaborator

@StaZhu #4996 will add support for parsing full HEVC and h264 codec strings from mp4 segments. Until then, always provide a multivariant playlist with variants that include the CODECS attribute.

@robwalch robwalch added Duplicate Missing Feature and removed Bug browser: Chrome Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels Apr 28, 2023
@robwalch robwalch linked a pull request Apr 28, 2023 that will close this issue
3 tasks
@robwalch robwalch added this to the 1.5.0 milestone Apr 28, 2023
@robwalch
Copy link
Collaborator

For short term solution, @robwalch could you simply change the hardcode code to “video/mp4;codecs=mp4a.40.5,hvc1.1.6.L120.90”?

If you would like to see this change in a patch, prior to v1.5, please submit a PR.

@StaZhu
Copy link
Contributor

StaZhu commented Apr 30, 2023

@robwalch #5438, please take a look, thanks.

@robwalch robwalch linked a pull request May 3, 2023 that will close this issue
@robwalch
Copy link
Collaborator

robwalch commented May 3, 2023

The canary for the next patch with @StaZhu's fix is available at https://hlsjs-dev.video-dev.org/demo/

@robwalch robwalch modified the milestones: 1.5.0, 1.4.1 May 3, 2023
@robwalch robwalch closed this as completed May 5, 2023
@devin87
Copy link

devin87 commented May 6, 2023

In version 1.4.1, the problem still exists.
Test stream: https://bitmovin-a.akamaihd.net/content/dataset/multi-codec/hevc/stream_fmp4.m3u8
Windows 10 Chrome 113.0.5672.64 x64

@robwalch
Copy link
Collaborator

robwalch commented May 8, 2023

Hi @devin87,

The issue has been addressed as described.

In version 1.4.1, the problem still exists.
Test stream: https://bitmovin-a.akamaihd.net/content/dataset/multi-codec/hevc/stream_fmp4.m3u8

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.

@video-dev video-dev locked as resolved and limited conversation to collaborators May 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants