← Back to release summary

Add support for video frame orientation metadata to WebCodecs

Category
Multimedia
Type
New or changed feature
Status
In developer trial (Behind a flag) (Chrome 138)
Intent stage
None

Summary

Introduces "rotation: int" and "flip: bool" values to various video related interfaces in WebCodecs so that developers can work with frame sources that have orientation (E.g., Android cameras, certain media). The VideoFrame interface grows the ability to create VideoFrames with arbitrary rotation and flip as well as accessors for this information on the VideoFrame object. The VideoDecoderConfig object gains rotation and flip fields that are emitted on decoded VideoFrame objects automatically. The VideoEncoder class gains mechanisms for passing rotation and flip information from encode() to the VideoDecoderConfig emitted as part of EncodedVideoChunkMetadata. If encode() is called with frames with different orientations a non-fatal exception will be thrown. configure() may be used to reset the allowed orientation.

Motivation

Currently developers have no way of knowing when they receive frames with a non-default orientation. Containers may contain orientation information that developers have no way of telling decoded frames about. Encoding may silently encode incorrectly.

Standards & signals

View on chromestatus.com