Av1an icon indicating copy to clipboard operation
Av1an copied to clipboard

Error compiling for `ffmpeg-sys-next v4.4.0`, Package libavutil was not found in the pkg-config search path

Open ahmadrr opened this issue 3 years ago • 9 comments

Compile from scratch, not on top of existing files

D:\Video\av1>cargo build --release Compiling autocfg v1.0.1 Compiling libc v0.2.105 Compiling proc-macro2 v1.0.32 Compiling unicode-xid v0.2.2 Compiling winapi v0.3.9 Compiling syn v1.0.81 Compiling memchr v2.4.1 Compiling jobserver v0.1.24 Compiling version_check v0.9.3 Compiling cfg-if v1.0.0 Compiling crossbeam-utils v0.8.5 Compiling lazy_static v1.4.0 Compiling crossbeam-epoch v0.9.5 Compiling pkg-config v0.3.22 Compiling bitflags v1.3.2 Compiling log v0.4.14 Compiling regex-syntax v0.6.25 Compiling rayon-core v1.9.1 Compiling vcpkg v0.2.15 Compiling rustversion v1.0.5 Compiling semver v1.0.4 Compiling glob v0.3.0 Compiling scopeguard v1.1.0 Compiling serde_derive v1.0.130 Compiling ryu v1.0.5 Compiling bindgen v0.54.0 Compiling anyhow v1.0.44 Compiling tinyvec_macros v0.1.0 Compiling either v1.6.1 Compiling cfg-if v0.1.10 Compiling lazycell v1.3.0 Compiling matches v0.1.9 Compiling peeking_take_while v0.1.2 Compiling shlex v0.1.1 Compiling serde v1.0.130 Compiling rustc-hash v1.1.0 Compiling radium v0.5.3 Compiling unicode-bidi v0.3.7 Compiling unicode-width v0.1.9 Compiling unicode-segmentation v1.8.0 Compiling ntapi v0.3.6 Compiling percent-encoding v2.1.0 Compiling bytes v1.1.0 Compiling lexical-core v0.7.6 Compiling failure_derive v0.1.8 Compiling adler v1.0.2 Compiling gimli v0.25.0 Compiling rust_hawktracer_proc_macro v0.4.1 Compiling once_cell v1.8.0 Compiling rust_hawktracer_normal_macro v0.4.1 Compiling funty v1.1.0 Compiling static_assertions v1.1.0 Compiling vec_map v0.8.2 Compiling arrayvec v0.5.2 Compiling tap v1.0.1 Compiling strsim v0.8.0 Compiling noop_proc_macro v0.3.0 Compiling serde_json v1.0.68 Compiling byte-slice-cast v1.2.0 Compiling vapoursynth-sys v0.3.0 Compiling wyz v0.2.0 Compiling rustc-demangle v0.1.21 Compiling paste v1.0.5 Compiling plotters-backend v0.3.2 Compiling sysinfo v0.20.5 Compiling bitstream-io v1.2.0 Compiling encode_unicode v0.3.6 Compiling itoa v0.4.8 Compiling ffmpeg-next v4.4.0 Compiling arrayvec v0.7.2 Compiling y4m v0.7.0 Compiling smawk v0.3.1 Compiling pin-project-lite v0.2.7 Compiling std_prelude v0.2.12 Compiling number_prefix v0.4.0 Compiling splines v4.0.3 Compiling strsim v0.10.0 Compiling shlex v1.1.0 Compiling num-traits v0.2.14 Compiling num-integer v0.1.44 Compiling memoffset v0.6.4 Compiling rayon v1.5.1 Compiling num-bigint v0.3.3 Compiling num-rational v0.3.2 Compiling miniz_oxide v0.4.4 Compiling tokio v1.13.0 Compiling cc v1.0.71 Compiling proc-macro-error-attr v1.0.4 Compiling proc-macro-error v1.0.4 Compiling nom v5.1.2 Compiling nom v6.1.2 Compiling clang-sys v0.29.3 Compiling tinyvec v1.5.0 Compiling itertools v0.10.1 Compiling textwrap v0.11.0 Compiling heck v0.3.3 Compiling form_urlencoded v1.0.1 Compiling rust_hawktracer v0.7.0 Compiling addr2line v0.16.0 Compiling plotters-svg v0.3.1 Compiling unicode-normalization v0.1.19 Compiling libloading v0.5.2 Compiling libz-sys v1.1.3 Compiling libgit2-sys v0.12.24+1.3.0 Compiling backtrace v0.3.62 Compiling num_cpus v1.13.0 Compiling quote v1.0.10 Compiling which v4.2.2 Compiling crossbeam-channel v0.5.1 Compiling aho-corasick v0.7.18 Compiling object v0.27.1 Compiling rustc_version v0.4.0 Compiling err-derive v0.2.4 Compiling atty v0.2.14 Compiling time v0.1.44 Compiling miow v0.3.7 Compiling terminal_size v0.1.17 Compiling ansi_term v0.12.1 Compiling ctrlc v3.2.1 Compiling bitvec v0.19.5 Compiling idna v0.2.3 Compiling simd_helpers v0.1.0 Compiling plotters v0.3.1 Compiling regex v1.5.4 Compiling cexpr v0.4.0 Compiling clap v2.33.3 Compiling console v0.15.0 Compiling mio v0.7.14 Compiling crossbeam-deque v0.8.1 Compiling url v2.2.2 Compiling chrono v0.4.19 Compiling stfu8 v0.2.4 Compiling synstructure v0.12.6 Compiling unicode-linebreak v0.1.2 Compiling indicatif v0.17.0-beta.1 Compiling thiserror-impl v1.0.30 Compiling num-derive v0.3.3 Compiling enum-iterator-derive v0.7.0 Compiling arg_enum_proc_macro v0.3.1 Compiling strum_macros v0.22.0 Compiling vergen v3.0.4 (https://github.com/xiph/rav1e#9417a4df) Compiling vergen v5.1.16 Compiling getset v0.1.1 Compiling structopt-derive v0.4.18 Compiling thiserror v1.0.30 Compiling enum-iterator v0.7.0 Compiling strum v0.22.0 Compiling structopt v0.3.25 Compiling failure v0.1.8 Compiling av-data v0.3.0 Compiling flexi_logger v0.19.5 Compiling av-bitstream v0.1.2 Compiling nasm-rs v0.2.1 Compiling v_frame v0.2.4 (https://github.com/xiph/rav1e#9417a4df) Compiling vapoursynth v0.3.0 Compiling av-format v0.3.1 Compiling path_abs v0.5.1 Compiling dashmap v4.0.2 Compiling textwrap v0.14.2 Compiling rav1e v0.5.0-beta.2 (https://github.com/xiph/rav1e#9417a4df) Compiling av-ivf v0.2.2 Compiling ffmpeg-sys-next v4.4.0 error: failed to run custom build command for ffmpeg-sys-next v4.4.0

Caused by: process didn't exit successfully: D:\Video\av1\target\release\build\ffmpeg-sys-next-b583d6f23b6008db\build-script-build (exit code: 101) --- stdout Could not find ffmpeg with vcpkg: Could not look up details of packages in vcpkg tree could not read status file updates dir: The system cannot find the path specified. (os error 3) cargo:rerun-if-env-changed=LIBAVUTIL_NO_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-msvc cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_msvc cargo:rerun-if-env-changed=HOST_PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-msvc cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_msvc cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_PATH cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-msvc cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_msvc cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-msvc cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_msvc cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

--- stderr thread 'main' panicked at 'called Result::unwrap() on an Err value: "pkg-config" "--libs" "--cflags" "libavutil" did not exit successfully: exit code: 1 --- stderr Package libavutil was not found in the pkg-config search path. Perhaps you should add the directory containing libavutil.pc' to the PKG_CONFIG_PATH environment variable No package 'libavutil' found ', C:\Users\Ahmad\.cargo\registry\src\github.com-1ecc6299db9ec823\ffmpeg-sys-next-4.4.0\build.rs:701:14 note: run with RUST_BACKTRACE=1` environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: build failed

ahmadrr avatar Oct 31 '21 05:10 ahmadrr

That's a known issue that's being looked into.

menditsa avatar Oct 31 '21 09:10 menditsa

@ahmadrr We now have the 0.2.0 release available here on GitHub which contains a Windows av1an binary you can download, built with the ffmpeg_static feature enabled.

redzic avatar Nov 01 '21 09:11 redzic

When I was compiling Av1an on Linux I had to install additional packages.

package manager install pkg-config libavutil-dev libavformat-dev libavfilter-dev

jacksalssome avatar Dec 06 '21 13:12 jacksalssome

Is there a workaround currently? I can't install av1an through cargo in cause of this issue.

mattipunkt avatar Jul 22 '23 10:07 mattipunkt

Having the same issue

Melechtna avatar Nov 11 '23 20:11 Melechtna

For me on Clear Linux, installing devpkg-not-ffmpeg fixed it.

trixoniisama avatar Jan 04 '24 15:01 trixoniisama

Similar issue in Fedora 39:

  --- stderr
  thread 'main' panicked at /home/lamy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ffmpeg-sys-the-third-1.1.1+ffmpeg-6.0/build.rs:714:14:
  called `Result::unwrap()` on an `Err` value: 
  pkg-config exited with status code 1
  > PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libavutil

  The system library `libavutil` required by crate `ffmpeg-sys-the-third` was not found.
  The file `libavutil.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  The PKG_CONFIG_PATH environment variable is not set.

  HINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `libavutil.pc`.

  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `av1an v0.4.1`, intermediate artifacts can be found at `/tmp/cargo-installw9c0yC`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
$ dnf search libavutil
Last metadata expiration check: 2:11:42 ago on Wed 24 Jan 2024 21:39:35 CET.
============================================= Name Matched: libavutil ==============================================
libavutil-free.i686 : FFmpeg's utility library
libavutil-free.x86_64 : FFmpeg's utility library
libavutil-free-devel.i686 : Development files for FFmpeg's utility library
libavutil-free-devel.x86_64 : Development files for FFmpeg's utility library
  • libavutil-free-devel is conflicting with ffmpeg
$ sudo dnf install -y libavutil-free-devel
Place your right ring finger on the fingerprint reader
FirefoxPWA                                                                          200  B/s | 833  B     00:04    
Error: 
 Problem: package libavutil-free-devel-6.0-11.fc39.i686 from fedora requires libavutil-free(x86-32) = 6.0-11.fc39, but none of the providers can be installed
  - conflicting requests
  - libavutil-free-6.0-11.fc39.i686 from fedora  does not belong to a distupgrade repository
  - package libavutil-free-devel-6.0-11.fc39.x86_64 from fedora requires libavutil-free(x86-64) = 6.0-11.fc39, but none of the providers can be installed
  - problem with installed package ffmpeg-libs-6.0.1-3.fc39.x86_64
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from @System conflicts with libavutil-free provided by libavutil-free-6.0-11.fc39.x86_64 from fedora
  - package ffmpeg-libs-6.0-16.fc39.x86_64 from rpmfusion-free conflicts with libavutil-free provided by libavutil-free-6.0-11.fc39.x86_64 from fedora
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from rpmfusion-free-updates conflicts with libavutil-free provided by libavutil-free-6.0-11.fc39.x86_64 from fedora
  - package libavutil-free-devel-6.0.1-2.fc39.i686 from updates requires libavutil-free(x86-32) = 6.0.1-2.fc39, but none of the providers can be installed
  - libavutil-free-6.0.1-2.fc39.i686 from updates  does not belong to a distupgrade repository
  - package libavutil-free-devel-6.0.1-2.fc39.x86_64 from updates requires libavutil-free(x86-64) = 6.0.1-2.fc39, but none of the providers can be installed
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from @System conflicts with libavutil-free provided by libavutil-free-6.0.1-2.fc39.x86_64 from updates
  - package ffmpeg-libs-6.0-16.fc39.x86_64 from rpmfusion-free conflicts with libavutil-free provided by libavutil-free-6.0.1-2.fc39.x86_64 from updates
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from rpmfusion-free-updates conflicts with libavutil-free provided by libavutil-free-6.0.1-2.fc39.x86_64 from updates
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)

lamyergeier avatar Jan 24 '24 22:01 lamyergeier

@lamyergeier

Try sudo dnf install -y ffmpeg-devel

postpersonality avatar Feb 05 '24 08:02 postpersonality