您的位置:首页 > 移动开发 > Android开发

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

2014-01-18 09:10 507 查看
编译环境:

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
plaincopy

tar -xvf ccache-3.1.9.tar.bz2

cd ccache-3.1.9

./configure

make

make install //Mac系统安装需要加上sudo,即sudo make install

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

[html] view
plaincopy

git clone https://github.com/yixia/FFmpeg-Android
没有安装git的要先安装git:

[html] view
plaincopy

sudo apt-get install git

第三步:编译这个项目

进入此项目目录

[html] view
plaincopy

$ export ANDROID_NDK=/path/to/your/android-ndk #导出你的NDK目录

$ ./FFmpeg-Android.sh #运行这个shell文件

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

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

至此你就会发现这个编译过程是多么简单便捷,不许要在ffmpeg源码中添加任何make文件,不需要编写任何shell脚本,甚至不用自己去下载ffmpeg源码。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: