ffmpeg编译文件

#!/bin/bash
tempDirPath=$(pwd)/tempdir
if [ ! -d "$tempDirPath" ];then
    mkdir "$tempDirPath"
fi
export TMPDIR=$tempDirPath
NDK=D:/AndroidNdk/android-ndk-r15c

# darwin linux
function build_one {
./configure \
--ln_s="cp -rf" \
--target-os=android \
--arch=$ARCH \
--cpu=$CPU \
--prefix=$PREFIX \
--enable-shared \
--disable-static \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-doc \
--disable-symver \
--enable-cross-compile \
--cross-prefix=$CROSS_COMPILE \
--sysroot=$SYSROOT \
--extra-libs=-lgcc \

$ADDITIONAL_CONFIGURE_FLAG

make clean
make -j8
make install
}

ABI_NAME="armv7"

if [ "$ABI_NAME" = "armv7" ];then
    ARCH=arm
    OUTPUT=armeabi-v7a
    CPU=armv7-a
    CROSS_COMPILE=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-
    SYSROOT=$NDK/platforms/android-19/arch-arm/
elif [ "$ABI_NAME" = "arm64" ];then
    ARCH=aarch64
    OUTPUT=arm64-v8a
    CPU=armv8-a
    CROSS_COMPILE=$NDK/toolchains/aarch64-linux-android-4.9/prebuilt/windows-x86_64/bin/aarch64-linux-android-
    SYSROOT=$NDK/platforms/android-21/arch-arm64/
elif [ "$ABI_NAME" = "x86" ];then
    ARCH=x86
    OUTPUT=x86
    CPU=i686
    CROSS_COMPILE=$NDK/toolchains/x86-4.9/prebuilt/windows-x86_64/bin/i686-linux-android-
    SYSROOT=$NDK/platforms/android-19/arch-x86/
elif [ "$ABI_NAME" = "x86_64" ];then
    ARCH=x86_64
    OUTPUT=x86_64
    CPU=x86_64
    CROSS_COMPILE=$NDK/toolchains/x86_64-4.9/prebuilt/windows-x86_64/bin/x86_64-linux-android-
    SYSROOT=$NDK/platforms/android-21/arch-x86_64/
fi

PREFIX=$(pwd)/android/$OUTPUT

echo "NDK=$NDK"
echo "PREFIX=${PREFIX}"
echo "CROSS_COMPILE=${CROSS_COMPILE}"
echo "SYSROOT=${SYSROOT}"

echo "******************************"

build_one

你可能感兴趣的:(ffmpeg编译文件)