w3c / webcodecs

WebCodecs is a flexible web API for encoding and decoding audio and video.

Home Page:https://w3c.github.io/webcodecs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implicit color space conversion is not possible when calling glTexSubImage2D in Webassembly app.

sasmaster opened this issue · comments

Hi.
I am implementing a kind of hybrid decoding solution using C++ (Emscripten) and JS. Demuxer is running on the C++ side as well as WebGL surface updates,but decoding is done on Js side using webcodecs VideoDecoder. Cool feature I have noticed is that in Js app gl.texSubImage2D takes care of converting YUV NV12 into RGB(A), but it doesn't happen when calling this methods in Emscripten. Is it something that can be once day moved to the "lower level" APis in the browser so that wasm developers won't have to implement color space conversions?
Thanks.

I think this is a likely a question for the texSubImage2D bindings in WASM and not WebCodecs. I suspect it's not operating on a VideoFrame object but raw bytes, so would need some sort of understanding of a YUV format to support this. Again that's a bit outside of WebCodecs, so I'm going to close this.