Skip to content

Building Web

Taner Sener edited this page Jul 28, 2026 · 1 revision

FFmpegKitNext for Web can be built with the recommended Nix wrapper or by calling the direct Web build script.

Before building, review Web Prerequisites. For the full Web option reference, see nix-web.sh.

Build With Nix

Use the Nix wrapper for normal builds, CI builds and reproducible host environments.

./nix-web.sh --list-profiles
./nix-web.sh -p web-wasm32-emscripten

The wrapper enters the selected Nix profile and then calls scripts/start-web.sh inside that environment.

Build Without Nix

If you maintain Emscripten and the host tools yourself, call the direct script from the project root:

./scripts/start-web.sh

The direct script uses the environment described in Web Prerequisites.

Build Options

The same Web build options can be passed to both commands. For example:

./nix-web.sh -p web-wasm32-emscripten --enable-web-zlib --enable-freetype
./scripts/start-web.sh --enable-web-zlib --enable-freetype

By default, Web builds use dynamic linkage: the main libffmpegkit.wasm module loads FFmpeg side modules at runtime. Pass --static to link the FFmpeg libraries into one main WebAssembly module.

Use --enable-gpl when enabling GPL-licensed libraries such as x264, x265, xvidcore, libvidstab or rubberband.

The complete option list is documented in nix-web.sh.

Build Flow

The Web build has three phases:

  1. Download FFmpeg, RapidJSON and enabled external-library sources when they are not already available locally.
  2. Build FFmpeg, FFmpegKitNext and enabled external libraries for wasm32-unknown-emscripten.
  3. Create a local npm package containing the JavaScript API, TypeScript definitions, worker runtime and WebAssembly assets.

Build Output

Build outputs are written under prebuilt.

The Web bundle is created under:

prebuilt/bundle-web-wasm32/ffmpeg-kit-next/
  LICENSE
  SOURCE
  package.json
  dist/
  lib/
  licenses/

The package name is ffmpeg-kit-next-web. Deploy the complete package output, including lib/, because the worker and WebAssembly assets are resolved relative to the module.

Clone this wiki locally