CANNOT LINK EXECUTABLE "ffmpeg" : library "libavdevice.so" not found
When I integrate the lib android-ffmpeg to my project ( I compile the file ffmpeg ,ffprobe myself whith ndk-r20 and ffmpeg-4.2.1 ), and then run the project, it got an error:
D/FFmpeg: Build.SUPPORTED_ABI : arm64-v8a
D/FFmpeg: ffmpeg is ready!
D/FFmpeg: Build.SUPPORTED_ABI : arm64-v8a
D/FFmpeg: ffprobe is ready!
D/FFmpeg: Running publishing updates method
D/FFmpeg: Running publishing updates method
D/ZrHung.AppEyeUiProbe: notify runnable to start.
D/MainActivity: CANNOT LINK EXECUTABLE "/data/user/0/com.hy.ndk.ffmpegstudy/files/ffmpeg": library "libavdevice.so" not found
E/MainActivity: CANNOT LINK EXECUTABLE "/data/user/0/com.hy.ndk.ffmpegstudy/files/ffmpeg": library "libavdevice.so" not found
D/MainActivity: CANNOT LINK EXECUTABLE "/data/user/0/com.hy.ndk.ffmpegstudy/files/ffprobe": library "libavdevice.so" not found
E/MainActivity: CANNOT LINK EXECUTABLE "/data/user/0/com.hy.ndk.ffmpegstudy/files/ffprobe": library "libavdevice.so" not found
i have the library "libavdevice.so", i don't know why it happens. How to solve it?
here is my compile bash (in centos-7)
#!/bin/bash
set -x
API=19
NDK=/opt/android-ndk-r20
CPU=arm64-v8a
PREFIX=/opt/ffmpeg-android/$CPU
TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64
SYSROOT=${TOOLCHAIN}/sysroot
function function_one
{
./configure \
--prefix=$PREFIX \
--enable-shared \
--enable-static \
--disable-doc \
--disable-ffplay \
--enable-ffprobe \
--disable-symver \
--enable-ffmpeg \
--cc=$TOOLCHAIN/bin/aarch64-linux-android21-clang \
--cross-prefix=$TOOLCHAIN/bin/aarch64-linux-android- \
--target-os=android \
--arch=aarch64 \
--cpu=armv8-a \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-cflags="-O3 -fPIC -I$NDK/sysroot/usr/include/aarch64-linux-android -isysroot $NDK/sysroot -DANDROID -D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated -mfloat-abi=softfp -marm -march=armv8-a" \
--enable-neon
make clean all
make -j8
make install
}
function_one
I used file ffmpeg,ffprobe from your project, then it works well.
But i don't know how to compile these files, in your project, the size of file ffmpeg and ffprobe nearly 20MB, when i compile it myself, it is just 200KB, can you tell me how you compile it please?
Hello.. I am getting same error. any solution?