SwissKnife Docs
Operate SwissKnife

FFmpeg WASM

Self-hosted core, first load, SharedArrayBuffer, and licensing.

The audio/video engine is not an FFmpeg binary installed on the server. It is a WebAssembly build loaded in the browser and served from the same origin.

Files

After npm run build, the core is copied into dist/ffmpeg/:

  • /ffmpeg/ffmpeg-core.js
  • /ffmpeg/ffmpeg-core.wasm (about 32 MB)

ffmpegEngine.ts loads these URLs through toBlobURL, with a 120-second timeout. Observed message: “FFmpeg engine ready (local copy, single thread).”

Why COOP/COEP is required

FFmpeg.wasm relies on SharedArrayBuffer. Browsers only expose it when the page is cross-origin isolated (COOP same-origin + COEP require-corp). Vite development, preview, Docker's Nginx, and the Vercel demo all set these headers. A proxy that strips them breaks only the media engine.

Queue

There is one instance and one sequential job queue. Canvas image conversions do not use this instance.

Licenses

SwissKnife is licensed under MIT. The bundled core is documented by ffmpeg.wasm as including x264. Review NOTICE.md before redistributing the application with the WASM file.

Public references:

Do not assume that the repository's MIT license covers FFmpeg or x264.

On this page