Skip to content

How is the format of the decoded frame determined? #778

Closed Answered by sandersdan
lesomnus asked this question in Q&A
Discussion options

You must be logged in to vote

There is no standardized requirement for the output format from decoding, nor does WebCodecs provide a prediction. WebCodecs does not even require that there is any format (format == null), in which case the frames can be drawn but copyTo() is not available.

The behavior you are seeing in Chrome is indeed due to how the hardware decoding path works. On Android the OS provides a GL texture which we can sample (as RGBA), rather than a buffer we can read in the native pixel format.

There is currently work being done to provide conversions (#92, #754), so if what you need is RGBA in CPU memory then WebCodecs should eventually provide that.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lesomnus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants