Skip to content

Building Locally

Phillippe Pelzer edited this page Nov 24, 2026 · 3 revisions

Building Locally

You can build any platform on your own machine. Use this to test a change before you open a PR. A maintainer still builds and tests every platform before merging. See Contributing.

What you need

Need Why
Docker with Docker Compose Every build runs in a container.
A lot of disk space and time The base image is about 31 GB when built locally. Each platform image is 0.35 to 0.66 GB. The builds take hours, not minutes.
Git To clone the repository.
Bash or PowerShell To run the test scripts.

You can build all seven platforms on one Linux x86_64 machine. The Linux ARM64, Windows, macOS and FreeBSD binaries are cross compiled.

The compose services

docker-compose.yml defines one service per platform, plus the base image.

Service Archive written to ./output
ffmpeg-base none (the shared base image)
ffmpeg-linux-x86_64 ffmpeg-9.1-linux-x86_64.tar.gz
ffmpeg-linux-aarch64 ffmpeg-9.1-linux-aarch64.tar.gz
ffmpeg-windows-x86_64 ffmpeg-9.1-windows-x86_64.zip
ffmpeg-windows-aarch64 ffmpeg-9.1-windows-aarch64.zip
ffmpeg-darwin-x86_64 ffmpeg-9.1-darwin-x86_64.tar.gz
ffmpeg-darwin-arm64 ffmpeg-9.1-darwin-arm64.tar.gz
ffmpeg-freebsd-x86_64 ffmpeg-9.1-freebsd-x86_64.tar.gz

Local archives carry no release tag. Release archives are named ffmpeg-9.1-<platform>-<release>.<ext>.

Build one platform

  1. Clone and enter the repository.

    git clone https://github.com/NoMercy-Entertainment/nomercy-ffmpeg.git
    cd nomercy-ffmpeg
  2. Build the base image. Every platform needs it. Do this once, and again after you change ffmpeg-base.dockerfile.

    docker compose --progress=plain build ffmpeg-base

    docker pull nomercyentertainment/ffmpeg-base:latest skips this build, unless ffmpeg-base.dockerfile changed.

  3. Build the platform image. The numbered steps in scripts/ run here.

    docker compose --progress=plain build ffmpeg-linux-x86_64
  4. Run the service once. Its command copies the archive to ./output.

    docker compose run --rm ffmpeg-linux-x86_64
    ls output/
  5. Unpack the archive into a work folder and run it.

    mkdir work
    tar -xzf output/ffmpeg-9.1-linux-x86_64.tar.gz -C work
    ./work/ffmpeg -version

    The version line says 9.1. The 9.1 in the archive name is the release line.

For a Windows archive use unzip output/ffmpeg-9.1-windows-x86_64.zip -d work.

You can only run the binary of your own platform. The other archives are for the test machines.

A local build has no built-in AACS key database and does not link AACS and BD+ into libbluray. Those files are not in the public repository; the project's CI adds them. Everything else matches the release.

Run the tests

Run the checks from the repository root.

tests/smoke.sh work 9.1 linux-x86_64
tests/tests.sh "$(pwd)/work"
tests/unit/run.sh

On Windows, with a Windows x86_64 archive unpacked into work:

./tests/smoke.ps1 -Workspace "$PWD/work" -ExpectedVersion 9.1 -Platform windows-x86_64
./tests/tests.ps1 -Workspace "$PWD/work" -Platform windows-x86_64

What each script checks is on Testing.

Build all platforms

Build the base image first, then every platform image. Then run each service once, one after the other. Each run copies its archive to ./output.

docker compose --progress=plain build ffmpeg-base
docker compose --progress=plain build
for p in linux-x86_64 linux-aarch64 windows-x86_64 windows-aarch64 darwin-x86_64 darwin-arm64 freebsd-x86_64; do
  docker compose run --rm ffmpeg-$p
done

Options

Goal How
Fewer parallel compiles when memory is short docker compose build --build-arg BUILD_JOBS=4 ffmpeg-linux-x86_64
Verbose step logs docker compose build --build-arg DEBUG=true ffmpeg-base, then rebuild the platform
Build from nothing add --no-cache to the build command
Look inside the base image docker compose run --rm --entrypoint /bin/bash ffmpeg-base

BUILD_JOBS caps the number of parallel jobs for the whole build. Without it the build uses all CPUs.

When a step fails

init.sh prints the last 200 lines of the failing step's log and stops. Find the step name in the output, for example LIBJXL. Then open scripts/<number>-<name>.sh.

Rebuild after a fix with the same two commands: docker compose build ... <service> and docker compose run --rm <service>. Docker reuses the layers before the line you changed.

Iterating on one filter

For the lyricsalign filter, tools/lyricsalign-lab/ builds a minimal FFmpeg in minutes instead of hours. Nothing from it is shipped.

tools/lyricsalign-lab/run.sh image
tools/lyricsalign-lab/run.sh build
tools/lyricsalign-lab/run.sh suite

Clone this wiki locally