Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build it under windows please ? #108

Open
jalba69 opened this issue Feb 26, 2018 · 7 comments
Open

How to build it under windows please ? #108

jalba69 opened this issue Feb 26, 2018 · 7 comments

Comments

@jalba69
Copy link

jalba69 commented Feb 26, 2018

Hello,
I need Rust-ffmpeg to build Gifski with video support in it (here https://github.com/ImageOptim/gifski ) , but rust-ffmpeg always fails to build.

cloning the rust ffmpeg repo and trying to build it, alone, and i get this

H:\rust-ffmpeg>cargo build --release
   Compiling ffmpeg-sys v3.4.1
error: failed to run custom build command for `ffmpeg-sys v3.4.1`
process didn't exit successfully: `H:\rust-ffmpeg\target\release\build\ffmpeg-sy
s-9c2b3fa23df71254\build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: MSVC', s
rc\libcore\result.rs:916:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Enabling backtrace :

H:\rust-ffmpeg>cargo build --release
   Compiling ffmpeg-sys v3.4.1
error: failed to run custom build command for `ffmpeg-sys v3.4.1`
process didn't exit successfully: `H:\rust-ffmpeg\target\release\build\ffmpeg-sys-9c2b3fa23df71254\b
uild-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: MSVC', src\libcore\result.rs
:916:5
stack backtrace:
   0: <std::sync::condvar::WaitTimeoutResult as core::fmt::Debug>::fmt
   1: <std::time::SystemTimeError as core::fmt::Display>::fmt
   2: std::panicking::Location::column
   3: std::panicking::Location::column
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::begin_panic_fmt
   6: std::panicking::begin_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::result::unwrap_failed
  10: <alloc::vec::Vec<T> as core::ops::drop::Drop>::drop
  11: bindgen::Bindings::write_to_file
  12: std::panicking::update_panic_count
  13: _rust_maybe_catch_panic
  14: std::rt::lang_start_internal
  15: main
  16: __scrt_common_main_seh
             at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283
  17: BaseThreadInitThunk

I'm using Rust stable-x86_64-pc-windows-msvc 1.24.0
Visual Studio 2017
win 7 x64 pro

I don't know what to do at this point, also got similar errors when trying to build rust-ffmpeg-sys alone...

So any good soul have an idea or tips about how to build this under windows please ?

Thanks in advance.

@Niedzwiedzw
Copy link

+1 for that, I also need this under windows and it fails to compile. could someone provide instructions on how to install ffmpeg so it is seen by cargo?

@woubuc
Copy link

woubuc commented Dec 23, 2019

+1 some documentation for Windows platform would be useful.

@klesun
Copy link

klesun commented Apr 9, 2021

I'm getting same error on linux.

error: failed to run custom build command for `ffmpeg-sys v4.2.1`

Caused by:
  process didn't exit successfully: `/home/klesun/gits/detect-still-frames/target/release/build/ffmpeg-sys-3f4eadb171eb941b/build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=LIBAVUTIL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  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-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  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-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  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: Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"libavutil\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package libavutil was not found in the pkg-config search path.\nPerhaps you should add the directory containing `libavutil.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'libavutil\' found\n" } }', /home/klesun/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/ffmpeg-sys-4.2.1/build.rs:650:14
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Guess I need to install libavutil somehow...

Solution here: #126

@meh
Copy link
Owner

meh commented Apr 9, 2021

No, you need to install pkg-config or use a nix-shell.

@klesun
Copy link

klesun commented Apr 9, 2021

Hm, if you are replying to me, I am using a unix shell, I'm on ubuntu.
Clean error output:

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

I seem to have some:

/usr/lib/x86_64-linux-gnu/libavutil.so.56

I wonder if that's what I'm supposed to specify in the env variable...

@meh
Copy link
Owner

meh commented Apr 9, 2021

@klesun I am, and I'm talking about Nix the package manager, not nix as in UNIX.

@klesun
Copy link

klesun commented Apr 9, 2021

Hm, thanks for help, but may I clarify, to add this library cargo dependency in my project I need to somehow get use of NixOS?

I believe I do have pkg-config installed:

klesun@kunkka:~$ pkg-config --version
0.29.1

Upd.: oh, sorry, only now realized this issue was about building the rust-ffmpeg itself, not building a project that depends on it's cargo package...

Upd.: I found out that to solve the issue of missing libavutil I had to:

sudo apt-get install libavutil-dev

Though then I got another missing dependency reported, this time it's libavformat.pc. Hope when I install each of them the lib will work... 🥺

Upd.: yes, it did!

The list of missing dependencies you need to install to make build work:

sudo apt-get install libavutil-dev
sudo apt-get install libavformat-dev
sudo apt-get install libavfilter-dev
sudo apt-get install libavdevice-dev
sudo apt-get install libclang-dev

Guess I'm not the first who faced the issue of missing dev libraries in the system: #47

I wonder how should they be installed on windows... =/

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

No branches or pull requests

5 participants