Yahweasel / libav.js

This is a compilation of the libraries associated with handling audio and video in ffmpeg—libavformat, libavcodec, libavfilter, libavutil, libswresample, and libswscale—for emscripten, and thus the web.
288 stars 18 forks source link

Example of MP4 muxing with encoded input from webcodec H.264/ AAC encoders #10

Closed hlevring closed 1 year ago

hlevring commented 1 year ago

Really nice project, just going over it atm. Since H.264 / AAC encoders are in available in Webcodec , but without any way of multiplexing the audio and video into mp4 , this look like a very good alternative.

Not really sharp myself on web programming, so would be awesome with an example of how to use your projects +webcodec to mux h.264/acc into mp4

Yahweasel commented 1 year ago

You can find some samples of exactly this in the samples directory of https://github.com/ennuicastr/libavjs-webcodecs-polyfill . That's a polyfill of WebCodecs, but it also works with original WebCodecs, and uses libav.js to mux. I've also added a reference to it to README.md, so I'm marking closing this as complete.

Yahweasel commented 1 year ago

I should say, examples of muxing from WebCodecs are available there. That project doesn't support any codecs from the Misanthropic Patent Extortion Gang, so you'll have to slightly adapt the samples to do Misanthropy-4 containers and codecs. It's largely the same, just use "ipod" as the muxer (that name is libav weirdness) instead of "webm".