Closed J-Mook closed 5 months ago
Hi, I'm trying to reproduce the error, but it looks like ffmpeg-next
requires some specific system librareis.
thread 'main' panicked at C:\Users\temed\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ffmpeg-sys-next-6.1.0\build.rs:734:22:
called `Result::unwrap()` on an `Err` value:
pkg-config exited with status code 1
> PKG_CONFIG_PATH=C:\cfg PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libavformat
The system library `libavformat` required by crate `ffmpeg-sys-next` was not found.
The file `libavformat.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
PKG_CONFIG_PATH contains the following:
- C
- \cfg
HINT: you may need to install a package such as libavformat, libavformat-dev or libavformat-devel.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I'm on Windows 11 just like you. Could you describe how you installed ffmpeg
system libraries for me?
if vcpkg installed on you, Only need following code.
vcpkg install ffmpeg --triplet=x64-windows
(maybe installing with around 30 min)
After installed ffmpeg to use vcpkg, if appear the following error, you can install MSYS2 and following gcc compiler
Unable to find libclang: "couldn't find any valid shared libraries matching: ['clang.dll', 'libclang.dll'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"
pacman -S mingw-w64-i686-gcc
pacman -S mingw-w64-x86_64-gcc
I also tried tons of thing to solve installing ffempg problem. it could be not working on your computer.
if not working these solutions, i can say more options to install ffmpeg
the error is generated at load_as.dart>>loadRustLibrary() function.
the function can find hub.dll, but can't find other dll which related ffmpeg.
/avcodec-60.dll
/avdevice-60.dll
/avfilter-9.dll
/avformat-60.dll
/avutil-58.dll
/swresample-4.dll
/swscale-7.dll
located at (Path to ffmpeg)\ffmpeg_x64-windows\bin
So, you can solve this error by putting the above dll file in the exe file location (e.g. \build\windows\x64\runner\Debug).
Congratulations! Thank you so much for sharing the info :)
Report
I'm making windows desktop app using ffmpeg crate.
Excately there is "hub.dll" with compiled .exe file
Steps to Reproduce
I added ffmpeg-next = "6.1.1" at \native\hub\Cargo.toml to use ffmpeg.
Cargo.toml
when i use ffmpeg-next crate, above problem which load fail hub.dll. For example just (Example Code for using ffmpeg-next)
just remove which using ffmpeg code, the error would disappear.
System Information