The FFmpeg build script provides an easy way to build a static build of FFmpeg for Linux.
The Owncast project offers a quick installer script as an option to install the live video streaming server. A part of this script is determining if FFmpeg is already downloaded on the target machine. If not, it will download a static build of FFmpeg for Linux for either amd64 or arm64.
However, as of recent versions of Debian that no longer supports old versions of glib, the static builds that this script has relied on to download are no longer compatible and will segfault. Additionally, any alternative static builds that are available are outdated or not maintained.
To solve this issue, it is necessary to create our own FFmpeg builds that are compatible with the latest Debian releases. These builds are based on the FFmpeg source code and are compiled with the necessary dependencies to ensure compatibility with modern systems.
These builds are available for download and can be used as a drop-in replacement for the existing FFmpeg linux builds used by the Owncast installer script.
This repository is a fork of ffmpeg-build-script by markus-perl.
- Install Earthly build tools.
- Install QEMU for cross-compilation.
- run
earthly --ci +multi-platformto build for amd64 and arm64 architectures. - Wait.
- The build archives will be available in the
buildsdirectory.
Every published release is tested automatically by the Test release assets workflow. For each release asset it verifies linkage (static builds must have no dynamic interpreter), checks that every capability Owncast's transcoder requires is compiled in, runs a short encode, and then streams through a real Owncast server end to end. A separate job runs each Linux binary inside a matrix of distribution containers, from Debian 11 and Ubuntu 20.04 up through Debian 13, Fedora, and Alpine. A weekly soak workflow streams through Owncast for 30 minutes to catch leaks and mid-stream crashes.
The same checks can be run locally:
./test-builds.shruns the distro container matrix against the latest release. Use--arch,--tag, and--linux-onlyto narrow it../e2e-owncast.sh <path-to-ffmpeg> [seconds]downloads the latest Owncast release, makes it use the given ffmpeg binary, pushes a live test stream in, and verifies HLS output. Durations over two minutes switch to soak mode../parity-check.sh <baseline|-> <candidate> [vaapi]verifies a binary has everything Owncast's transcoder needs and optionally diffs its full capability set against another build, such as the one the installer ships today.
There will be two builds created for each architecture: one with VAAPI support enabled, and one without. The goal will be to eventually update the Owncast installer script to download the VAAPI-enabled build if the target machine supports it. If the target machine without VAAPI support were to download a VAAPI-enabled build, ffmpeg would crash, as it would try to dynamically load the VAAPI libraries, which would not be present on the target machine.
Note that the VAAPI builds are dynamically linked and currently built on Ubuntu 24.04, so they require glibc 2.38 or newer. They will not start on Debian 12 or Ubuntu 22.04. Building the VAAPI variant on an older base image would widen that coverage and is worth doing before the installer points at these builds by default.
While it's possible to create a build that includes non-free codecs, it's not recommended due to potential legal issues. If you find this binary is shipping a non-free codec, or any other please licensing incompatibility please open an issue, or better yet, a PR to improve this build so everyone can benefit from it.
- Add support for more ARM architectures (e.g. armhf, etc).
- Create macOS binaries as well while we're at it, though this is not necessary since the existing macOS FFmpeg binaries are working fine.
- Allow people to manually run the build script with custom options to enable NVIDIA NVENC support. We can't ship this, but people can build it themselves.
- Enable cross-compilation without emulation.