3

Hi I successfully built the appunite ffmpeg library including arm-v7a neon support, however when I try to run the libraries on my Marshmallow device I get this error:

01-08 23:42:02.350: E/AndroidRuntime(10144): java.lang.UnsatisfiedLinkError:
 dlopen failed: /data/app/com.example.demo-1/lib/arm/libffmpeg-neon.so: has text relocations

When I use the non-neon builds it works without any problems.

So I googled a bit and found out, that this is probably a bug in the corresponding C/C++ code but on the other hand it should be fixed when rebuilt with with NDK v. 10e. This is what I did. But I still get these text relocations:

~/Projekte/AndroidFFmpeg$ /usr/Android/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-readelf -a library/src/main/jniLibs/armeabi-v7a/libffmpeg-neon.so  | grep TEXTREL
 0x00000016 (TEXTREL)                    0x0
 0x0000001e (FLAGS)                      SYMBOLIC TEXTREL

This questions seemed to be relevant, but didn't help:

"ffmpeg has text relocations" error in Android

libavcodec.so: has text relocations

How do I fix that?

Community
  • 1
  • 1
Denis Loh
  • 2,194
  • 2
  • 24
  • 38

1 Answers1

6

This should be fixed already (since commit https://git.libav.org/?p=libav.git;a=commitdiff;h=f963f80399d, December 2014), so make sure you build a new enough version and it should be fine.

arm, aarch64 and x86_64 should all work fine without text relocations, but for 32 bit x86, you can't easily avoid it. (For x86, the simplest way around it is to do --disable-asm, but that does give quite a bit of performance loss.)

mstorsjo
  • 12,983
  • 2
  • 39
  • 62
  • How to add this command in 'String[] complexCommand = {"-ss", "" + startMs / 1000, "-y", "-i", selectedVideoUri.getPath(), "-t", "" + (endMs - startMs) / 1000, "-vcodec", "mpeg4", "-b:v", "2097152", "-b:a", "48000", "-ac", "2", "-ar", "22050", filePath};' – jitain sharma Feb 21 '19 at 10:37