rusty_ffmpeg icon indicating copy to clipboard operation
rusty_ffmpeg copied to clipboard

adds proper dynamic linking

Open lattice0 opened this issue 3 years ago • 5 comments

dynamic linking was trying to link to a single file

this adds dynamic linking to the various .so files

tested and worked

lattice0 avatar Jun 22 '22 21:06 lattice0

I also added multi architecture build. Sometimes when you want to build an Android APK you need a way of passing a single directory with .so files for every architecture.

Now with

FFMPEG_MULTI_ARCH_BUILD=1

FFMPEG_LIBS_DIR will be used as a base, and it will do like this

FFMPEG_LIBS_DIR/{target_os}/target_arch/

and it will search for the libs in this folder.

lattice0 avatar Jun 22 '22 22:06 lattice0

would be nice to have this merged :)

lattice0 avatar Jul 24 '22 04:07 lattice0

How to build for android and iOS ?

I had bulit ffmpeg-kit ,

and add this to cargo.toml rusty_ffmpeg = { git = "https://github.com/lattice0/rusty_ffmpeg.git", branch = "master" }

then run cargo ndk build FFMPEG_PKG_CONFIG_PATH=/Volumes/DATA/Projects/ffmpeg-kit/prebuilt/android-arm64/ffmpeg/lib/pkgconfig cargo ndk -t arm64-v8a build

error: failed to run custom build command for `rusty_ffmpeg v0.10.0+ffmpeg.5.1`

Caused by:
  process didn't exit successfully: `/Volumes/DATA/Projects/bili-cli-rs/target/debug/build/rusty_ffmpeg-e44e608450ec302b/build-script-build` (exit status: 101)

  --- stderr
  thread 'main' panicked at 'avcodec not found!', /Volumes/DATA/Runtimes/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_ffmpeg-0.10.0+ffmpeg.5.1/build.rs:247:37
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
✗ ls /Volumes/DATA/Projects/ffmpeg-kit/prebuilt/android-arm64/ffmpeg/lib/
libavcodec.so    libavfilter.so   libavutil.so     libswscale.so
libavdevice.so   libavformat.so   libswresample.so pkgconfig

niuhuan avatar Nov 13 '22 04:11 niuhuan