Closed AshleyScirra closed 2 years ago
Repro'd. Yes it'd be good to support AV, I'll look into it when I get some time.
OK I got this working, just need to tidy it up before I push the changes. Might be a few days.
Sounds great, thanks for looking in to it!
Should be working now. @AshleyScirra let me know if you try it.
I tried it out and it works! Thanks, that's really cool.
I was looking at some diffs though and saw some code that looked odd around here: https://github.com/davedoesdev/webm-muxer.js/blob/main/webm-worker.js#L200
First I think there's a typo in the VP9 section - it reads metadata.video.chrome_subsampling
whereas I think it was meant to be chroma_subsampling.
Secondly all the AV1 parameters are read off metadata
rather than metadata.video
as with VP9, so specifying the AV1 params in metadata.video
will return undefined for all of the read values and coerce them all to 0.
Despite that it still works, but might be worth a look over that code.
Yes my bad, and it needs a test to vary the params
I've fixed those issues, appreciate the heads up. I also added checking for different private data to the tests.
All looks good now. Thanks again!
WebCodecs supports encoding AV1. It would be nice if we could use that to generate WebM files with the AV1 codec. Currently it doesn't work.
It's hard to come by technical details about AV1 in WebM but the best reference I have found is: https://github.com/ietf-wg-cellar/matroska-specification/blob/master/codec/av1.md This is apparently a de-facto standard for WebM too, as browsers support things like WebM files with AV1.
Here's a minimal repro: videoTest.zip
This can successfully encode a VP9 video from a canvas. The only changes are to change the WebM codec_id to
V_AV1
and configure WebCodecs to encode AV1. This fails with a few warnings and errors including: