rust-ffmpeg
rust-ffmpeg copied to clipboard
error: failed to run custom build command for `ffmpeg-sys-next v6.0.1`
I'm trying to build a cargo with RUST but I always seem to get this error upon installing these ffmpeg crates
**error: failed to run custom build command for ffmpeg-sys-next v6.0.1
Caused by:
process didn't exit successfully: G:\Documents\ghwt-de-volatile-master\rust-ffmpeg\target\debug\build\ffmpeg-sys-next-633df82b3238d16e\build-script-build
(exit code: 101)
--- stdout
Could not find ffmpeg with vcpkg: Could not find library in Vcpkg tree package ffmpeg is not installed for vcpkg triplet x64-windows
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
error: could not find system library 'libavutil' required by the 'ffmpeg-sys-next' crate
--- 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\Diego\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ffmpeg-sys-next-6.0.1\build.rs:715:14 note: run with
RUST_BACKTRACE=1` environment variable to display a backtrace**
Can anybody help me with this issue? Thank you!
I had the same with libavfilter
and libavdevice
, turns out ffmpeg-sys-next
6.0.1 needs both of them, so the necessary packages to install are (excerpt from my devcontainer's Dockerfile):
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
clang \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
pkg-config
I am also having the same problem, did you solve it ?
Hi, how to fix it in Windows?
try this: vcpkg install ffmpeg:x64-windows
I managed to fix it after 7 hours of work. What I did was using the GNU build guide found in the build wiki of this repo. Afterwards I: installed vcpkg ran vcpkg integrate install ran: vcpkg install ffmpeg[core,avcodec,avformat,swscale,avdevice,avfilter] --triplet x64-windows --recurse The avdevice component includes libavdevice, and the avfilter component includes libavfilter.
You should than get this error: usr/include/libswresample/swresample.h is missing error (or something along these lines, it will appear at the bottom of the screen) the file is located in this path (if you used the default download location for vcpkg) : C:\Users\USERNAME\vcpkg\buildtrees\ffmpeg\src\n5.1.2-f31542651f.clean (libswresample will be one of the folders in here) move it over to: C:\Users\USERNAME\vcpkg\installed\x64-windows\include
run cargo build again and it should work just fine.
#160 is a duplicate. I tried to answer there