下面是FFMPEG的配置,将以下脚本保存复制到源码目录下,添加执行权限,运行即可。
#!/bin/sh
BASE=/opt/FFMPEG_INSTALL
BUILD_HOST=aarch64-linux-gnu
OUTPUT_PATH=${BASE}
OTHER_LIB_X264=/opt/x264_INSTALL
OTHER_LIB_X265=/opt/x265
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/x265/lib/pkgconfig
./configure \
--cross-prefix=${BUILD_HOST}- \
--enable-cross-compile \
--target-os=linux \
--cc=/usr/local/toolchain/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/${BUILD_HOST}-gcc \
--arch=aarch64 \
--prefix=${OUTPUT_PATH}/ffmpeg \
--pkg-config="pkg-config --static" \
--enable-shared \
--enable-static \
--enable-pic \
--enable-gpl \
--enable-nonfree \
--enable-ffmpeg \
--disable-ffplay \
--enable-swscale \
--enable-avresample \
--enable-pthreads \
--disable-armv5te \
--disable-armv6 \
--disable-armv6t2 \
--disable-x86asm \
--disable-neon \
--disable-stripping \
--enable-libx264 \
--enable-libx265 \
--extra-cflags=-I${OTHER_LIB_X264}/include \
--extra-ldflags=-L${OTHER_LIB_X264}/lib \
--extra-cflags=-I${OTHER_LIB_X265}/include \
--extra-ldflags=-L${OTHER_LIB_X265}/lib
#
make clean
make -j4 && sudo make install