Running FFmpeg in the Browser with WebAssembly

How GoVid compresses video without a server — and what makes this technically possible.

FFmpeg: the engine behind every video tool you've used

FFmpeg is a free, open-source command-line tool that handles encoding, decoding, transcoding, muxing, demuxing, streaming, filtering, and playing almost any audio/video format. It's the engine underneath VLC, YouTube's upload pipeline, OBS, and thousands of other tools. It's written in C and has been actively developed since 2000.

Until recently, FFmpeg required being installed on a system. You couldn't run it in a browser. WebAssembly changed that.

What WebAssembly is

WebAssembly (WASM) is a binary instruction format that runs in the browser. It's not JavaScript — it's a compile target for languages like C, C++, and Rust. Code compiled to WASM runs in a sandboxed environment inside the browser tab, at near-native performance.

Emscripten is the toolchain that compiles C/C++ programs to WASM. The ffmpeg.wasm project used by GoVid is FFmpeg compiled via Emscripten to run as a browser module.

How GoVid uses ffmpeg.wasm

When you drop a video, GoVid:

  1. Downloads the FFmpeg WASM core (~31 MB) from a CDN — once, then cached
  2. Loads it into a Web Worker (so the browser tab stays responsive)
  3. Writes your video file to an in-memory virtual filesystem that emulates a Unix FS
  4. Runs the FFmpeg command (e.g. ffmpeg -i input.mp4 -crf 28 -preset fast output.mp4)
  5. Reads the output file from the virtual FS and creates a download URL in-browser

Your video is loaded into memory on your device. It is never transmitted to any external host.

The actual FFmpeg command GoVid runs

For a standard MP4 compression, GoVid runs:

ffmpeg -i input -c:v libx264 -crf 28 -preset fast -c:a aac -b:a 96k -movflags +faststart output.mp4

Why this is a privacy improvement

Server-based video tools receive your file. They can log it, scan it, retain it, or transmit it. Most have privacy policies — but policies can change, companies can be acquired, and breaches happen. The only truly private processing is processing that never leaves your device.

GoVid's architecture makes server-side access technically impossible: there is no route for your video to leave the browser tab.

Limitations

Browser-based FFmpeg is slower than native FFmpeg because WASM doesn't have access to hardware encoders (like QuickSync or NVENC). A 5-minute 1080p video that takes 10 seconds with hardware acceleration might take 2–4 minutes in the browser. For most files under 500 MB, this is still practical.

Files above 2 GB also exceed what browsers can reliably hold in memory.

Try GoVid — compress video in your browser