简体   繁体   中英

How to build FFmpeg Executable binary for Android on Mac OS?

I'm a new beginner with FFmpeg . All I need is FFmpeg executable binary for Android . I followed the great tutorial from roman10.net

Here is my build_android.sh file:

    #!/bin/bash
NDK=/Users/sunshine/Documents/android-ndk-r11-linux-x86_64
SYSROOT=$NDK/platforms/android-21/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64
function build_one
{
./configure \
    --prefix=$PREFIX \
    --enable-shared \
    --enable-static \
    --disable-doc \
    --disable-ffplay \
    --disable-ffprobe \
    --disable-ffserver \
    --enable-libmp3lame\
    --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

The tutorial says:

Once it's done, you should be able to find a folder $NDK/sources/ffmpeg-2.0.1/android

In my case, the build process is done, but I don't see any android folder. Some new files are created in the same folder with build_android.sh file. Where is my mistake?

I faced a similar problem, and later solved after changing the NDK path. For example instead of

NDK=/Users/sunshine/Documents/android-ndk-r11-linux-x86_64

you can try

NDK=$HOME/Documents/android-ndk-r11-linux-x86_64

However I can't guarantee if this is the exact problem with your setup.

I faced the same "problem", but I found the files in: $NDK/sources/android/arm (lib and include directories).

I hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM