How Add Audio to Video Works
AnyTool adds audio to a video entirely in the browser using a self-hosted single-threaded ffmpeg.wasm engine — the core (ffmpeg-core.js + the 32 MB wasm) is bundled from npm and served as a same-origin asset, so nothing is fetched from a CDN. Both files are written to ffmpeg's virtual filesystem (MEMFS) and combined in one of two modes. Replace maps the new audio with the original video stream copied through (-c:v copy), which is fast and lossless, and uses -shortest to end at the shorter input. Mix blends the original and new tracks with the amix filter using independent per-track volume controls. In either mode, a short audio file can be looped to the video length with -stream_loop. The combined result is read back as an MP4 blob. Single-threaded is deliberate: the multi-threaded core needs SharedArrayBuffer + cross-origin isolation (COOP/COEP), which would block cross-origin ad iframes.
- Runs client-side — the files are never uploaded
- Self-hosted ffmpeg core (bundled) — no CDN
- Replace: new audio + video stream-copied (-c:v copy), -shortest
- Mix: amix with independent per-track volume
- Short audio looped to length with -stream_loop
- MP4 output; no backend, no watermark, no size cap
