Failure to find ffmpeg/libavcodec header files during compilation #877

Open
opened 2026-01-29 16:55:57 +00:00 by claunia · 0 comments
Owner

Originally created by @siliconwaffle on GitHub (Jan 1, 2026).

Description

Linux build script fails to find libavcodec header files on Fedora 43 with ffmpeg-devel from rpmfusion.

Component: lib_ccx
File: src/lib_ccx/hardsubx.c and src/lib_ccx/hardsubx.h

Problem

Compilation of ccextractor fails on systems where ffmpeg header files exist under /usr/include/ffmpeg. The header files are installed, they're just in a weird location and the environment variables aren't fixing it.

Compilation command used:

cd linux
export ENABLE_FFMPEG=1 FFMPEG_DLL_PATH='/usr/lib64' FFMPEG_INCLUDE_DIR='/usr/include/ffmpeg' FFMPEG_PKG_CONFIG_PATH='/usr/lib64/pkgconfig' RUST_BACKTRACE=full
./build -hardsubx -system-libs

Error message:

Running `/builddir/build/BUILD/ccextractor-0.96.4-build/ccextractor/src/rust/../../linux/rust/release/build/ccx_rust-e0b85611ce9f5505/build-script-build`
error: failed to run custom build command for `ccx_rust v0.1.0 (/builddir/build/BUILD/ccextractor-0.96.4-build/ccextractor/src/rust)`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/builddir/build/BUILD/ccextractor-0.96.4-build/ccextractor/src/rust/../../linux/rust/release/build/ccx_rust-e0b85611ce9f5505/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=TARGET
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
  cargo:rerun-if-changed=wrapper.h

  --- stderr
  ./../lib_ccx/hardsubx.h:9:10: fatal error: 'libavcodec/avcodec.h' file not found

  thread 'main' (2044) panicked at build.rs:143:10:
  Unable to generate bindings: ClangDiagnostic("./../lib_ccx/hardsubx.h:9:10: fatal error: 'libavcodec/avcodec.h' file not found\n")

Proposed Fix

I haven't figured out how to fix this.

Impact

This issue causes compilation to fail.

This has been an issue for years and there's still a comment in the header and c files that say "// TODO: Correct FFMpeg integration", but there was a similar issue a while back that got closed as "not planned". I have been attempting to fix this for a while but I have no idea what I'm doing, is there at least a good work-around if it's not going to be fixed?

Originally created by @siliconwaffle on GitHub (Jan 1, 2026). ### **Description** Linux build script fails to find libavcodec header files on Fedora 43 with ffmpeg-devel from rpmfusion. Component: lib_ccx File: src/lib_ccx/hardsubx.c and src/lib_ccx/hardsubx.h ### **Problem** Compilation of ccextractor fails on systems where ffmpeg header files exist under /usr/include/ffmpeg. The header files are installed, they're just in a weird location and the environment variables aren't fixing it. Compilation command used: ``` cd linux export ENABLE_FFMPEG=1 FFMPEG_DLL_PATH='/usr/lib64' FFMPEG_INCLUDE_DIR='/usr/include/ffmpeg' FFMPEG_PKG_CONFIG_PATH='/usr/lib64/pkgconfig' RUST_BACKTRACE=full ./build -hardsubx -system-libs ``` Error message: ``` Running `/builddir/build/BUILD/ccextractor-0.96.4-build/ccextractor/src/rust/../../linux/rust/release/build/ccx_rust-e0b85611ce9f5505/build-script-build` error: failed to run custom build command for `ccx_rust v0.1.0 (/builddir/build/BUILD/ccextractor-0.96.4-build/ccextractor/src/rust)` note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation. Caused by: process didn't exit successfully: `/builddir/build/BUILD/ccextractor-0.96.4-build/ccextractor/src/rust/../../linux/rust/release/build/ccx_rust-e0b85611ce9f5505/build-script-build` (exit status: 101) --- stdout cargo:rerun-if-env-changed=TARGET cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS cargo:rerun-if-changed=wrapper.h --- stderr ./../lib_ccx/hardsubx.h:9:10: fatal error: 'libavcodec/avcodec.h' file not found thread 'main' (2044) panicked at build.rs:143:10: Unable to generate bindings: ClangDiagnostic("./../lib_ccx/hardsubx.h:9:10: fatal error: 'libavcodec/avcodec.h' file not found\n") ``` ### **Proposed Fix** I haven't figured out how to fix this. ### **Impact** This issue causes compilation to fail. This has been an issue for years and there's still a comment in the header and c files that say "// TODO: Correct FFMpeg integration", but there was a similar issue a while back that got closed as "not planned". I have been attempting to fix this for a while but I have no idea what I'm doing, is there at least a good work-around if it's not going to be fixed?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#877