Skip to content

can not find the h264 encoder by avcodec_find_encoder #69

@kyrosle

Description

@kyrosle
  • main.rs
fn main() {
  unsafe {
    let ptr = ffmpeg_sys_next::avcodec_find_encoder(
      ffmpeg_sys_next::AVCodecID::AV_CODEC_ID_H264
    );
    assert!(!ptr.is_null())
  }
}
  • Carog.toml
[package]
name = "setting_test"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ffmpeg-sys-next = { path = "../", features = [ // this example writing inside the ffmpeg-sys-next repo
  "build",
  "build-license-gpl",
  "build-license-nonfree",
  "build-lib-x264"
] }

console out:

Caused by:
  process didn't exit successfully: `/Users/kyros/MyProject/libs/rust-ffmpeg-sys/target/debug/build/ffmpeg-sys-next-ee8dfd2e99237b2f/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-search=native=/Users/kyros/MyProject/libs/rust-ffmpeg-sys/target/debug/build/ffmpeg-sys-next-d76d0e8e39f17cc2/out/dist/lib
  cargo:rustc-link-lib=static=avcodec
  cargo:rustc-link-lib=static=avdevice
  cargo:rustc-link-lib=static=avfilter
  cargo:rustc-link-lib=static=avformat
  cargo:rustc-link-lib=static=avutil
  cargo:rustc-link-lib=static=swresample
  cargo:rustc-link-lib=static=swscale
  configure: ERROR: x264 not found using pkg-config

  If you think configure made a mistake, make sure you are using the latest
  version from Git.  If the latest version fails, report the problem to the
  ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
  Include the log file "ffbuild/config.log" produced by configure as this will help
  solve the problem.


  --- stderr
  Cloning into 'ffmpeg-6.1'...
  thread 'main' panicked at build.rs:657:21:
  called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "configure failed " }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

rust version:

rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.75.0 (82e1608df 2023-12-21)`

platform:

  • macos 14.3.1 23D60 arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions