Skip to content

Add libopenh264 software (CPU) H.264 fallback to the Windows build - #2

Merged
jaydrogers merged 2 commits into
mainfrom
feat/libopenh264-cpu-fallback
Jun 7, 2026
Merged

Add libopenh264 software (CPU) H.264 fallback to the Windows build#2
jaydrogers merged 2 commits into
mainfrom
feat/libopenh264-cpu-fallback

Conversation

@jaydrogers

Copy link
Copy Markdown
Member

What

Enables --enable-libopenh264 in the Windows build so hosts with no usable GPU encoder (NVENC / QSV / AMF all fail to initialize) can still encode H.264 in software, instead of hard-failing. Consumers (e.g. Polycast) auto-fall-back to it and warn the user that quality/throughput are reduced.

Licensing

OpenH264 is BSD-2-Clause, so this stays LGPL-clean — --enable-libopenh264 is not --enable-gpl / --enable-nonfree / --enable-version3, so it does not trip the post-link forbidden-flag guardrail. It is statically linked via the MSYS2 mingw-w64-x86_64-openh264 package (which ships libopenh264.a) with the existing --pkg-config-flags=--static, so no new runtime DLL is added; the C++ runtime it needs (libstdc++-6.dll) is already in the bundle closure via libvpl.

Changes

  • scripts/build-windows.sh: --enable-libopenh264, libopenh264 added to the encoder allowlist, openh264 pkg-config dependency check, and the symbol-presence verification.
  • .github/workflows/build.yml: add mingw-w64-x86_64-openh264 to the MSYS2 install list.
  • README.md: document the CPU-fallback encoder.

What CI verifies here

The symbol-presence check fails the build if libopenh264 didn't compile in, and the transitive DLL-import audit fails if openh264 unexpectedly pulled in an unbundled DLL — so a green run confirms the encoder is present and the artifact is still fully self-contained. macOS is unchanged (VideoToolbox is always present there).

🤖 Generated with Claude Code

jaydrogers and others added 2 commits June 7, 2026 09:12
Remove a dangling cross-reference to a README section that no longer exists.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
MSYS2 links openh264 as libopenh264-7.dll (its import lib wins over the
static archive), so the transitive import audit correctly rejected the
unbundled DLL. Ship it alongside ffmpeg.exe with its BSD-2-Clause license,
the same way libvpl-2.dll is bundled.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jaydrogers
jaydrogers merged commit bb405e9 into main Jun 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant