Skip to content

Bundle a static x264 in the prebuilt archives - #1

Open
diogochaves wants to merge 1 commit into
dmtrKovalenko:fframesfrom
diogochaves:fix/bundle-static-x264
Open

diogochaves wants to merge 1 commit into
dmtrKovalenko:fframesfrom
diogochaves:fix/bundle-static-x264

Conversation

@diogochaves

Copy link
Copy Markdown

Fixes dmtrKovalenko/fframes#192.

The prebuilt archives are compiled against Ubuntu 22.04's x264 (ABI 163) and link -lx264 from the system. x264 puts its ABI version in its symbol names, so on a system with another x264 the link fails:

rust-lld: error: undefined symbol: x264_encoder_open_163
>>> did you mean: x264_encoder_open_165
>>> defined in: /usr/lib/libx264.so

That's every fresh fframes project on Arch (x264 165) and other rolling distros.

This makes the binaries workflow compile x264 (stable, pinned to b35605a, 0.165) as a static library and has the export copy it into the archive's lib/ (new FFMPEG_BINARIES_BUNDLE_LIBS). Nothing changes for consumers: build.rs already adds <dist>/lib to the search path before -lx264, so the linker finds the bundled libx264.a first.

I ran the workflow's steps by hand on Arch x86_64: the archive comes out with libx264.a and the same key, and a crate that opens libx264 through it links with no libx264.so in ldd and encodes. fframes 1.2.0 and 1.2.1-rc.45 projects with the default h264 feature link and render with it. I haven't run it on the GitHub runners, macOS or aarch64.

Two things to know:

  • Re-running the workflow uploads to the same binaries-9.0.0 tag, but the build script keeps downloaded archives in ~/.cache/ffmpeg-sys-fframes/binaries-9.0.0/ and never re-downloads them. People who already hit this would keep the old archive. Publishing as 9.0.1 (a new tag) avoids that; fframes asks for "9.0.0", so new projects pick up 9.0.1 on their own.
  • x265 has the same problem (the x265 archive wants x265_api_get_199; Arch has 217). Bundling it the same way also needs the C++ runtime on the link line, so I left it out of this one.

Separately, for your next rebase on zmwangx: zmwangx#140 fixes build-nvenc (configure never found the nv-codec-headers because of --disable-autodetect), which fframes' NVENC path needs.

x264 puts its ABI version in its symbol names, so the archives compiled against
Ubuntu 22.04's x264 (ABI 163) reference x264_encoder_open_163 and fail to link on
systems with another x264, such as Arch's 165 (fframes#192).

The binaries workflow now compiles x264 (stable, 0.165) as a static library and the
export copies it into the archive's lib/ (FFMPEG_BINARIES_BUNDLE_LIBS). The build
script already puts that directory first on the link search path, so -lx264 finds
the bundled libx264.a before any system x264.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 16b6ce4f-3f40-4eb9-a28a-ac9d4c4691a4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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