You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Web API type definition issue] VideoEncoderConfig interface should have hevc attribute #2025
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.
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).
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).
Activity
VideoEncoderConfig interface should have hevc attribute
saschanaz commentedon May 23, 2025
That MDN page does not show that Gecko and WebKit supports HEVC video encoding. Actually none of them supports it. (They have only
avc.yaruno commentedon May 23, 2025
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); })();Tested on safari 18.4.

I wonder where the discrepancy is from, as this domain is bit out of my scope.
HolgerJeromin commentedon May 23, 2025
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).
saschanaz commentedon May 23, 2025
Perhaps they do support HEVC but not the HEVC specific configuration?
yaruno commentedon May 24, 2025
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.
yaruno commentedon May 24, 2025
Thank you for the clarification.
yaruno commentedon May 24, 2025
I'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.