linux下交叉编译ffmpeg,并加入H264编码支持

原文:http://blog.csdn.net/caoshangpa/article/details/51392534

1.libx264 编译

./configure --enable-static --disable-asm --prefix=/usr/local/ffmpegDM3730 --arch=arm --host=arm-linux --cross-prefix=arm-arago-linux-gnueabi- 

make

make install

2.ffmpeg 编译

./configure --enable-shared --disable-yasm --enable-memalign-hack --enable-libx264 --enable-gpl --prefix=/usr/local/ffmpegDM3730 --enable-cross-compile --arch=arm --target-os=linux --cross-prefix=arm-arago-linux-gnueabi- --cc=arm-arago-linux-gnueabi-gcc --extra-cflags=-I/usr/local/ffmpegDM3730/include --extra-ldflags=-L/usr/local/ffmpegDM3730/lib --extra-libs=-ldl

make

make install

注意1:--extra-cflags=-I/usr/local/ffmpegDM3730/include --extra-ldflags=-L/usr/local/ffmpegDM3730/lib用于指定libx264的路径,但是指定完以后需要添加--extra-libs=-ldl才能找到该路径。否则会提示 ERROR: libx264 not found

注意2:交叉编译工具链要添加到环境变量


我编译使用的libx264和ffmpeg版本参考:

http://blog.csdn.net/caoshangpa/article/details/50947926

linux下编译ffmpeg,并加入H264编码支持:

http://blog.csdn.net/caoshangpa/article/details/51392445

Windows 7(Win7)下MinGW+msys编译ffmpeg,并加入H264编码支持:

http://blog.csdn.net/caoshangpa/article/details/50947926


---------------------------------------------------以下为原创分割线-----------------------------------------------
libx264编译configure选项
./configure --enable-static --disable-asm --prefix=/home/linux-app/QTAV/arm-x264so  --host=arm-linux --cross-prefix=arm-telechips-linux-gnueabi-  --extra-ldflags="-ldl -fPIC" --enable-pic
--enable-pic 64位虚拟机必须添加此选项

./configure \
--enable-shared \
--disable-yasm  \
--enable-libx264 \
--enable-gpl --prefix=/home/linux-app/QTAV/arm-ffmpeg \
--enable-cross-compile \
--arch=arm \
--target-os=linux \
--cross-prefix=arm-telechips-linux-gnueabi- \
--cc=/home/linux-app/adt/sysroots/x86_64-oesdk-linux/usr/bin/arm-telechips-linux-gnueabi/arm-telechips-linux-gnueabi-gcc \
--extra-cflags=" -fPIC -I/home/linux-app/QTAV/arm-x264so/include " \
--extra-ldflags=" -fPIC -L/home/linux-app/QTAV/arm-x264so/lib " \
--extra-cxxflags=" -fPIC -L/home/linux-app/QTAV/arm-x264so/lib "\
--extra-libs=" -ldl -fPIC" \
--sysroot=/home/linux-app/adt/sysroots/cortexa7-vfp-neon-telechips-linux-gnueabi



你可能感兴趣的:(QT)