build-x86-64.sh:
#!/bin/sh
# 编译后输出目录,在 ffmpeg 源码目录下的 /android/arm64-v8a
OUTPUT=$(pwd)/x86_64-linux/x64
build() {
./configure \
--disable-x86asm \
--prefix=$OUTPUT \
--disable-static \
--disable-debug \
--disable-doc \
--enable-shared \
--enable-cross-compile \
--extra-cflags="-fpic" \
--enable-hwaccels \
--enable-libx264 \
--enable-gpl \
# make clean all
make -j12
# make install
}
build
build-android64.sh:
#!/bin/sh
# NDK 所在的路径
export NDK=/home/a/ndk/android-ndk-r21e
TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64
# 需要编译出的平台,这里是 arm64-v8a
ARCH=aarch64
# 支持的最低 Android API
API=21
# 编译后安装目录,在 ffmpeg 源码目录下的 ./android/arm64-v8a
OUTPUT=$(pwd)/android/arm64-v8a
build() {
./configure \
--target-os=android \
--prefix=$OUTPUT \
--arch=$ARCH \
--sysroot=$TOOLCHAIN/sysroot \
--disable-static \
--disable-ffprobe \
--disable-debug \
--disable-doc \
--enable-shared \
--enable-cross-compile \
--cross-prefix=$TOOLCHAIN/bin/aarch64-linux-android- \
--cc=$TOOLCHAIN/bin/aarch64-linux-android$API-clang \
--cxx=$TOOLCHAIN/bin/aarch64-linux-android$API-clang++ \
--extra-cflags="-fpic" \
--enable-hwaccels \
--enable-jni \
--enable-mediacodec \
--enable-encoder=h264_mediacodec \
--enable-encoder=hevc_mediacodec \
--enable-encoder=mpeg4_mediacodec \
--enable-decoder=h264_mediacodec \
--enable-decoder=hevc_mediacodec \
--enable-decoder=mpeg4_mediacodec \
--enable-hwaccel=h264_mediacodec \
# make clean all
make -j12
# make install
}
build
build-android32.sh:
#!/bin/sh
# NDK 所在的路径
export NDK=/home/a/ndk/android-ndk-r21e
TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64
# 需要编译出的平台,这里是 arm64-v8a
ARCH=armv7a
# 支持的最低 Android API
API=21
# 编译后输出目录,在 ffmpeg 源码目录下的 /android/arm64-v8a
OUTPUT=$(pwd)/android/arm64-v7a
build() {
./configure \
--target-os=android \
--prefix=$OUTPUT \
--arch=$ARCH \
--sysroot=$TOOLCHAIN/sysroot \
--disable-static \
--disable-ffprobe \
--disable-debug \
--disable-doc \
--enable-shared \
--enable-cross-compile \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--cc=$TOOLCHAIN/bin/armv7a-linux-androideabi$API-clang \
--cxx=$TOOLCHAIN/bin/armv7a-linux-androideabi$API-clang++ \
--extra-cflags="-fpic" \
--enable-hwaccels \
--enable-jni \
--enable-mediacodec \
--enable-encoder=h264_mediacodec \
--enable-encoder=hevc_mediacodec \
--enable-encoder=mpeg4_mediacodec \
--enable-decoder=h264_mediacodec \
--enable-decoder=hevc_mediacodec \
--enable-decoder=mpeg4_mediacodec \
--enable-hwaccel=h264_mediacodec \
# make clean all
make -j12
# make install
}
build
build-aarch-linux.sh:
#!/bin/sh
# 工具链所在的路径
export TOOLCHAIN=/home/a/linux-aarch64-toolchain
# 需要编译出的平台,这里是 aarch64
ARCH=aarch64
# 编译后输出目录
OUTPUT=$(pwd)/aarch-linux
build() {
./configure \
--prefix=$OUTPUT \
--arch=$ARCH \
--sysroot=$TOOLCHAIN/sysroots/aarch64-sdrv-linux \
--disable-static \
--disable-ffprobe \
--disable-debug \
--disable-doc \
--enable-shared \
--enable-cross-compile \
--cc=$TOOLCHAIN/sysroots/x86_64-sdrvsdk-linux/usr/bin/aarch64-sdrv-linux/aarch64-sdrv-linux-gcc \
--cxx=$TOOLCHAIN/sysroots/x86_64-sdrvsdk-linux/usr/bin/aarch64-sdrv-linux/aarch64-sdrv-linux-g++ \
--strip=$TOOLCHAIN/sysroots/x86_64-sdrvsdk-linux/usr/bin/aarch64-sdrv-linux/aarch64-sdrv-linux-strip \
--extra-cflags="-fpic" \
--enable-hwaccels \
# make clean all
make -j12
# make install
}
build
build-aarch-linux-omx.sh:
#!/bin/sh
# NDK 所在的路径
export TOOLCHAIN=/home/a/linux-aarch64-toolchain
# 需要编译出的平台,这里是 arm64-v8a
ARCH=aarch64
# 编译后输出目录,在 ffmpeg 源码目录下的 /android/arm64-v8a
OUTPUT=$(pwd)/aarch-linux
#--extra-cflags="-I./omx/include" 三方库头文件查找路径
build() {
./configure \
--prefix=$OUTPUT \
--arch=$ARCH \
--sysroot=$TOOLCHAIN/sysroots/aarch64-sdrv-linux \
--disable-static \
--disable-ffprobe \
--disable-debug \
--disable-doc \
--disable-avdevice \
--enable-shared \
--enable-cross-compile \
--enable-omx \
--cc=$TOOLCHAIN/sysroots/x86_64-sdrvsdk-linux/usr/bin/aarch64-sdrv-linux/aarch64-sdrv-linux-gcc \
--cxx=$TOOLCHAIN/sysroots/x86_64-sdrvsdk-linux/usr/bin/aarch64-sdrv-linux/aarch64-sdrv-linux-g++ \
--strip=$TOOLCHAIN/sysroots/x86_64-sdrvsdk-linux/usr/bin/aarch64-sdrv-linux/aarch64-sdrv-linux-strip \
--extra-cflags="-fpic -I./omx/include" \
--enable-hwaccels \
# make clean all
make -j12
# make install
}
build
标签:脚本,enable,TOOLCHAIN,ffmpeg,--,编译,disable,linux,aarch64 From: https://www.cnblogs.com/linxisuo/p/18168023