[FFmpeg-user] compiling for android

Patrick Shirkey pshirkey at boosthardware.com
Wed Jul 9 07:38:56 CEST 2014


On Wed, July 9, 2014 5:39 am, Carl Eugen Hoyos wrote:
> Patrick Shirkey <pshirkey <at> boosthardware.com> writes:
>
>> I have successfully compiled  and run ffmpeg and
>> ffserver on my android-4.4 device
>> using the ffmpeg4android scripts here:
>
> External build scripts are not supported here.
>

Understood.  I was hoping someone might know where to put the libx264.a
file so that the linker can find it.

FYI, for android FW developers this script is the most powerful of the
bunch as it allows building ffmpeg directly into the /external tree as a
default application.  It also builds ffserver and several other tools
(except ffplay) in both shared and static binaries. IMO this script should
be well understood by FFMPEG developers as it enables a nearly complete
ffmpeg solution to be bundled with the default android codebase.

All the other options I have found only do partial static builds. Also the
script works perfectly if I do not try to include x264 so all round it is
quite an accomplishment.


>> 2:  Using the standard build method
>>
>>     ./configure;make
>>
>> I cannot get past the error for sincos/sincosf which
>> is not accessible in the default NDK libm.a.
>
> Please elaborate.
> (configure line etc.)
>

Here's the full configure :

./configure --arch=arm --target-os=linux --enable-cross-compile \
--cross-prefix=/4.4/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-
\
--sysroot=/4.4/prebuilts/ndk/current/platforms/android-18/arch-arm \
--disable-shared --enable-static --enable-gpl  --enable-avresample
--enable-libx264 --enable-encoder=libx264 \
--extra-cflags='-mcpu=cortex-a7 -mfloat-abi=softfp -mfpu=neon
-D_GNU_SOURCE -fno-builtin-sin -fno-builtin-cos -std=c99' \
--extra-ldflags='-Wl,--fix-cortex-a8' \
--extra-libs="/4.4/external/x264/libx264.a";


- I also tried -DGNU_SOURCE

- I am working with the complete android 4.4 tree not the stand alone NDK.
math.h has ifdef _GNU_SOURCE for sincos/sincof/sincosl

- however nm shows that they are not available so they were not enabled at
compile.

 nm /4.4/prebuilts/ndk/9/platforms/android-18/arch-arm/usr/lib/libm.a |
grep sin
isinf.o:
00000000 T __isinf
00000000 T __isinff
00000000 T __isinfl
         U sin
e_asin.o:
00000000 T asin
e_asinf.o:
00000000 T asinf
         U sin
         U sinf
         U sin
         U sinf
         U sin
         U __kernel_sin
00000000 t sin_pi
         U __kernel_sindf
00000000 t sin_pif
e_sinh.o:
00000000 T sinh
e_sinhf.o:
00000000 T sinhf
k_sin.o:
00000000 T __kernel_sin
k_sinf.o:
00000000 T __kernel_sindf
s_asinh.o:
00000000 T asinh
s_asinhf.o:
00000000 T asinhf
         U __kernel_sin
s_sin.o:
         U __kernel_sin
00000000 T sin
s_sinf.o:
00000000 T sinf

- I have looked at rebuilding libm.a with GNU_SOURCE enabled but I can't
find a method for that either. That is probably outside the scope of this
thread though.


--
Patrick Shirkey
Boost Hardware Ltd


More information about the ffmpeg-user mailing list