Contact emails
dalecur...@chromium.org

Explainer
None


Specification
https://www.w3.org/TR/webcodecs


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 (Eg, 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.



Blink component
Blink>Media>WebCodecs


Search tags
webcodecs, videoframe, orientation, videodecoder, videoencoder


TAG review
None


TAG review status
Not applicable


Risks




Interoperability and Compatibility

Low, feature designed in conjunction with Firefox and the Media WG.


Gecko: Positive (https://bugzilla.mozilla.org/show_bug.cgi?id=1955904) Spec 
co-editor, approved all spec changes, implementation planned.

WebKit: No signal (https://github.com/WebKit/standards-positions/issues/475) 
Participated in some of the standards discussions around this feature.

Web developers: Positive (https://github.com/w3c/webcodecs/issues/351) Active 
requests from Zoom and others developers (see issue) who are working with 
cameras with orientation metadata.

Other signals:


Ergonomics

No risk. Small incremental change to WebCodecs API.



Activation

No risk. Small incremental change to WebCodecs API. MDN documentation will be 
updated.



Security

No risk. No new control surfaces. Video elements already have this 
functionality.



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it 
has potentially high risk for Android WebView-based applications?

Some cameras and media will immediately begin exposing orientation information. 
In uncommon cases this orientation may change. If orientation changes during 
encoding through VideoEncoder frames with different orientation than the first 
are currently encoded with incorrect size and orientation. However the 
operation completes without a hard error. During discussions in the media 
working group it was decided that these cases should instead throw a non-fatal 
exception during encode(). There is already precedent for exception handling 
during encode() so authors should already be handling this case.




Debuggability

Rotation information shows up in media configs emitted in media dev tools.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, 
ChromeOS, Android, and Android WebView)?
Yes
Mostly just exposes existing under the hood information used by video elements, 
so is already supported everywhere.



Is this feature fully tested by web-platform-tests?
Yes
https://wpt.fyi/results/webcodecs?label=master&label=experimental&aligned&q=orientation



Flag name on about://flags
WebCodecsOrientation


Finch feature name
WebCodecsOrientation


Requires code in //chrome?
False


Tracking bug
https://crbug.com/40243431


Measurement
WebCodecs has use counters, but no specific use counter has been added for the 
rotation and flip usage.


Availability expectation
Available on all platforms except for iOS.


Adoption expectation
Should be adopted by sites consuming camera feeds with WebCodecs.


Estimated milestones


Shipping on desktop 137

DevTrial on desktop 136

Shipping on Android 137

DevTrial on Android 136

Shipping on WebView 137




Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop 
issues. Please list open issues (eg links to known github issues in the project 
for the feature specification) whose resolution may introduce web 
compat/interop risk (eg, changing to naming or structure of the API in a 
non-backward-compatible way).
Spec changes have already been landed after review with Firefox and the Media 
Working Group: * https://github.com/w3c/webcodecs/pull/884 * 
https://github.com/w3c/webcodecs/pull/874 * 
https://github.com/w3c/webcodecs/pull/840 * 
https://github.com/w3c/webcodecs/pull/559


Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5128855343595520?gate=5187346531876864


This intent message was generated by Chrome Platform Status.

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/67e2d562.170a0220.e1a1e.07a6.GAE%40google.com.

Reply via email to