Open anandijain opened 6 months ago
There are multiple features with the same name pattern.
ffmpeg_4_3
ffmpeg_5_0
ffmpeg_6_0
etc.
These are set automatically by the build script so that the library (and you, as a user) can know which FFmpeg version is used to compile.
If you see something annotated with #[cfg(not(feature = "ffmpeg_5_0"))]
, that generally means the API was removed with the FFmpeg 5.0 release. The other way around (#[cfg(feature = "ffmpeg_5_0")]
) means that the API was added to FFmpeg in FFmpeg 5.0.
In this exact case, it looks like the API was replaced by av_muxer_iterate
and av_demuxer_iterate
. I don't think that the new API is supported by the FFmpeg library yet, but you can probably do it manually if you check out the FFmpeg docs.
Something like:
unsafe {
let mut ptr = std::ptr::null_mut();
loop {
// or av_demuxer_iterate
let muxer = av_muxer_iterate(&mut ptr);
if muxer.is_null() {
break;
}
// do something with (*muxer)
}
}
I was looking to write a script that lists all of the video codecs, and I see both
format::register_all()
andformat::list()
https://docs.rs/ffmpeg-the-third/latest/ffmpeg_the_third/format/fn.register_all.htmlI noticed in the source that it has the
#[cfg(not(feature = "ffmpeg_5_0"))]
annotation on it. But when I runcargo feature ffmpeg-the-third
I don't see that in the list of features (shown at bottom).Rust-analyzer indicated that
ffmpeg_5_0
was enabled, so I tried turning off the default features withffmpeg-the-third = {version = "1.2.2", default-features = false}
as the dep entry, but that gives me a build error (shown below).If I try to verify that the
ffmpeg_5_0
feature is really off, the script runs with no issues. There is probably something about feature flags that I don't understand.The config info is printed just fine, indicating that the feature is not enabled. But if I try
format::register_all();
after theinit()
I get:Any advice or help in listing all the codecs would be greatly appreciated. Thank you
no default-features build log
``` PS C:\Users\anand\.rust\streamcam> c r --release Compiling ffmpeg-the-third v1.2.2+ffmpeg-6.0 Compiling ffmpeg-sys-the-third v1.1.1+ffmpeg-6.0 error: failed to run custom build command for `ffmpeg-sys-the-third v1.1.1+ffmpeg-6.0` Caused by: process didn't exit successfully: `C:\Users\anand\.rust\streamcam\target\release\build\ffmpeg-sys-the-third-a83a64ad448b3207\build-script-build` (exit code: 101) --- stdout vcpkg build helper copied C:\Users/anand/src/cpp/vcpkg/installed\x64-windows\bin\avcodec-60.dll to C:\Users\anand\.rust\streamcam\target\release\build\ffmpeg-sys-the-third-f17c12062f3b1657\out\avcodec-60.dll vcpkg build helper copied C:\Users/anand/src/cpp/vcpkg/installed\x64-windows\bin\avdevice-60.dll to C:\Users\anand\.rust\streamcam\target\release\build\ffmpeg-sys-the-third-f17c12062f3b1657\out\avdevice-60.dll vcpkg build helper copied C:\Users/anand/src/cpp/vcpkg/installed\x64-windows\bin\avfilter-9.dll to C:\Users\anand\.rust\streamcam\target\release\build\ffmpeg-sys-the-third-f17c12062f3b1657\out\avfilter-9.dll vcpkg build helper copied C:\Users/anand/src/cpp/vcpkg/installed\x64-windows\bin\avformat-60.dll to C:\Users\anand\.rust\streamcam\target\release\build\ffmpeg-sys-the-third-f17c12062f3b1657\out\avformat-60.dll vcpkg build helper copied C:\Users/anand/src/cpp/vcpkg/installed\x64-windows\bin\avutil-58.dll to C:\Users\anand\.rust\streamcam\target\release\build\ffmpeg-sys-the-third-f17c12062f3b1657\out\avutil-58.dll vcpkg build helper copied C:\Users/anand/src/cpp/vcpkg/installed\x64-windows\bin\swresample-4.dll to C:\Users\anand\.rust\streamcam\target\release\build\ffmpeg-sys-the-third-f17c12062f3b1657\out\swresample-4.dll vcpkg build helper copied C:\Users/anand/src/cpp/vcpkg/installed\x64-windows\bin\swscale-7.dll to C:\Users\anand\.rust\streamcam\target\release\build\ffmpeg-sys-the-third-f17c12062f3b1657\out\swscale-7.dll vcpkg build helper copied C:\Users/anand/src/cpp/vcpkg/installed\x64-windows\bin\pkgconf-5.dll to C:\Users\anand\.rust\streamcam\target\release\build\ffmpeg-sys-the-third-f17c12062f3b1657\out\pkgconf-5.dll cargo:rustc-link-search=native=C:\Users/anand/src/cpp/vcpkg/installed\x64-windows\lib cargo:rustc-link-search=native=C:\Users/anand/src/cpp/vcpkg/installed\x64-windows\bin cargo:rustc-link-lib=avcodec cargo:rustc-link-lib=avdevice cargo:rustc-link-lib=avfilter cargo:rustc-link-lib=avformat cargo:rustc-link-lib=avutil cargo:rustc-link-lib=swresample cargo:rustc-link-lib=swscale cargo:rustc-link-lib=pkgconf cargo:rustc-link-search=native=C:\Users\anand\.rust\streamcam\target\release\build\ffmpeg-sys-the-third-f17c12062f3b1657\out cargo:rustc-link-search=C:\Users\anand\.rust\streamcam\target\release\build\ffmpeg-sys-the-third-f17c12062f3b1657\out OPT_LEVEL = Some("3") HOST = Some("x86_64-pc-windows-msvc") cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc CC_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc CC_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CC HOST_CC = None cargo:rerun-if-env-changed=CC CC = None cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS CRATE_CC_NO_DEFAULTS = None CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2") DEBUG = Some("false") cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc CFLAGS_x86_64-pc-windows-msvc = None cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc CFLAGS_x86_64_pc_windows_msvc = None cargo:rerun-if-env-changed=HOST_CFLAGS HOST_CFLAGS = None cargo:rerun-if-env-changed=CFLAGS CFLAGS = None check.c C:\Users\anand\src\cpp\vcpkg\installed\x64-windows\include\libavutil\common.h(209): warning C4244: 'return': conversion from 'int' to 'uint8_t', possible loss of data C:\Users\anand\src\cpp\vcpkg\installed\x64-windows\include\libavutil\common.h(220): warning C4244: 'return': conversion from 'int' to 'int8_t', possible loss of data C:\Users\anand\src\cpp\vcpkg\installed\x64-windows\include\libavutil\common.h(231): warning C4244: 'return': conversion from 'int' to 'uint16_t', possible loss of data C:\Users\anand\src\cpp\vcpkg\installed\x64-windows\include\libavutil\common.h(242): warning C4244: 'return': conversion from 'int' to 'int16_t', possible loss of data check.c(198): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(198): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(198): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(199): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(199): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(199): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(200): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(200): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(200): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(201): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(201): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(201): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(202): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(202): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(202): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(203): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(203): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(203): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(204): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(204): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(204): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(205): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(205): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(205): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(206): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(206): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(206): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(207): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(207): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(207): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(208): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(208): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(208): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(209): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(209): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(209): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(210): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(210): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(210): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(211): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(211): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(211): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(212): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(212): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(212): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(213): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(213): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(213): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(214): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(214): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(214): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(215): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(215): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(215): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(216): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(216): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(216): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(217): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(217): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(217): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(218): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(218): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(218): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(219): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(219): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(219): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(220): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(220): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(220): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(221): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(221): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(221): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(222): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(222): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(222): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(223): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(223): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(223): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(224): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(224): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(224): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(225): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(225): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(225): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(226): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(226): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(226): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(227): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(227): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(227): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(228): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(228): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(228): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(229): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(229): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(229): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(230): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(230): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(230): error C2065: 'LIBAVCODEC_VERSION_MINOR': undeclared identifier check.c(231): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(231): error C2065: 'LIBAVCODEC_VERSION_MAJOR': undeclared identifier check.c(231): fatal error C1003: error count exceeds 100; stopping compilation --- stderr cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release thread 'main' panicked at C:\Users\anand\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ffmpeg-sys-the-third-1.1.1+ffmpeg-6.0\build.rs:501:9: Compile failed note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ```ffmpeg-the-third feature list
``` PS C:\Users\anand\.rust\streamcam> c feature ffmpeg-the-third Avaliable features for `ffmpeg-the-third` default = ["codec", "device", "filter", "format", "software-resampling", "software-scaling", "non-exhaustive-enums"] build = ["static", "ffmpeg-sys-the-third/build"] build-lib-aacplus = ["ffmpeg-sys-the-third/build-lib-aacplus"] build-lib-ass = ["ffmpeg-sys-the-third/build-lib-ass"] build-lib-avs = ["ffmpeg-sys-the-third/build-lib-avs"] build-lib-celt = ["ffmpeg-sys-the-third/build-lib-celt"] build-lib-dav1d = ["ffmpeg-sys-the-third/build-lib-dav1d"] build-lib-dcadec = ["ffmpeg-sys-the-third/build-lib-dcadec"] build-lib-faac = ["ffmpeg-sys-the-third/build-lib-faac"] build-lib-fdk-aac = ["ffmpeg-sys-the-third/build-lib-fdk-aac"] build-lib-fontconfig = ["ffmpeg-sys-the-third/build-lib-fontconfig"] build-lib-freebidi = ["ffmpeg-sys-the-third/build-lib-freebidi"] build-lib-freetype = ["ffmpeg-sys-the-third/build-lib-freetype"] build-lib-frei0r = ["ffmpeg-sys-the-third/build-lib-frei0r"] build-lib-gnutls = ["ffmpeg-sys-the-third/build-lib-gnutls"] build-lib-gsm = ["ffmpeg-sys-the-third/build-lib-gsm"] build-lib-ilbc = ["ffmpeg-sys-the-third/build-lib-ilbc"] build-lib-kvazaar = ["ffmpeg-sys-the-third/build-lib-kvazaar"] build-lib-ladspa = ["ffmpeg-sys-the-third/build-lib-ladspa"] build-lib-mp3lame = ["ffmpeg-sys-the-third/build-lib-mp3lame"] build-lib-opencore-amrnb = ["ffmpeg-sys-the-third/build-lib-opencore-amrnb"] build-lib-opencore-amrwb = ["ffmpeg-sys-the-third/build-lib-opencore-amrwb"] build-lib-opencv = ["ffmpeg-sys-the-third/build-lib-opencv"] build-lib-openh264 = ["ffmpeg-sys-the-third/build-lib-openh264"] build-lib-openjpeg = ["ffmpeg-sys-the-third/build-lib-openjpeg"] build-lib-openssl = ["ffmpeg-sys-the-third/build-lib-openssl"] build-lib-opus = ["ffmpeg-sys-the-third/build-lib-opus"] build-lib-schroedinger = ["ffmpeg-sys-the-third/build-lib-schroedinger"] build-lib-shine = ["ffmpeg-sys-the-third/build-lib-shine"] build-lib-smbclient = ["ffmpeg-sys-the-third/build-lib-smbclient"] build-lib-snappy = ["ffmpeg-sys-the-third/build-lib-snappy"] build-lib-speex = ["ffmpeg-sys-the-third/build-lib-speex"] build-lib-ssh = ["ffmpeg-sys-the-third/build-lib-ssh"] build-lib-stagefright-h264 = ["ffmpeg-sys-the-third/build-lib-stagefright-h264"] build-lib-theora = ["ffmpeg-sys-the-third/build-lib-theora"] build-lib-twolame = ["ffmpeg-sys-the-third/build-lib-twolame"] build-lib-utvideo = ["ffmpeg-sys-the-third/build-lib-utvideo"] build-lib-vmaf = ["ffmpeg-sys-the-third/build-lib-vmaf"] build-lib-vo-aacenc = ["ffmpeg-sys-the-third/build-lib-vo-aacenc"] build-lib-vo-amrwbenc = ["ffmpeg-sys-the-third/build-lib-vo-amrwbenc"] build-lib-vorbis = ["ffmpeg-sys-the-third/build-lib-vorbis"] build-lib-vpx = ["ffmpeg-sys-the-third/build-lib-vpx"] build-lib-wavpack = ["ffmpeg-sys-the-third/build-lib-wavpack"] build-lib-webp = ["ffmpeg-sys-the-third/build-lib-webp"] build-lib-x264 = ["ffmpeg-sys-the-third/build-lib-x264"] build-lib-x265 = ["ffmpeg-sys-the-third/build-lib-x265"] build-lib-xvid = ["ffmpeg-sys-the-third/build-lib-xvid"] build-license-gpl = ["ffmpeg-sys-the-third/build-license-gpl"] build-license-nonfree = ["ffmpeg-sys-the-third/build-license-nonfree"] build-license-version3 = ["ffmpeg-sys-the-third/build-license-version3"] build-pic = ["ffmpeg-sys-the-third/build-pic"] build-zlib = ["ffmpeg-sys-the-third/build-zlib"] codec = ["ffmpeg-sys-the-third/avcodec"] device = ["ffmpeg-sys-the-third/avdevice", "format"] filter = ["ffmpeg-sys-the-third/avfilter"] format = ["ffmpeg-sys-the-third/avformat", "codec"] non-exhaustive-enums = ["ffmpeg-sys-the-third/non-exhaustive-enums"] postprocessing = ["ffmpeg-sys-the-third/postproc"] resampling = ["ffmpeg-sys-the-third/avresample"] rpi = [] serialize = ["serde"] software-resampling = ["ffmpeg-sys-the-third/swresample"] software-scaling = ["ffmpeg-sys-the-third/swscale", "codec"] static = ["ffmpeg-sys-the-third/static"] image (optional) serde (optional) ```