Vanilagy / webm-muxer

WebM multiplexer in pure TypeScript with support for WebCodecs API, video & audio.
https://vanilagy.github.io/webm-muxer/demo
MIT License
197 stars 12 forks source link

AAC already supported? #4

Closed rafael2k closed 1 year ago

rafael2k commented 1 year ago

I wonder if I get a selected chrome with AAC support already in place, can mux it to a mkv?

Using codecid: "A_AAC/MPEG4/LC"

https://matroska.org/technical/codec_specs.html

Vanilagy commented 1 year ago

Yea should work. Not valid by the strict WebM spec, but probably still plays back correctly in many players. I didn't try AAC but I tried H.264 video and that stuff worked like a charm too.

Vanilagy commented 1 year ago

Note though that the file internally is labeled as "webm", not "matroska". Might need to add a flag to support raw mkv muxing then

rafael2k commented 1 year ago

Thanks! Reading Matroska spec, it seems I need: The docType of the EBML Header MUST be “matroska”. The EBMLMaxIDLength of the EBML Header MUST be “4”. The EBMLMaxSizeLength of the EBML Header MUST be between “1” and “8” inclusive.

I'll try. Could this option (webm or mkv) be parametrized? Thanks!

Vanilagy commented 1 year ago

Yeah, for sure! I mean, it's a bit weird, since this project is called webm-muxer but really is a Matroska muxer (since WebM's a subset of Matroska). Of course, adding a parameter to set Matroska or not is easy to add, but I guess it would've been better to make mkv-muxer and give that a "WebM or not" flag instead.

However, I don't wanna rename this project now. Dunno. Weird stuff. Guess WebM is more well-known in the web community anyway, so it should be fine!

rafael2k commented 1 year ago

Hey, don't bother about the project name. Webm-muxer it is, and WebM muxing should stay as default forever, as this is what people will want, for 99.9%. It is just a bonus having mkv muxing (and support for all WebCodecs muxing, including AAC!) : )

Vanilagy commented 1 year ago

Here you go :)

rafael2k commented 1 year ago

Yay! tks! : )