使用android NDK编译FFmpeg编译脚本

FFmpeg编译脚本:


#!/bin/bash
NDK=/His/opensource/android-ndk-r10b
PLATFORM=$NDK/platforms/android-19/arch-arm
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86
PREFIX=/His/openlib/ffmpeg-3.4.1/
function build_one
{
    ./configure \
--prefix=$PREFIX \
--target-os=android \
--disable-doc \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--arch=arm \
--sysroot=$PLATFORM \
--extra-cflags="-I$PLATFORM/usr/include" \
--cc=$TOOLCHAIN/bin/arm-linux-androideabi-gcc \
--nm=$TOOLCHAIN/bin/arm-linux-androideabi-nm \
--enable-shared \
--enable-runtime-cpudetect \
--enable-gpl \
--enable-ffplay \
--enable-cross-compile \
--enable-jni \
--enable-mediacodec \
--disable-debug \
--enable-static \
--disable-asm \
--disable-symver \
--disable-stripping \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
        $ADDITIONAL_CONFIGURE_FLAG
    make clean
    make install
}
CPU=armv7-a
OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfp -marm -march=$CPU "
ADDI_CFLAGS="-marm"
build_one

你可能感兴趣的:(Android应用开发)