[FFmpeg-user] Cross-compile ffmpeg with android ndk and libspeex fails

Marcin Griszbacher marcin.griszbacher at gmail.com
Tue Sep 20 11:05:04 EEST 2016


> On Sep 20, 2016, at 9:18 AM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> 
> 2016-09-20 8:16 GMT+02:00 Marcin Griszbacher <marcin.griszbacher at gmail.com>:
>> 
>>> On Sep 19, 2016, at 9:29 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
>>> 
>>> 2016-09-19 19:37 GMT+02:00 Marcin Griszbacher <marcin.griszbacher at gmail.com>:
>>>> Hello. I need to build ffmpeg as library for android. I use slightly modified
>>>> bambuser script
>>> 
>>> Such scripts are not supported here, we only support our configure script;-(
>> 
>> I said that I am using it since it’s the only working solution I found on ffmpeg
>> site for Android platform :)
> 
> Please elaborate!
> So far, all scripts I have seen are severely broken, and offer no
> advantages over
> configure, so this seems like a documentation issue to me.

I might be wrong since I am definitely bad at this, but “compilation guide” for android points to 5 different links, all of them using old versions of ffmpeg if I recall correctly. Only way for me to get .so libraries for different architectures (I managed to get armeabi and armeabi-v7a, I fail to get x86 as well) was to use Bambuser one - and still it needed to be modified a bit to be used with current version of ffmpeg. If there’s a way to configure and compile for android easier, then I’ll be happy to hear it, I hate current form of my script and inability to get all possible architectures’ libraries. :)

> 
>> I am 100% sure that I can find Speex in /usr/local/include/speex/{headers}
>> and /usr/local/lib/libspeex.*
> 
> You put your arm binary into /usr/local/lib, really?

At this point it should be clear I have no clue how to do this at all (and I am not really proficient with unix-based systems yet). I tried to follow anything that could let me build this with speex and I guess I found that somewhere and did the same without thinking it might be wrong. I guess at this point I could use ANY kind of help.

> 
>> --target-os=linux
> 
> Should be --target-os=android
> 
>> --disable-symver
> 
> Should not be necessary
> 
>> --disable-everything
> 
> This is a debug option, it may be useful to test --enable-speex, you should
> not use it for production.
> (You may want --disable-all if you need smaller libraries)
> 
>> --extra-cflags= -I/usr/local/include/ --extra-ldflags= -L/usr/local/lib/
> 
> These are necessary although surprising, see above.
> 
>> -Ispeex
> 
> Copy/paste error, this was -lspeex in my mail.

Most likely because I wrote this down instead of copying it (and my default font has no difference between I and l). About the other ones, I followed your advices. However after adding -lspeex (instead of -Ispeex) it’s not about libspeex not found anymore, but about failing C compiler test:

arm-linux-androideabi-gcc --sysroot=/Users/mgriszbacher/Library/Android/sdk/ndk-bundle/platforms/android-16/arch-arm -isysroot /Users/mgriszbacher/Library/Android/sdk/ndk-bundle/platforms/android-16/arch-arm -I/usr/local/include/ -march=armv5te -c -o /tmp/ffconf.5JfsnVdR.o /tmp/ffconf.lsAQ7zR9.c
arm-linux-androideabi-gcc -L/usr/local/lib/ -lspeex --sysroot=/Users/mgriszbacher/Library/Android/sdk/ndk-bundle/platforms/android-16/arch-arm -isysroot /Users/mgriszbacher/Library/Android/sdk/ndk-bundle/platforms/android-16/arch-arm -march=armv5te -o /tmp/ffconf.VD0JgLsq /tmp/ffconf.5JfsnVdR.o
/Users/mgriszbacher/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: speex: no archive symbol table (run ranlib)
collect2: error: ld returned 1 exit status
C compiler test failed.

> 
>> ld: error: speex: no archive symbol table (run ranlib)
> 
> Please run "file /usr/local/lib/libspeex* and consider doing what the
> error message suggests.

I ran “file /usr/local/lib/libspeex*” in terminal and got no error:

$ file /usr/local/lib/libspeex*
/usr/local/lib/libspeex.1.5.0.dylib:    Mach-O 64-bit dynamically linked shared library x86_64
/usr/local/lib/libspeex.1.dylib:        Mach-O 64-bit dynamically linked shared library x86_64
/usr/local/lib/libspeex.a:              current ar archive random library
/usr/local/lib/libspeex.dylib:          Mach-O 64-bit dynamically linked shared library x86_64
/usr/local/lib/libspeex.la:             libtool library file
/usr/local/lib/libspeexdsp.1.5.0.dylib: Mach-O 64-bit dynamically linked shared library x86_64
/usr/local/lib/libspeexdsp.1.dylib:     Mach-O 64-bit dynamically linked shared library x86_64
/usr/local/lib/libspeexdsp.a:           current ar archive random library
/usr/local/lib/libspeexdsp.dylib:       Mach-O 64-bit dynamically linked shared library x86_64


> 
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list