REOPENED 262950
WebCodecs HEVC isSupported returns true but decoding failed
https://bugs.webkit.org/show_bug.cgi?id=262950
Summary WebCodecs HEVC isSupported returns true but decoding failed
zzy8200
Reported 2023-10-10 04:16:59 PDT
With Safari Technology Preview, const decoder_config = { codec: "hev1.1.6.L90.90", hardwareAcceleration: "no-preference" }; (await VideoDecoder.isConfigSupported(decoder_config)).supported // returns True But then, decoding HEVC failed with error: Unhandled Promise Rejection: EncodingError: Decoder failure. I made a minimum reproduce page: https://zeruniverse.github.io/webcodecs_bg_hevc_test/new.html and HEVC file sample: https://zeruniverse.github.io/webcodecs_bg_hevc_test/sample.hevc Same page works in Chrome 117 on both Windows and MacOS
Attachments
Alexey Proskuryakov
Comment 1 2023-10-10 15:14:30 PDT
I can reproduce with STP 179, but not with system Safari that I have on my machine.
Radar WebKit Bug Importer
Comment 2 2023-10-10 15:14:52 PDT
Alexey Proskuryakov
Comment 3 2023-10-10 15:18:22 PDT
This could be simply because WebCodec HEVC is a feature in Preview state, so it's only enabled in STP. But if so, it probably shouldn't be in Preview state if it doesn't work at all.
zzy8200
Comment 4 2023-10-10 19:30:30 PDT
(In reply to Alexey Proskuryakov from comment #1) > I can reproduce with STP 179, but not with system Safari that I have on my > machine. My system Safari raises different exception: const decoder_config = { codec: "hev1.1.6.L90.90", hardwareAcceleration: "no-preference" }; // error: invalid config (await VideoDecoder.isConfigSupported(decoder_config)).supported I think it would be better just return supported = False instead of throwing an error
youenn fablet
Comment 5 2023-12-04 01:21:37 PST
Trying in Chrome 119, I also get an EncodingError, like in STP 182. Both are using VideoToolBox which returns a -12909 error. I do not think this is a regression. Could it be that the havoc sample is not fully aligned with the standard?
zzy8200
Comment 6 2023-12-04 09:09:02 PST
(In reply to youenn fablet from comment #5) > Trying in Chrome 119, I also get an EncodingError, like in STP 182. > Both are using VideoToolBox which returns a -12909 error. > > I do not think this is a regression. > Could it be that the havoc sample is not fully aligned with the standard? This is weird since Chrome 117 works. Anyway, I made a new HEVC sample file which now works on MacOS 14.1 + Chrome 119, BUT FAILS ON STP. The sample link is same: https://zeruniverse.github.io/webcodecs_bg_hevc_test/new.html with file: https://zeruniverse.github.io/webcodecs_bg_hevc_test/sample.hevc
youenn fablet
Comment 7 2023-12-08 01:47:42 PST
EWS
Comment 8 2023-12-08 06:51:56 PST
Committed 271728@main (8555adfc8a29): <https://commits.webkit.org/271728@main> Reviewed commits have been landed. Closing PR #21496 and removing active labels.
zzy8200
Comment 9 2023-12-25 09:40:20 PST
This fix does NOT fully solve the problem. For each frame, if I just display the frame to Canvas, it looks correct but since the sample HEVC is CT file sliced along z-axis. If I stack the frames up and cut along z-axis, it should still look good. You may check https://zeruniverse.github.io/webcodecs_bg_hevc_test/new.html The first group of 268 images are just decoded frames. The second group of 268 images are generated by stacking those frames together along a new axis and then slice the cube using plane parallel to the new axis. If you open the above webpage in Chrome, all looks good. If you open the above webpage in STP 185, the first 268 images looks good (but actually if you check first non-black image, it looks different from that in Chrome. I decoded that image in FFMPEG, the Chrome result is correct), the second 268 images looks weird. I suspect something is still wrong.
Note You need to log in before you can comment on or make changes to this bug.