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
Add ability to generate PSNR statistics for an encoded video frame #937
Many video encoder implementations include efficient ways to calculate the PSNR of an encoded frame. This can be highly useful for analyzing the generated video quality. This is currently being added to webrtc-stats but is desirable also for WebCodecs.
Some examples of software encoders supporting this functionality include libvpx (VP8/VP9), libaom (AV1) and OpenH264. As for hardware encoders I'm aware of at least D3D12 and VideoToolbox exposing this, assuming the underlying implementation supports it.
There is however no guarantee that it will be available, so it should be generated on a best-effort basis.
I suggest adding a boolean generatePsnr to the VideoEncoderEncodeOptions dictionary (default to false) to request PSNR data from the encoder. If the encoder generated PSNR data, then put it in a new dictionary YuvVideoPsnr (containing separate measurements for the Y, U and V channels) inside the EncodedVideoChunkMetadata dictionary.
Activity
sprangerik commentedon Jun 1, 2026
Created a first draft in #938. Feedback welcome!