It is an Android application related to video process.
The library used is ffmpeg + x264
, and compiled loosely based on the work of ffmpeg_vitamio
Compiling of ffmpeg is good, and libffmpeg.so is created according to the below:
$CC -lx264 -lm -lz -shared --sysroot=$SYSROOT -Wl,--no-undefined -Wl,-z,noexecstack $EXTRA_LDFLAGS libavutil/*.o libavutil/arm/*.o libavcodec/*.o libavcodec/arm/*.o libavformat/*.o libswresample/*.o libswresample/arm/*.o libswscale/*.o -o $PREFIX/libffmpeg.so
here libx264 to be included is a shared library, renamed from libx264.so.130
Then I put libffmpeg.so
in my Android project.
The compile is fine. But when running, the errors are:
05-21 13:17:45.066: E/AndroidRuntime(3973): FATAL EXCEPTION: main
05-21 13:17:45.066: E/AndroidRuntime(3973): java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libx264.so.130" needed by "libffmpeg.so"; caused by load_library(linker.cpp:745): library "libx264.so.130" not found
I think when creating libffmpeg.so, I have used -lx264 I thought all link libraries will be included to the final output library.
But anyway, let me try to find out solutions. I put libx264.so or libx264.so.130 in several directories, such as in /jni, /libs, /obj etc.
Or I also tried to add -lx264 in Android.mk in the jni.
But the same error exist.
So my questions are: (1) when gcc creates a shared library, does the output .so library include the linked shared library, here libx264.so?
(2) What is wrong with my above project?