Bug 262950
Summary: | WebCodecs HEVC isSupported returns true but decoding failed | ||
---|---|---|---|
Product: | WebKit | Reporter: | zzy8200 |
Component: | Media | Assignee: | youenn fablet <youennf> |
Status: | REOPENED | ||
Severity: | Normal | CC: | jer.noble, webkit-bug-importer, youennf |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari Technology Preview | ||
Hardware: | Unspecified | ||
OS: | macOS 13 |
zzy8200
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
I can reproduce with STP 179, but not with system Safari that I have on my machine.
Radar WebKit Bug Importer
<rdar://problem/116768196>
Alexey Proskuryakov
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
(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
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
(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
Pull request: https://github.com/WebKit/WebKit/pull/21496
EWS
Committed 271728@main (8555adfc8a29): <https://commits.webkit.org/271728@main>
Reviewed commits have been landed. Closing PR #21496 and removing active labels.
zzy8200
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.