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
A transform exposes video frames that can be of various pixel formats (https://w3c.github.io/webcodecs/#enumdef-videopixelformat).
Depending on the OS and/or camera, this might be I420 or NV12 right now for cameras.
This might probably be the same for video element exported tracks, RGBA might be used for canvas capture tracks maybe.
It seems this can lead us to interop issue, especially for camera tracks, where applications will expect a given format and will break whenever their assumption is wrong.
I see a few options:
Let the web app deal with it: they can implement their own conversion in JS (computationally expensive though)
Let the web app easily convert video frames to another format.
Let the web app prescribe the pixel format it wants as API when creating the transform.
Let the UAs consistently select pixel formats (specs recommend or require to use a particular pixel formats, on a source type maybe)
The text was updated successfully, but these errors were encountered:
Regarding conversion by the web app, a relatively easy and efficient way of converting to RGBA is through WebGPU (well, "relatively easy" provided you're familiar with a few WebGPU concepts, and "efficient" when the underlying data of the VideoFrame is on the GPU). The external texture sampler returns pixels in RGBA (or BGRA) with the specified color space, regardless of the pixel format of the external texture.
A transform exposes video frames that can be of various pixel formats (https://w3c.github.io/webcodecs/#enumdef-videopixelformat).
Depending on the OS and/or camera, this might be I420 or NV12 right now for cameras.
This might probably be the same for video element exported tracks, RGBA might be used for canvas capture tracks maybe.
It seems this can lead us to interop issue, especially for camera tracks, where applications will expect a given format and will break whenever their assumption is wrong.
I see a few options:
The text was updated successfully, but these errors were encountered: