How to Build FFmpeg for Android
http://www.roman10.net/how-to-build-ffmpeg-for-android/
ffmpeg is an open-source platform for recording, converting, playing and streaming video and audio. It includes libavcodec, a popular video/audio codec.
Several popular Android applications are built based on FFmpeg, including RockPlayer, MoboPlayer, acrMedia, vitalPlayer, V-Cut Express etc. If you’re developing multimedia applications that needs a video/audio codec, ffmpeg is a good choice.
This blog covers how to compile ffmpeg for Android, and next blog will cover how to use ffmpeg to build a simple application.
The steps below are done on Ubuntu 10.10, android NDK r5b, and ffmpeg 0.8. It should work on other versions of Android NDK and ffmpeg, but it may require minor changes.
0. Download Android NDK r5b
You can download the NDK here. Once downloaded, simply extract the file, and you’ll have a folder named android-ndk-r5b. You’ll need the folder location for configurations later.
1. Download Source Code for FFmpeg
You can download the source code from here. If you want to get the latest code, you can use git or svn, the link has detailed instructions. But for this tutorial, the FFmpeg 0.8 “Love” release is downloaded.
After downloaded the source, extract it and you’ll have a folder named ffmpeg-0.8.
2. Build FFmpeg (The script is based on RockPlayer build script)
2.1 Copy and Paste the bash script from here to a text editor, and save it as build_android.sh under ffmpeg-0.8 folder.
Note that NDK location has to be changed according to your android-ndk-r5b folder location. In my machine, it’s at ~/Desktop/android/, so it’s set as
NDK=~/Desktop/android/android-ndk-r5b
PLATFORM=$NDK/platforms/android-8/arch-arm/
PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
You may also need to adjust the PLATFORM based on which version of SDK you’re using, android-8 corresponds to android SDK 2.2.
The default configuration in the script disables a lot of stuff to speed up the build, you can change the configuration to suit your needs. Besides, you can compile for multiple hardware platforms, but here we only enable arm v7vfpv3 to speed up the build process.
2.2 Make sure the bash script is executable. Go to the ffmpeg-0.8 directory in terminal, then type the following command,
sudo chmod 755 build_android.sh
2.3 Then execute the script, by typing the following command,
./build_android.sh
The compilation will take a while (several minutes or above depends on your machine) to finish.
Update for NDK-r6:
For android NDK-r6, the build_android.sh script might not work. You can try the scripthere.
Note that you may need to create ./android/armv7-a/ folder in the ffmpeg directory yourself. (Thanks to mgg28831 for this).
If you encounter permission denied error, you can try sudo ./build_android.sh.
3. The Output of the Build
Once the script finishes execution, there’ll be a folder called android under ffmpeg-0.8 directory, which contains all the output of the build.
4. To be Continued
Once the library is compiled successfuly, the next step is to use it to build Android apps. This is covered in next blog, How to Build Android Apps Based on FFmpeg By an Example.
Reference:
RockPlayer open source component: http://rockplayer.freecoder.org/tech.html
How to Build FFmpeg for Android的更多相关文章
- How to build ffmpeg with hardware accelerated codecs for Android x86
In order to build a complete ffmpeg with hardware acceleration for Intel platform (XXX lake + Atom), ...
- [原]ffmpeg编译android 硬解码支持库 libstagefright
最近花了一天时间将ffmpeg/tools/build_stagefright执行成功,主要是交叉编译所需要的各种动态库的支持没链接上,导致各种报错,基本上网络上问到的问题我都碰到了,特此记录下来. ...
- FFmpeg在Android上的移植之第一步
http://blog.sina.com.cn/s/blog_69a04cf40100x1fr.html 从事多媒体软件开发的人几乎没有不知道FFmpeg的,很多视频播放器都是基于FFmpeg开发的. ...
- FFmpeg在Android上的移植优化步骤
http://blog.csdn.net/feixiang_john/article/details/7894188 从事多媒体软件开发的人几乎没有不知道FFmpeg的,很多视频播放器都是基于FFmp ...
- FFmpeg for Android compiled with x264, libass, fontconfig, freetype and fribidi
android下打算使用ffmpeg的 drawtext ,不过需要 --enable-libfreetype 但是freetype是个第三方库,所以需要先编译freetype,然后再编译ffmpe ...
- FFmpeg编译Android版本
FFmpeg是很好用的一个音视频库,功能强大,但是用起来并不是很方便.之前一直不想用FFmpeg,因为感觉编译太麻烦,但是到了不得不用的时候了,没办法,参考了网上大神的方法,在这里自己也记录一下方便以 ...
- ffmpeg 编译Android
环境 macOS 10.15.4 NDK 21.3.6528147 ffmpeg 4.2.3 1.执行sudo xcodebuild -license,防止编译的时候找不到一些文件报错 2. ...
- FFmpeg在Android Studio中断点调试
一般情况下在Android平台使用FFmpeg为动态库或静态库的形式,只能通过设置FFmpeg日志回调来看一些FFmpeg输出的日志,有时需要debug来查看FFmpeg内部执行过程,本文记录一下在A ...
- FFmpeg在Android使用3
android 移植ffmpeg后so库的使用 只需要将我们编译好的ffmpeg的so包(在/obj/local/armeabi/libffmpeg.so)copy到所在ndk下的\platfor ...
随机推荐
- MySQL中的数据类型
文本 CHAR(*):最多255个字节的定长字符串,它的长度必须在创建时指定 VARCHAR(*):最多255个字节的可变长度字符串,它的长度必须在创建时指定 TEXT:最大长度为64K字符的变长文本 ...
- 华为OJ-合唱队
华为OJ-初级题-合唱队 思路与分析 本题可以用DP的方法,分别从正向和逆向的两个方向求,该数组即186 186 150 200 160 130 197 200的上升对大序列.正向为[1, 1, 1, ...
- html5 canvas画板
点击查看演示地址 <!DOCTYPE HTML> <html> <title>HTML5-CanvasDrawDemo</title> <meta ...
- 解决Linux中遇到No such device
虚拟机备份转移后,网络启动异常,提示“SIOCSIFADDR: No such device” he problem lies in the fact that ethernet MAC addres ...
- SQL中删除某数据库所有trigger及sp
SQL中删除某数据库所有trigger及sp 编写人:CC阿爸 2014-6-14 在日常SQL数据库的操作中,如何快速的删除所有trigger及sp呢 以下有三种方式可快速处理. --第一种 - ...
- project 2010 使用技巧
快捷键 设置任务子任务 ALT+SHIFT+向右方向键 1.工作时间设置 新建一个日历后,可以在 “项目 >> 项目信息 >> 日历” 中进行选择
- PHP数组操作大全
<?php /** * File: phpstudy : array_test.php * Created by PhpStorm. * User: IhMfLy Pheonix@jtv-070 ...
- MongoDB查询语法
mongoDb是非关系型数据库,用习惯了mssql,mysql等数据库的需要转换一下思维 mongoDb存的是与js的json结构一样的文档,表中的每一条记录都可以结构不同 1,大于,小于,大于等于, ...
- asp 301跳转代码
<% Response.Status="301 Moved Permanently" Response.AddHeader "Location&quo ...
- 【Delphi】从内存(MemoryStream)使用WMP(WindowsMediaPlayer)控件播放视频音频(Play Video with WMP from MemoryStream)
关键字: MemoryStream.WMP.WindowsMediaPlayer.Play .Load. Delphi.C++.C#.ActiveX控件 作 者: CaiBirdy 问 题:正常使 ...