How shaka-project/static-ffmpeg-binaries works
1. This repository is a release-engineering project for producing and publishing prebuilt, static FFmpeg binaries. It is not an application runtime; the main “product” is the generated FFmpeg/ffprobe binaries attached to GitHub Releases.
2. The core build pipeline is scripted in shell and centered around build.sh plus the numbered scripts in build-scripts/. Those scripts represent the dependency chain in build order: packages/tooling setup, then codec/library dependencies (libvpx, svt-av1, x264, x265, lame, opus, mbedtls), then the final FFmpeg build, and finally a static-link verification step.
3. versions.txt is the primary configuration input for the build. It defines the source versions that the workflow and scripts use when compiling FFmpeg and its dependencies. get-version.sh reads version information for tagging/release naming, so versioning is part of the build control plane.
4. The repository is designed around a GitHub Actions CI/CD boundary. The workflows under .github/workflows/ split responsibilities: release.yaml appears to drive the full release build and publication flow, build.yaml and test.yaml handle CI validation, while settings.yaml, sync-labels.yaml, and update-issues.yaml support repository automation and issue hygiene.
5. The build matrix is explicitly modeled in build-matrix.json, which likely enumerates the supported OS/CPU combinations. This is what makes the output a multi-platform artifact set rather than a single binary package.
6. Platform detection and environment handling are part of the build system. is-alpine.sh suggests special-case logic for Alpine Linux, while the README’s local-build instructions show that the scripts expect runner-style environment variables such as RUNNER_OS, SUDO, and GITHUB_ENV.
7. There is a clear source-to-artifact flow: upstream source archives are fetched, codec libraries are compiled statically, FFmpeg is linked against them, and the resulting binaries are placed under a build/ output directory. The README specifically calls out build/ffmpeg/ffmpeg and build/ffmpeg/ffprobe as the final outputs.
8. Reproducibility and tamper detection are part of the architecture. The workflow records MD5 sums of the produced binaries, and those sums are included both in workflow logs and in release notes. This creates three consistency points: build logs, published release metadata, and the downloadable artifacts.
9. The repository also contains a small patching layer, such as ffmpeg-nvenc-jammy.patch, which indicates that the FFmpeg source is occasionally adapted for specific platform/toolchain combinations before compilation.
10. The release process is tag-driven. A tag of the form FFMPEG_VERSION-WORKFLOW_RELEASE_NUMBER triggers a release build, and increasing the suffix allows dependency or build-configuration changes without changing the upstream FFmpeg version. That means tags are both version markers and release orchestration inputs.
11. The security posture is intentionally minimal in terms of third-party automation. The README notes only limited use of external GitHub Actions, with mxschmitt/action-tmate reserved for failed builds and only when debug is enabled. This reflects an architecture that prefers local shell scripts and repository-owned workflow logic over opaque build actions.
12. For an architecture diagram, the important boundaries are: upstream source inputs and version metadata on one side; GitHub Actions orchestration in the middle; the shell-based dependency build pipeline and FFmpeg compilation as the processing core; and GitHub Releases plus checksum metadata as the distribution/output layer.
Main entry points: build.sh build.sh · release.yaml release workflow · 90-ffmpeg.sh FFmpeg build · versions.txt versions.txt
Components 19
Inputs & config
Versioning, matrix, and patch inputs that shape the build.
- versions.txt · Primary source-version control file for FFmpeg and its dependencies.
versions.txt - get-version.sh · Derives version strings for tagging and release naming.
get-version.sh - build matrix · Enumerates supported OS and CPU combinations for multi-platform builds.
build-matrix.json - NVENC patch · Targeted FFmpeg source adjustment for specific platform or toolchain cases.
ffmpeg-nvenc-jammy.patch
GitHub Actions
Workflow boundary for release, validation, and repository automation.
- release workflow · Drives the full build, packaging, and publication flow.
.github/workflows/release.yaml - build workflow · Runs build-oriented checks in GitHub Actions.
.github/workflows/build.yaml - test workflow · Runs test-oriented validation in GitHub Actions.
.github/workflows/test.yaml - repo automation · Settings, label sync, and issue upkeep workflows.
.github/workflows/settings.yaml
Build pipeline
Shell-based dependency build and FFmpeg compilation stages.
- build.sh · Main shell entrypoint that sequences the static build.
build.sh - packages · Installs packages and prepares tooling for the build environment.
build-scripts/00-packages.sh - libvpx · Builds the VP8/VP9 dependency used by FFmpeg.
build-scripts/01-libvpx.sh - svt-av1 · Builds the AV1 encoder dependency used by FFmpeg.
build-scripts/02-svt-av1.sh - x264 x265 lame opus mbedtls · Remaining static media and crypto dependencies for the final link.
- FFmpeg build · Configures and compiles FFmpeg against the static dependency set.
build-scripts/90-ffmpeg.sh - static check · Verifies that the final binaries are statically linked.
build-scripts/99-check-static.sh - Alpine detect · Special-cases Alpine Linux behavior during builds.
is-alpine.sh
Artifacts & release
Generated binaries, checksums, and published release outputs.
- FFmpeg artifacts · Built ffmpeg and ffprobe binaries generated in the build output tree.
- MD5 sums · Checksum records used in logs and release notes for verification.
- GitHub Releases · Published release target for downloadable binaries and notes.
Connections 21
- versions.txt → build.sh: pins versions · Build scripts consume the shared version source.
- versions.txt → release workflow: drives release · Release workflow uses version metadata for tagging and naming.
- get-version.sh → release workflow: names tags · Computes version strings for release orchestration.
- build matrix → build workflow: selects platforms · Workflow expands across supported build combinations.
- build matrix → release workflow: selects platforms · Release workflow fans out across the supported matrix.
- build workflow → build.sh: runs · CI validation invokes the shell pipeline.
- test workflow → build.sh: validates · Tests exercise the build logic and resulting artifacts.
- release workflow → build.sh: orchestrates · Release workflow drives the end-to-end build pipeline.
- repo automation → GitHub Releases: maintains · Repository automation supports release-adjacent housekeeping.
- build.sh → packages: starts · Main build entrypoint begins with environment setup.
- build.sh → Alpine detect: detects · Build entrypoint branches for Alpine-specific behavior.
- packages → libvpx: prepares · Base tooling stage precedes codec dependency compilation.
- libvpx → svt-av1: feeds · Core codec dependency work continues with AV1 support.
- svt-av1 → x264 x265 lame opus mbedtls: feeds · Primary codec libraries enable the remaining media deps.
- x264 x265 lame opus mbedtls → FFmpeg build: enables · Static dependencies are linked into the FFmpeg build.
- NVENC patch → FFmpeg build: modifies · Targeted source patch is applied before compilation.
- FFmpeg build → static check: verifies · Static linkage is checked after the FFmpeg build.
- static check → FFmpeg artifacts: produces · Passing verification yields final binaries.
- FFmpeg artifacts → MD5 sums: hashes · Produced binaries are recorded with MD5 sums.
- MD5 sums → GitHub Releases: publishes · Checksum metadata accompanies the released artifacts.
- FFmpeg artifacts → GitHub Releases: attaches · Built ffmpeg and ffprobe binaries are attached to releases.