最近想通过FFmpeg库来练习在Android中使用其他第三方库进行开发。本文基本按照Ubuntu
10.10 64bit下使用Android NDK r6编译FFmpeg 0.8.1实现,感谢原作者辛苦的工作。
1 下载相应的Android
NDK r6文件
2 下载FFmpeg0.8.1的版本
截至到2011年10月2日已经发布了FFmpeg 0.8.5版本。
本文中系统之前已经配置过了NDK r6,我们通过控制台使用ndk-build不会出现找不到命令的情况。
本文的相关路径如下。
1
2
|
NDK目录为
/root/develop/android-ndk-r6
FFmpeg目录为
/root/develop/workspace/jni
|
3 创建一个可执行脚本:
1
2
3
4
5
6
7
8
9
10
11
12
13
|
./configure
--disable-static --enable-shared --enable-gpl --enable-version3 --enable-nonfree --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-avdevice --disable-avfilter --disable-postproc --enable-small --cross-prefix=/root/develop/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
--enable-cross-compile --target-os=linux --extra-cflags='-I/root/develop/android-ndk-r6/platforms/android-9/arch-arm/usr/include' --extra-ldflags='-L/root/develop/android-ndk-r6/platforms/android-9/arch-arm/usr/lib -nostdlib' --arch=arm --disable-symver --disable-debug
--disable-stripping
sed
-i 's/HAVE_LRINT 0/HAVE_LRINT 1/g' config.h
sed
-i 's/HAVE_LRINTF 0/HAVE_LRINTF 1/g' config.h
sed
-i 's/HAVE_ROUND 0/HAVE_ROUND 1/g' config.h
sed
-i 's/HAVE_ROUNDF 0/HAVE_ROUNDF 1/g' config.h
sed
-i 's/HAVE_TRUNC 0/HAVE_TRUNC 1/g' config.h
sed
-i 's/HAVE_TRUNCF 0/HAVE_TRUNCF 1/g' config.h
|
文件下载:
config.sh
本文为放到/root/develop/workspace/jni目录
4 使用命令
1
2
|
chmod
777 ./config.sh
./config.sh
|
执行后会有一个warning提示,但不影响最后编译.
1
|
WARNING:
/root/develop/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-pkg-config not found, library detection may fail.
|
5 创建一个Android.mk文件,放在 /root/develop/workspace/jni目录
内容参考Android.mk
本文使用的文件为
Android.mk
6 在/root/develop/workspace/jni目录下,执行
7 本文中会在/root/develop/workspace/libs/armeabi/中生成一个libffmpeg.so文件。
注意:
本人在做这个操作的时候,参考过How to
Build FFmpeg for Android,但是并不成功。当然他提到的Android NDK r5 我没有测试过。
参考文章:
1 http://www.cnblogs.com/mcodec/articles/2114674.html
2 http://www.cnblogs.com/mcodec/articles/2114714.html
3 http://www.cnblogs.com/scottwong/archive/2010/12/17/1909455.html
4 http://blog.csdn.net/fsfcvictor/article/details/5972044
5 https://gist.github.com/1126971
6 http://www.cnblogs.com/shaobin0604/archive/2011/08/05/2128619.html
7 http://www.roman10.net/?p=389
主参考
http://www.cnblogs.com/shaobin0604/archive/2011/08/05/2128619.html
分享到:
相关推荐
on an Ubuntu 11.04 desktop using Eclipse, the Android SDK, and PhoneGap. I will describe how to build Android apps from the command line with PhoneGap and from the GUI with Eclipse and PhoneGap and ...
ubuntu 11.04下android开发环境的搭建
ubuntu11.04搭建Android开发环境步骤及所遇到的问题
ubuntu11.04下android开发环境的搭建.pdf
ubuntu11.04上编译omap3530内核存在问题解决方法.使用的是天漠公司的sbc8100开发板
最新的Ubuntu 11.04安装指南(详细图解)
ubuntu11.04的详细安装方法,其中包括自动分区和手动分区的步骤,希望能对广大用户有帮助!
Ubuntu11.04 下载
ubuntu11.04下搭建android平台详细过程介绍
Ubuntu11.04下安装ns-allinone-2.34的总结
最快最全的Ubuntu11.04源,速度超快
找了好久才找到的,国内还没有有下载 linux vmware patch linux ubuntu 11.04 11.10 vmware linux-2.6.39 and linux-3.0.1 patch vmware补丁
安装ubuntu11.04的安装,亲测可用,放心下载 Ubuntu(又称乌班图)是一个以桌面应用为主的开源GNU/Linux操作系统,Ubuntu 是基于Debian GNU/Linux,支持x86、amd64(即x64)、ARM和ppc架构,由全球化的专业开发团队...
ubuntu11.04安装wine1.3的图文方法。 ubuntu11.04安装wine1.3的图文方法。 ubuntu11.04安装wine1.3的图文方法。 ubuntu11.04安装wine1.3的图文方法。
CSI Tool 集成安装包(适配Ubuntu 11.04系统,Intel 5300 无线网卡) csitools
无线破解spoonwep-spoonwpa,支持ubuntu11.04,试验过了
硬盘全新安装ubuntu11.04 硬盘全新安装ubuntu11.04
在VMware Player 安装 ubuntu11.04全图解