Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vp09 (vp9) profile, level, bit depth and chroma subsampling settings don't have an effect #441

Closed
willmorgan opened this issue Feb 11, 2022 · 2 comments

Comments

@willmorgan
Copy link

willmorgan commented Feb 11, 2022

I'm doing some experiments to see if we can upgrade from @surma's webm-wasm repo which is being used for lossless vp9 encoding and muxing.

So far it seems that no matter what vp09 codec string I pass in, I get the same results. The byteLength and hash values are of the raw vp9 frames:

// Profile 2, Level 4.1, 12 bit depth, 4:4:4
await startEncoding("vp09.02.41.12.03", width, height, framesAsImageBitmap)

> {codec: 'vp09.02.41.12.03', byteLength: 1605568, hash: '2425e2f755d41e02c76d461f625cf01526ea0612'}

// Profile 2, Level 4.1, 10 bit depth, 4:2:2
await startEncoding("vp09.02.41.10.02", width, height, framesAsImageBitmap)

> {codec: 'vp09.02.41.10.02', byteLength: 1605568, hash: '2425e2f755d41e02c76d461f625cf01526ea0612'}

// Profile 2, Level 4.1, 08 bit depth, 4:2:0
await startEncoding("vp09.03.41.08.00", width, height, framesAsImageBitmap)

> {codec: 'vp09.02.41.08.00', byteLength: 1605568, hash: '2425e2f755d41e02c76d461f625cf01526ea0612'}

These all give me back the same raw vp9 chunks.

I've tried various levels, bit depths, chroma subsampling values, and don't get anything different.

I've only set latencyMode: "realtime" and framerate on the encoder.

It would be useful to know what each device's true capabilities are when it comes to VP9 configuration so that we can fall back if a device doesn't have the capabilities we require.

Is there anything I should do differently to configure VP9 with WebCodecs?

@sandersdan
Copy link
Contributor

sandersdan commented Feb 11, 2022

This is a Chrome bug; our codec string parser parses the fields but then throws most of them away so we don't learn about them. You should expect that they would be rejected though, because there is currently no way in WebCodecs to request a different format or depth.

It may be that when we do add HDR and WCG support that the codec string is how that will be configured, but I don't think that's likely because other codecs cannot be configured so completely with a codec string.

Issue #384 tracks implementing HDR features in WebCodecs. I don't think there is currently an issue filed for 4:4:4 or other pixel format support.

@willmorgan
Copy link
Author

Thanks for clarifying @sandersdan, I've raised this in the existing issue here: https://bugs.chromium.org/p/chromium/issues/detail?id=1116564&q=webcodecs%20vp9&can=2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants