[Libav-user] Can not load ffmpeg 3.4.1 under Android because link not found

Carl Eugen Hoyos ceffmpeg at gmail.com
Sun Jan 28 18:42:58 EET 2018


2018-01-26 23:02 GMT+01:00 Cooky <cookyinformation at gmail.com>:

> NDK=/home/urs/Documents/android-ndk-r12b

Unrelated: Isn't this old?

> SYSROOT=$NDK/platforms/android-14/arch-arm/
> TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
> function build_one
> {
> ./configure \
>     --prefix=$PREFIX \
>     --enable-shared \
>     --disable-static \
>     --disable-doc \

>     --disable-ffmpeg \
>     --disable-ffplay \
>     --disable-ffprobe \
>     --disable-ffserver \

There is --disable-programs

>     --disable-avdevice \
>     --disable-doc \

>     --disable-symver \

This is unneeded once you fix target-os below

>     --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \

>     --target-os=linux \

Should be android

>     --arch=arm \

>     --enable-cross-compile \

Unneeded with --cross-prefix

>     --sysroot=$SYSROOT \

>     --extra-cflags="-Os -fpic $ADDI_CFLAGS" \

If this is needed, it is a bug that we would like to know of.
As-is, this makes your bug report invalid because we only
support flags for paths here, not other flags.

There is --enable-small and --cpu which you probably want.

>     --extra-ldflags="$ADDI_LDFLAGS" \
>     $ADDITIONAL_CONFIGURE_FLAG
> make clean
> make
> make install
> }
>
>
> CPU=armv7-a
> PREFIX=$(pwd)/android/$CPU
> ADDI_CFLAGS="-marm -march=$CPU"
> build_one
>
>
>
> with the same script i can also compile the version 3.4.1.
>
> The problem is, if i try to load the libs under Android with
>
> Java.Lang.JavaSystem.LoadLibrary("avutil-55");
> Java.Lang.JavaSystem.LoadLibrary("swresample-2");
> Java.Lang.JavaSystem.LoadLibrary("avcodec-57");
> ...
> avutil-55 and swresample-2 load fine, but avcodec-57 fails with the error
> message:
>
>
> Java.Lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol
> "ff_h264_mediacodec_hwaccel" referenced by
> "/data/app/App12.App12-1/lib/arm/libavcodec-57.so"...

My suspicion is that you forgot once to run "make distclean",
your configure line should not allow this symbol to be created.

Carl Eugen


More information about the Libav-user mailing list