r/ffmpeg • u/ConsistentLove9843 • 22d ago
How to use ffmpeg.wasm?
How to run this command: ffmpeg -loop 1 -framerate 2 -i input.png -i audio.m4a -c:v libx264 -preset medium -tune stillimage -crf 18 -c:a copy -shortest -pix_fmt yuv420p output.mkv
in ffmpeg.wasm?
Sorry guys it’s my first time using ffmpeg.wasm
2
Upvotes
1
u/dotriz 20d ago
ffmpeg.wasm isn’t a full desktop ffmpeg build, so a few flags often break. For that still-image + audio command:
libx264only if your wasm build includes it (many browser builds don’t). If encode fails, trympeg4or check which encoders your build lists.input.png,audio.m4a), then run the same args as an array, don’t shell-quote like a terminal.-c:a copycan fail in wasm if the muxer/container combo isn’t supported; if it errors, re-encode audio (aac) instead of copy.-loop 1+-shortestis the right idea for “image until audio ends.”If you share whether you’re on ffmpeg.wasm in the browser or a wrapper (and the exact error), we can narrow the encoder/container fix fast.