Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Hardware-accelerated encoders are enabled per-platform from LGPL-clean SDK heade
- **macOS:** VideoToolbox (`h264_videotoolbox`, `hevc_videotoolbox`)
- **Windows:** NVIDIA NVENC (`h264_nvenc`, `hevc_nvenc`), Intel Quick Sync via oneVPL (`h264_qsv`, `hevc_qsv`), AMD AMF (`h264_amf`, `hevc_amf`)

Windows also enables **libopenh264** (`--enable-libopenh264`), a software (CPU) H.264 encoder used as a last-resort fallback on hosts with no usable GPU encoder. OpenH264 is BSD-2-Clause, so it stays LGPL-clean and doesn't trip the forbidden-flag check (it is *not* `--enable-gpl`/`--enable-nonfree`/`--enable-version3`). It is statically linked via the MSYS2 `mingw-w64-x86_64-openh264` package, so it adds no new runtime DLL (its C++ runtime, `libstdc++-6.dll`, is already in the bundle closure via libvpl).
Windows also enables **libopenh264** (`--enable-libopenh264`), a software (CPU) H.264 encoder used as a last-resort fallback on hosts with no usable GPU encoder. OpenH264 is BSD-2-Clause, so it stays LGPL-clean and doesn't trip the forbidden-flag check (it is *not* `--enable-gpl`/`--enable-nonfree`/`--enable-version3`). It is provided by the MSYS2 `mingw-w64-x86_64-openh264` package and ships as `libopenh264-7.dll` bundled alongside `ffmpeg.exe` (with its BSD-2-Clause license in `LIBOPENH264-LICENSE.txt`), the same way `libvpl-2.dll` is; the C++ runtime it needs, `libstdc++-6.dll`, is already in the bundle closure via libvpl.

The build is verified post-link to confirm none of the banned flags ended up enabled and that the linkage matches the platform's expectations:

Expand All @@ -42,7 +42,7 @@ Tag format: `v<ffmpeg-version>-<run-number>`, e.g. `v8.1.1-42`, where `<run-numb

Per release, per target, the published artifacts are:

- `ffmpeg-<version>-<triple>.tar.gz` — contains the `ffmpeg` (or `ffmpeg.exe`) and `ffprobe` binaries, `COPYING.LGPLv2.1`, and `SOURCE.txt` (provenance record). Windows builds additionally include `libvpl-2.dll` (Intel oneVPL dispatcher, MIT-licensed) + `LIBVPL-LICENSE.txt`, and `libwinpthread-1.dll` (mingw-w64 pthread runtime, BSD-style permissive) + `LIBWINPTHREAD-LICENSE.txt`.
- `ffmpeg-<version>-<triple>.tar.gz` — contains the `ffmpeg` (or `ffmpeg.exe`) and `ffprobe` binaries, `COPYING.LGPLv2.1`, and `SOURCE.txt` (provenance record). Windows builds additionally include `libvpl-2.dll` (Intel oneVPL dispatcher, MIT-licensed) + `LIBVPL-LICENSE.txt`, `libwinpthread-1.dll` (mingw-w64 pthread runtime, BSD-style permissive) + `LIBWINPTHREAD-LICENSE.txt`, and `libopenh264-7.dll` (Cisco OpenH264 software encoder, BSD-2-Clause) + `LIBOPENH264-LICENSE.txt`.
- `ffmpeg-<version>-<triple>.tar.gz.sha256`

Currently supported targets:
Expand Down
21 changes: 17 additions & 4 deletions scripts/build-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
# libwinpthread-1.dll (mingw-w64 pthread runtime)
# libgcc_s_seh-1.dll (GCC unwinder — libvpl dep)
# libstdc++-6.dll (GCC C++ runtime — libvpl dep)
# libopenh264-7.dll (Cisco OpenH264 — software H.264 encoder)
# COPYING.LGPLv2.1
# LIBVPL-LICENSE.txt
# LIBWINPTHREAD-LICENSE.txt
# LIBOPENH264-LICENSE.txt
# GCC-RUNTIME-LIBRARY-EXCEPTION.txt
# GCC-LICENSE.txt
# SOURCE.txt
Expand Down Expand Up @@ -216,9 +218,6 @@ if [ ! -f "$STAMP" ]; then
# --enable-libopenh264 software (CPU) H.264 fallback for hosts with no
# usable GPU encoder. BSD-2-Clause → LGPL-clean, so
# it doesn't trip the forbidden-flag guardrail below.
# Self-compiled, so the AVC patent pool (majority
# expired; fully expires 2027-11-29) sits with the
# distributor — see README "Patent note".
# --enable-schannel (mac --enable-securetransport → Windows Schannel)
# --target-os=mingw32 FFmpeg's identifier for the mingw-w64 target
# regardless of bitness (legacy naming)
Expand Down Expand Up @@ -350,11 +349,16 @@ cp "$FFPROBE_BIN" "$OUT_DIR/ffprobe.exe"
# libstdc++-6.dll Library Exception, which explicitly permits shipping
# these alongside a GCC-compiled program without
# imposing copyleft on that program.
# libopenh264-7.dll — Cisco OpenH264 software H.264 encoder (BSD-2-Clause).
# MSYS2 links it as a DLL (its import lib wins over the
# static archive), so it ships next to ffmpeg.exe. The
# glob tolerates openh264 soname bumps across rebuilds.
for src in \
/mingw64/bin/libvpl-2.dll \
/mingw64/bin/libwinpthread-1.dll \
/mingw64/bin/libgcc_s_seh-1.dll \
/mingw64/bin/libstdc++-6.dll; do
/mingw64/bin/libstdc++-6.dll \
/mingw64/bin/libopenh264-*.dll; do
name="$(basename "$src")"
if [ ! -f "$src" ]; then
echo "✗ $name not found at $src" >&2
Expand All @@ -378,6 +382,15 @@ for wp_license in /mingw64/share/licenses/winpthreads/COPYING /mingw64/share/lic
break
fi
done
# OpenH264 (BSD-2-Clause) — must ship with the bundled libopenh264 DLL. Grab
# whatever license file MSYS2 installs for the package, regardless of its name.
openh264_license="$(ls /mingw64/share/licenses/openh264/* 2>/dev/null | head -n1 || true)"
if [ -n "$openh264_license" ] && [ -f "$openh264_license" ]; then
cp "$openh264_license" "$OUT_DIR/LIBOPENH264-LICENSE.txt"
else
echo "✗ openh264 license not found under /mingw64/share/licenses/openh264/ — required to ship the bundled libopenh264 DLL" >&2
exit 1
fi
# GCC runtime: ship the Runtime Library Exception (the term that makes
# redistribution alongside our binary copyleft-free) plus the GPLv3 base text.
for gcc_dir in /mingw64/share/licenses/gcc-libs /mingw64/share/licenses/gcc; do
Expand Down
Loading