4

How to compile ffmpeg for all cpu architectures in android. Currently i'm using the following script which generates libs for arm only.

#!/bin/bash NDK=$HOME/ndk32 SYSROOT=$NDK/platforms/android-9/arch-arm/ TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86 function build_one { ./configure \ --prefix=$PREFIX \ --enable-shared \ --disable-static \ --disable-doc \ --disable-ffmpeg \ --disable-ffplay \ --disable-ffprobe \ --disable-ffserver \ --disable-avdevice \ --disable-doc \ --disable-symver \ --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \ --target-os=linux \ --arch=arm \ --enable-cross-compile \ --sysroot=$SYSROOT \ --extra-cflags="-Os -fpic $ADDI_CFLAGS" \ --extra-ldflags="$ADDI_LDFLAGS" \ $ADDITIONAL_CONFIGURE_FLAG make clean make make install } CPU=arm PREFIX=$(pwd)/android/$CPU ADDI_CFLAGS="-marm" build_one 

I want to support all possible platforms.

2
  • 1
    Tried vitamio.org/en/2013/Tutorial_0509/13.html? Commented Jul 11, 2014 at 13:42
  • Does it support ARMv7 ?! And why did you disable ffplay?! And what is this?: " ADDI_CFLAGS="-marm" " ? Commented Dec 5, 2015 at 6:43

1 Answer 1

1

Just use different toolchains, see build_android.sh from AndroidFFmpeg project as a good example. Note that it handles library for ARM NEON SIMD as well, it is loaded at run-time if NEON support is detected.

Sign up to request clarification or add additional context in comments.

1 Comment

But this compile a .SO library to use inside a android application. I want to output a BINARY file.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.