站在巨人的肩膀上--傻瓜式编译ffmpeg for android

编译环境:

Ubuntu 12.04;

Android-ndk-r9;

ffmpeg 在运行shell脚本的时候自动下载最新版本;


首先,编译前需要安装ccache:

ccache is a software development tool that caches the output of C/C++compilation so that the next time, the same compilation can be avoided and the results can be taken from the cache. This can greatly speed up recompiling time.  ------From Wikipedia

源码下载:http://ccache.samba.org/download.html

安装ccache: 

[plain]  view plain copy
  1. tar -xvf ccache-3.1.9.tar.bz2    
  2. cd ccache-3.1.9    
  3. ./configure    
  4. make    
  5. make install //Mac系统安装需要加上sudo,即sudo make install   

第二步: 从GitHub下载开源项目代码: FFmpeg-Android

[html]  view plain copy
  1. git clone https://github.com/yixia/FFmpeg-Android  
没有安装git的要先安装git:

[html]  view plain copy
  1. sudo apt-get install git  

第三步:编译这个项目

进入此项目目录

[html]  view plain copy
  1. $ export ANDROID_NDK=/path/to/your/android-ndk     #导出你的NDK目录  
  2. $ ./FFmpeg-Android.sh     #运行这个shell文件  

闭目养生5分钟,就会出现令你兴奋的结果

libffmpeg.so will be built to build/ffmpeg/{neon,armv7,vfp,armv6}

至此你就会发现这个编译过程是多么简单便捷,不许要在ffmpeg源码中添加任何make文件,不需要编写任何shell脚本,甚至不用自己去下载ffmpeg源码。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值