2项依赖:
- gas-preprocessor(见附录:gas-preprocessor简介)
- yasm 1.2.0
如果要集成x264和fdk_aac,需要先编译x264和fdk_aac。
Usage(用root执行)
./build-ffmpeg.sh
- To build arm64 libraries:
./build-ffmpeg.sh arm64
- To build fat libraries for armv7 and x86_64 (x86_64 是64-bit simulator 模拟器):
./build-ffmpeg.sh armv7 x86_64
- To build fat libraries from separately built thin libraries:
./build-ffmpeg.sh lipo
You should link your app with
- libz.dylib
- libbz2.dylib
- libiconv.dylib
最终输出FFmpeg-iOS(我已改成fat-FFmpeg),可以在脚本里指定需要的平台
#ARCHS="arm64 armv7 x86_64 i386"
问题:
1,编译失败,sh中有个
执行到这一句说明没有安装yasm,而安装yasm,需要用到homebrew,因此执行上面语句安装homebrew时报错了。
解决:安装yasm,先安装homebrew,参见附录:homebrew的安装与使用
2,xcrun -sdk iphoneos clang is unable to create an executable file
C compiler test failed.
解决:去掉bitcode,如下:
CFLAGS="$CFLAGS -mios-version-min=$DEPLOYMENT_TARGET -fembed-bitcode"
3,如果集成了fdk_aac,需要添加:enable-nonfree
4,gas-preprocessor.pl的位置在usr/local/bin/,之前在/usr/bin下。不然会报GNU assembler not found gas-preprocessor
附录:
一,homebrew的安装与使用
套件管理器
安装:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
不能用root执行
常用命令:
查找软件包
brew search wget
安装软件包
brew install wget
删除软件包
brew remove wget
查看软件包信息
brew info wget
列出软件包的依赖关系
brew deps wget
更新brew
brew update
二,gas-preprocessor简介
Perl script that implements a subset of the GNU as preprocessor that Apple's as doesn't
To configure Libav for iOS: ./configure --enable-cross-compile --arch=arm --target-os=darwin --cc='clang -arch armv7' --sysroot=$(xcrun --sdk iphoneos --show-sdk-path) --cpu=cortex-a8 --enable-pic If deploying to all generations, it's recommended to do separate out-of-tree builds for each architecture, then lipo together the resulting libs. For instance, assuming separate builds in armv6 and armv7: lipo -create -arch armv6 armv6/libavcodec/libavcodec.a -arch armv7 armv7/libavcodec/libavcodec.a -output universal/libavcodec.a and similar for each library. Then in XCode, make sure to build for both armv6 and armv7. If you only care about one generation (since the armv6 devices are too slow for instance), then lipo is unnecessary of course.
Perl script that implements a subset of the GNU as preprocessor that Apple's as doesn't
To configure ffmpeg for the iPhone 3gs and iPod touch 3g: ./configure --enable-cross-compile --arch=arm --target-os=darwin --cc='/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv7' --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk --cpu=cortex-a8 --enable-pic To configure ffmpeg for all other iPhones and iPods: ./configure --enable-cross-compile --arch=arm --target-os=darwin --cc='/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -arch armv6' --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk --cpu=arm1176jzf-s Make sure to replace the iPhone SDK version with the version that you're using. Pre-3.0 versions aren't supported and probably won't work. If deploying to all generations, it's recommended to do separate out-of-tree builds for each architecture, then lipo together the resulting libs. For instance, assuming separate builds in armv6 and armv7: lipo -create -arch armv6 armv6/libavcodec/libavcodec.a -arch armv7 armv7/libavcodec/libavcodec.a -output universal/libavcodec.a and similar for each library. Then in XCode, make sure to build for both armv6 and armv7. If you only care about one generation (since the armv6 devices are too slow for instance), then lipo is unnecessary of course.
我的脚本:
库裁剪:支持libfdk_aac+libx264 编码和aac+h264解码:
艺搜参考:
- 编译ffmpeg(iOS)
一,x264库的编译 首先到http://www.videolan.org/developers/x264.html下载x264的库,然后解压,修改文件夹名称为x264 二,下载ffmpeg2 ...
- iOS编译FFmpeg、kxmovie实现视频播放 (转载)
由于FFmpeg开源框架的功能非常强大,可以播放的视频种类很多,同时添加第三方库kxmovie,实现视频播放,真的是爽爆了,因此今天来说一下关于FFmpeg在iOS手机上的一些配置过程,配置工具,还有 ...
- 多媒体开发(7):编译Android与iOS平台的FFmpeg
编译FFmpeg,一个古老的话题,但小程还是介绍一遍,就当记录.之前介绍怎么给视频添加水印时,就已经提到FFmpeg的编译,并且在编译时指定了滤镜的功能. 但是,在手机盛行的时代,读者可能更需要的是能 ...
- 为iOS编译FFmpeg静态库
为iOS编译FFmpeg静态库
环境:OS X Yosemite (版本10.10.5) Xcode (Version 7.1.1 (7B1005))
一.资料准备: (1)ffmpeg源 ...
- 编译x264 for ios
Tested with: x264-snapshot-20140914-2245 我用的是x264-snapshot-20150813-2245.tar.bz2 Xcode 7 依赖gas-prep ...
- 在 Mac OS 上编译 FFmpeg
本文转自:在 Mac OS 上编译 FFmpeg | www.samirchen.com 安装 Xcode 和 Command Line Tools 从 App Store 上安装 Xcode,并确保 ...
- 编译VLC for IOS
之前接触VLC是因为Winrt的项目,后来似乎ARM版本的始终搞不定(没有针对于ARM-COFF的GCC编译器),vlc for winrt的项目好久没有更新了,自己也没有深入研究.有一天跟同事聊,他 ...
- Xcode编译ffmpeg(2)
iOS: FFmpeg编译和使用问题总结 折磨了我近一周多时间的FFmpeg库编译问题终于解决了,必须得把这一段时间来遇到过的坑全写出来.如果急着解决问题,编译最新版本的FFmpeg库请直接看第二部分 ...
- iOS8.1 编译ffmpeg和集成第三方实现直播(监控类)
iOS8.1 编译ffmpeg和集成第三方实现直播(监控类) http://www.mamicode.com/info-detail-476094.html 一,下载并在终端中运行脚本编译ffmpeg ...
随机推荐
- Linux下双物理网卡设置成虚拟网卡
为了提供网络的高可用我们须要将多块网卡绑定设置成一块虚拟的网卡对外提供服务,这样能够防止一块网卡损坏或者防止网线连接故障造成的连接中断. 以下我们使用eth0与eth1来虚拟成为bond0为例:--- ...
- 【Project Euler 8】Largest product in a series
题目要求是: The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × ...
- mysql.sock文件的作用
mysql.sock应该mysql的主机和客户机在同一host上的时候,使用unix domain socket做为通讯协议的载体,它比tcp快.Mysql有两种连接方式: (1)TCP/IP (2 ...
- WCF 之 消息契约(MessageContract)
对于SOAP来说主要由两部分构成Header和Body,他们两个共同构成了SOAP的信封,通常来说Body保存具体的数据内容,Header保存一些上下文信息或关键信息. 比如:在一些情况下,具有这样的 ...
- tarjan+缩点+强连通定理
C - Network of Schools Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I ...
- 算法笔记_152:算法提高 扶老奶奶过街(Java)
目录 1 问题描述 2 解决方案 1 问题描述 一共有5个红领巾,编号分别为A.B.C.D.E,老奶奶被他们其中一个扶过了马路. 五个红领巾各自说话: A :我和E都没有扶老奶奶 B :老奶奶是被 ...
- 算法笔记_139:二分图的最大权匹配(Java)
目录 1 问题描述 2 解决方案 1 问题描述 何为二分图的最大权匹配问题? 最大权二分匹配问题就是给二分图的每条边一个权值,选择若干不相交的边,得到的总权值最大. 2 解决方案 对于此问题的讲解 ...
- 转:介绍shell_notifyicon,SendMessage,CallWindowProc,GetWindowLong,SetWindowLong的用法
Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias " Shell_NotifyIconA& ...
- Python 多重循环
# coding=gbk LOL1 = ['OMG', 'EDG', '皇族'] LOL2 = ['韩国', '欧洲', '美国'] for l1 in LOL1: for l2 in LOL2: p ...
- 2.4.1 用NPOI操作EXCEL关于HSSFClientAnchor(dx1,dy1,dx2,dy2,col1,row1,col2,row2)的参数
NPOI教程:http://www.cnblogs.com/atao/archive/2009/11/15/1603528.html 之所有说NPOI强大,是因为常用的Excel操作她都可以通过编程的 ...