ffmpeg的一个编译脚本

#!/bin/bash
export NDK=/opt/amlogic/android-toolchain-4.8
export SYSROOT=$NDK/sysroot
export TOOLCHAIN=$NDK/bin
function build_one
{
./configure \
--prefix=$PREFIX \
--disable-static \
--disable-yasm \
--enable-shared \
--enable-gpl \
--enable-nonfree \
--enable-libx264 \
--enable-encoder=libx264 \
--enable-libfdk-aac \
--enable-pic \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-symver \
--cross-prefix=$TOOLCHAIN/arm-linux-androideabi- \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-libs=-ldl \
--extra-cflags="-Os -fPIC $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS"
make uninstall
make
make install
}
CPU=share
PREFIX=/home/lizhangping/samba/work/ffmpeg
ADDI_CFLAGS="-I./external/amlogic/libfdk-aac/include  -I./external/amlogic/libx264/include -Wno-deprecated -DANDROID -Wno-unused-but-set-variable"
ADDI_LDFLAGS="-L./external/amlogic/libfdk-aac/lib -L./external/amlogic/libx264/lib"
#ADDI_CFLAGS="-I./external/libfdk-aac/include -I./external/libx264/include  -Wno-deprecated -DANDROID -Wno-unused-but-set-variable -mcpu=generic"
#ADDI_LDFLAGS="-L./external/libfdk-aac/lib -L./external/libx264/lib"

build_one

external 里面是ffmpeg引用的一些第三方的头文件和lib文件

如果ffmpeg需要引用第三方的,要把第三方的编译好放在external里面,这种源码的编译关键在于config配置好编译工具链


你可能感兴趣的:(ffmpeg的一个编译脚本)