Repository navigation
[Web API type definition issue] VideoEncoderConfig interface should have hevc attribute #2025
Description
Activity
- added a commit that references this issue
on May 21, 2025 saschanaz commented
on May 23, 2025 ContributorMore actionsThat MDN page does not show that Gecko and WebKit supports HEVC video encoding. Actually none of them supports it. (They have only
avc.Thank you for posting the Gecko and WebKit repos here. You are right that in these repos there's no mention of HEVC support. However, it's interesting that Safari does mention that it supports webcodecs HEVC since 17.4 https://developer.apple.com/documentation/safari-release-notes/safari-17_4-release-notes .
If you have a safari browser 17.4+ you can test out following on console to verify encoder support for hevc main, Level 4.1 codec.
(async () => { if (!window.VideoEncoder) { console.warn('WebCodecs VideoEncoder not exposed – Safari < 17.4'); return; } const hevcMain = { codec: 'hvc1.1.6.L93.B0', width: 1920, height: 1080, bitrate: 8_000_000, framerate: 30 }; const support = await VideoEncoder.isConfigSupported(hevcMain); console.log(support); })();I wonder where the discrepancy is from, as this domain is bit out of my scope.
HolgerJeromin commented
on May 23, 2025 ContributorMore actionsWebkit is the engine.
With that Apple builds Safari.
This is the same as every chrome-based Browser can have different codecs included.
Often they are using the codecs from the host OS (for performance and / or licencing issues).Reacted by Jarno Marttilasaschanaz commented
on May 23, 2025 ContributorMore actionsPerhaps they do support HEVC but not the HEVC specific configuration?
Perhaps they do support HEVC but not the HEVC specific configuration?
That is possible, but it is interesting if that's the case. The difference between annex-b and non-annex b format is basically adding binary separators before Network Abstraction Layer (NAL) units instead of communicating before a video stream or during the video stream separately where the relevant information for decoding is available, which is computationally and programmatically quite straightforward to do. I'd like to imagine that the apple hardware already has support for annexb format video encoding, but I wonder why would it not be reflected on the webkit repo.
Webkit is the engine. With that Apple builds Safari. This is the same as every chrome-based Browser can have different codecs included. Often they are using the codecs from the host OS (for performance and / or licencing issues).
Thank you for the clarification.
Reacted by Holger JerominI'll need to have a look at https://github.com/WebKit/WebKit/blob/main/Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.cpp , maybe hevc annex-b support could be added to it and then I can revisit this issue on later date.

Summary
VideoEncoderConfig interface is missing hevc attribute
Expected vs. Actual Behavior
Modern browsers widely support hevc codec for video encoding and decoding https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/Video_codecs#hevc_h.265. Supported on Chrome 107+, Edge 18+, Firefox 120+, Opera 94+, Safari 11+
The lack of hevc attribute for video encoder means that users cannot change the format of encoded video to e.g. annex-b which is favoured for realtime video streaming.
VideoEncoder interface looks now following:
Should be:
Removing following from removedTypes.jsonc and fixing tests should alleviate this:
Playground Link
No response
Browser Support
Have Tried The Latest Releases
@types/web.Additional Context
No response