Repository navigation
Compressing an MP4 to a byte limit in the browser with ffmpeg.wasm #998
leotse90
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I’ve been working on VidNeat, a set of browser video tools. The latest tool takes a file size limit and creates an H.264 MP4 locally. It budgets for the audio track and container, then checks the exported byte count. If the first export is too large, it can retry at a lower bitrate before offering the download.
In Chrome on an Apple M5, a 58-second 47.77 MB test clip came out at 9.08 MB with a 10 MB limit. A 98.69 MB clip just under two minutes came out at 18.11 MB with a 20 MB limit. Both tests used a 720 px maximum edge and the single-thread ffmpeg.wasm core. The page includes a frame comparison and the export timings.
Try it in desktop Chrome or Edge with an SDR clip up to two minutes and 100 MB. The tool keeps the first audio track. The compressor uses VidNeat credits, with 60 starter credits for a verified account. The tool page also links to a file size calculator you can use without a file or account. I’d be interested in feedback on how the size check behaves on lower-memory machines.
All reactions