[FFmpeg-user] compiling for android

Patrick Shirkey pshirkey at boosthardware.com
Thu Jul 10 17:01:40 CEST 2014


On Thu, July 10, 2014 11:30 pm, Carl Eugen Hoyos wrote:
> Patrick Shirkey <pshirkey <at> boosthardware.com> writes:
>
>> ./configure --arch=arm --target-os=linux
>
> I (still) wonder if the --cpu option is useful or not.
> (I cannot test.)
>

I have tried with/without and it doesn't appear to have any affect for
this build.

>>  --enable-cross-compile \
>
> If I read the source correctly, you can remove
> --enable-cross-compile if you are using --cross-prefix.
>
>> --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 \
>> --enable-gpl --enable-avresample --enable-libx264 \
>
>> --extra-cflags='-fno-builtin-sin -fno-builtin-sinf' \
>> --extra-ldflags='-L/4.4/external/x264'
>
> Strictly speaking, this is missing the include path to
> the x264 headers matching the library in 4.4/external/x264.
> I suspect you are now using the native (system, x86) x264
> headers for your Android compilation which may be no
> problem but is still not a good idea.
>

You are likely correct on the requirement for -I but I removed x264
packages from my host system a couple of days ago just to be on the safe
side.

I did make some tweaks that will affect this specific issue.

- In the process of trying to get things to build I copied the headers
into 2 seperate locations.

/4.4/prebuilts/ndk/current/platforms/android-18/arch-arm/usr/include/
/4.4/external/ffmpeg/libavcodec/

- I also modified the include in libxs64.c

from

    #include <x264.h>

to

    #include "x264.h"

- For future reference of anyone else trying to do this build, It's
possible that the correct command without making any changes to
libavcodec/libx264.c is the following:

./configure --arch=arm --target-os=linux \
--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 \
--enable-gpl --enable-avresample --enable-libx264 \
--extra-cflags='-fno-builtin-sin -fno-builtin-sinf -I/4.4/external/x264'' \
--extra-ldflags='-L/4.4/external/x264'

--cpu=  may also be useful in some cases.

ex. --cpu=cortex-a8



--
Patrick Shirkey
Boost Hardware Ltd


More information about the ffmpeg-user mailing list