Ubuntu 12.04交叉编译安装arm版本的ffmpeg
来源:互联网 发布:淘宝女装店招素材 编辑:程序博客网 时间:2024/05/16 04:50
1 准备工作
(1)libmp3lame库
下载: wget http://downloads.sourceforge.net/lame/lame-3.99.tar.gz
解压
编译:./configure --prefix=/usr/local/arm --host=arm-none-linux-gnueabi
make
make install
编译ok。
(2)libxvid库(x264库)
支持xvid x264,现在最流行的两种高质量的压缩格式,下载地址是:
http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz
解压后参考其readme文件,打开xvidcore/doc/INSTALL文件
基本上还是通常的三步曲,只不过configure文件换了个目录,在build\generic路径下
我们也看到库支持vs2008编译
./configure --prefix=/usr/local/arm --host=arm-none-linux-gnueabi
make
sudo make install
(3)FAAC库的编译安装(貌似不需要)
从网上下载的源码是faad2-2.0.tar,在Ubuntu上解压后,由于是DOS格式的,执行下面语句会出错
./bootstrap
我的执行步骤是
chmod +x bootstrap
dos2unix bootstrap
./bootstrap
报错:
# ./bootstrap
configure.in:38: warning: underquoted definition of MY_CHECK_TYPEDEF_FROM_INCLUDE
configure.in:38: run info '(automake)Extending aclocal'
configure.in:38: or see http://www.gnu.org/software/automake/manual/automake.html#Extending-aclocal
./bootstrap: 5: ./bootstrap: libtoolize: not found
#
# apt-get install -y libtoolize
======================
./configure --prefix=/usr/local/arm --host=arm-none-linux-gnueabi
make
make install
2 配置及编译安装相关的选项有
--cross-prefix=PREFIX use PREFIX for compilation tools []
--enable-cross-compile assume a cross-compiler is used
--disable-ffserver disable ffserver build
--disable-postproc disable libpostproc build
--disable-ffplay disable ffplay build
--arch=ARCH select architecture []
--cpu=CPU select the minimum required CPU (affects
instruction selection, may crash on older CPUs)
--target-os=OS compiler targets OS []
--enable-libfaac enable FAAC support via libfaac [no]
--enable-libmp3lame enable MP3 encoding via libmp3lame [no]
--enable-libxvid enable Xvid encoding via xvidcore,
native MPEG-4/Xvid encoder exists [no]
--host-cc=HOSTCC use host C compiler HOSTCC
--host-cflags=HCFLAGS use HCFLAGS when compiling for host
--host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
--host-libs=HLIBS use libs HLIBS when linking for host
--extra-cflags=ECFLAGS add ECFLAGS to CFLAGS []
--extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS []
--extra-libs=ELIBS add ELIBS []
--sysroot=PATH root of cross-build tree
--sysinclude=PATH location of cross-build system headers
实际的配置参数为:
./configure --prefix=/usr/local/arm \
--cross-prefix=arm-none-linux-gnueabi- --enable-cross-compile \
--target-os=linux --arch=armv6j \
--disable-ffserver --disable-postproc --disable-ffplay \
--enable-libmp3lame --enable-libxvid \
--sysinclude=/usr/local/arm/include \
--extra-cflags=-I/usr/local/arm/include \
--extra-ldflags=-L/usr/local/arm/lib \
--enable-gpl
其中要注意--cross-prefix的设置最后要有符号- , --arch选项要根据自己的GCC的选项加,我的编译的选项有-march=armv6j,不清楚就不要加.
最后加--enable-gpl是因为--enable-libxvid选项,这造成了与--enable-libfaac选项冲突。
然后
make
以root身份运行
make install
3 测试
将安装目录中的ffmpeg程序拷贝到设备上,测试从视频中截取一张图片
ffmpeg -i 12.mp4 -y -f image2 -ss 10.010 -t 0.001 -s 320x240 test.jpg
成功执行,说明ffmpeg交叉编译顺利完成。
- Ubuntu 12.04交叉编译安装arm版本的ffmpeg
- 在Ubuntu下安装ARM的交叉编译工具
- ARM交叉编译的安装
- Ubuntu 16.04 安装ARM交叉编译工具
- Ubuntu 12.04系统交叉编译开发工具的安装(arm-linux-gcc-4.4.3都一样)
- ubuntu arm 交叉编译环境的搭建
- ubuntu arm 交叉编译环境的搭建
- 交叉编译工具和qt安装,终端使用qmake编译arm版本可执行文件的方法
- 【转】Ubuntu 12.04下安装arm-linux-gcc等gnu arm toolchain交叉编译工具
- Ubuntu 9.04安装arm-linux-gcc交叉编译工具
- Ubuntu 9.04安装arm-linux-gcc交叉编译工具
- Ubuntu 9.04安装arm-linux-gcc交叉编译工具
- Ubuntu 9.04安装arm-linux-gcc交叉编译工具
- Ubuntu配置安装ARM Linux交叉编译环境完整流程
- Ubuntu 安装arm-linux-gcc交叉编译工具
- Ubuntu 安装arm-linux-gcc交叉编译工具
- Ubuntu 16.04 安装arm-linux-gcc交叉编译
- Ubuntu 16.04 安装 arm 树莓派3 交叉编译工具
- Cassandra维护数据一致性的策略
- SQL SERVER 2005如何建立自动备份的维护计划
- easyUI宽度自适应
- Sprite Kit编程指南(2)-使用精灵
- Eclipse导出JavaDoc中文乱码问题解决
- Ubuntu 12.04交叉编译安装arm版本的ffmpeg
- Sprite Kit编程指南(3)-添加动作到节点
- NO.2开始写读书笔记,第一本C专家编程
- Google Guava官方教程(中文版)
- php文件上传
- Android开发之APN网络切换
- 10. 泛型 Part 1 --- 学习笔记
- Sprite Kit编程指南(4)-构建场景
- nginx 正向代理