rusty_ffmpeg icon indicating copy to clipboard operation
rusty_ffmpeg copied to clipboard

opencv-rust compatability

Open dominikWin opened this issue 1 year ago • 2 comments

Rust's opencv bindings used to just work with rusty_ffmpeg, but switching from 0.14 to 0.15 breaks linking.

Adding this line to any Cargo.toml using rusty_ffmpeg v0.15+ causes this issue:

opencv = { version = "0.93.1", default-features = false, features = ["clang-runtime"] }
/usr/bin/ld: /workspaces/myproject/ffmpeg/./libavutil/timestamp.h:76: undefined reference to `av_ts_make_time_string2'
/usr/bin/ld: /workspaces/myproject/ffmpeg/./libavutil/timestamp.h:76: undefined reference to `av_ts_make_time_string2'
/usr/bin/ld: /workspaces/myproject/ffmpeg/./libavutil/timestamp.h:76: undefined reference to `av_ts_make_time_string2'
/usr/bin/ld: /workspaces/myproject/ffmpeg/./libavutil/timestamp.h:76: undefined reference to `av_ts_make_time_string2'

Tested with FFmpeg 7.0 and 7.1

dominikWin avatar Oct 04 '24 20:10 dominikWin

Turns out the issue is in linking_with_pkg_config when introduced here.

This old behavior works fine:

.statik(true).cargo_metadata(true)

The new behavior (.cargo_metadata(false)) is what causes the linker failure

dominikWin avatar Oct 04 '24 20:10 dominikWin

Seems like the build.rs linking was updated recently with 0.16.3. With these changes there are no longer build failures, but there are memory issues causing segfaults on a bunch of struct member accesses. Weird. Using .statik(true).cargo_metadata(true) still fixes this.

dominikWin avatar Jun 22 '25 19:06 dominikWin