ffmpeg.wasm is FFmpeg compiled to WebAssembly. It runs inside a Web Worker in the browser, exposes a virtual filesystem the CLI writes to, and can transcode multi-GB video files on your laptop without uploading a byte. Every video tool on Zro7 — Compress Video, Trim Video, MP4 to GIF, and more — is built on it. Here's what actually happens when you drop a 1 GB file.
The pipeline, end to end
- The page spawns a Web Worker and dynamically imports the ffmpeg.wasm core (~30 MB, cached after first load).
- The worker instantiates the WebAssembly module and initializes an
MEMFSvirtual filesystem inside its own memory. - Your file is streamed from the browser's
Fileobject into MEMFS in chunks (never fully materialized as a JS string). - FFmpeg is invoked with the same argv the CLI would take (
-i input.mp4 -c:v libx264 -crf 23 output.mp4). - libavformat demuxes, libavcodec decodes/encodes, libavfilter runs any filters — identical code paths to native FFmpeg.
- Progress lines are parsed from stderr and posted back to the main thread as an event stream.
- The output file is read from MEMFS as a Uint8Array, wrapped in a Blob, and offered as a download.
Why WebAssembly makes this possible
WebAssembly runs near-native speed. With SIMD and threads enabled (both require cross-origin isolation, which Zro7 serves via COOP/COEP headers), a modern browser gets within 40–60% of native FFmpeg on CPU-only workloads. That's fast enough to compress a phone video in less time than uploading it to a cloud service.
The memory ceiling
- WebAssembly is 32-bit until Memory64 ships broadly. Practical MEMFS ceiling: ~2 GB per file.
- For files near the ceiling, Zro7 splits the input, processes in chunks, and concatenates — invisible to the user.
- For truly massive workloads (10+ GB drone footage), the browser hits limits before FFmpeg does. Desktop is still the answer there.
What's not supported vs native
- Hardware acceleration — no NVENC, QuickSync, or VideoToolbox in the browser. CPU-only encoding is 5–20× slower than a good GPU. For occasional videos: fine. For batch jobs: use desktop.
- Some experimental codecs — the ffmpeg.wasm build ships with H.264 (via OpenH264), H.265, AV1, VP9, and every common audio codec. Exotic broadcast formats may need custom builds.
- Network protocols — RTMP/RTSP live streams don't work in a browser context. Zro7 operates on local files only.
Why we chose it over cloud transcoding
- Privacy — client footage, medical scans, and unreleased work never touch a server.
- Cost — cloud transcoding is metered per minute; browser transcoding is free.
- Latency — no upload/download round trip. A 2 GB file takes zero seconds to "upload".
- Availability — works offline once loaded.
Try it
Any Zro7 video tool is a good starting point — compress, trim, rotate, MP4→GIF, or extract audio. All of them run this exact pipeline.
Zro7