2项依赖:
  • gas-preprocessor(见附录:gas-preprocessor简介)
  • yasm 1.2.0
如果要集成x264和fdk_aac,需要先编译x264和fdk_aac。
Usage(用root执行)
  • To build everything:
./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 for iOS的更多相关文章

  1. 编译ffmpeg(iOS)

    一,x264库的编译 首先到http://www.videolan.org/developers/x264.html下载x264的库,然后解压,修改文件夹名称为x264     二,下载ffmpeg2 ...

  2. iOS编译FFmpeg、kxmovie实现视频播放 (转载)

    由于FFmpeg开源框架的功能非常强大,可以播放的视频种类很多,同时添加第三方库kxmovie,实现视频播放,真的是爽爆了,因此今天来说一下关于FFmpeg在iOS手机上的一些配置过程,配置工具,还有 ...

  3. 多媒体开发(7):编译Android与iOS平台的FFmpeg

    编译FFmpeg,一个古老的话题,但小程还是介绍一遍,就当记录.之前介绍怎么给视频添加水印时,就已经提到FFmpeg的编译,并且在编译时指定了滤镜的功能. 但是,在手机盛行的时代,读者可能更需要的是能 ...

  4. 为iOS编译FFmpeg静态库

    为iOS编译FFmpeg静态库 
 环境:OS X Yosemite (版本10.10.5) Xcode (Version 7.1.1 (7B1005)) 
 
 一.资料准备: (1)ffmpeg源 ...

  5. 编译x264 for ios

    Tested with: x264-snapshot-20140914-2245  我用的是x264-snapshot-20150813-2245.tar.bz2 Xcode 7 依赖gas-prep ...

  6. 在 Mac OS 上编译 FFmpeg

    本文转自:在 Mac OS 上编译 FFmpeg | www.samirchen.com 安装 Xcode 和 Command Line Tools 从 App Store 上安装 Xcode,并确保 ...

  7. 编译VLC for IOS

    之前接触VLC是因为Winrt的项目,后来似乎ARM版本的始终搞不定(没有针对于ARM-COFF的GCC编译器),vlc for winrt的项目好久没有更新了,自己也没有深入研究.有一天跟同事聊,他 ...

  8. Xcode编译ffmpeg(2)

    iOS: FFmpeg编译和使用问题总结 折磨了我近一周多时间的FFmpeg库编译问题终于解决了,必须得把这一段时间来遇到过的坑全写出来.如果急着解决问题,编译最新版本的FFmpeg库请直接看第二部分 ...

  9. iOS8.1 编译ffmpeg和集成第三方实现直播(监控类)

    iOS8.1 编译ffmpeg和集成第三方实现直播(监控类) http://www.mamicode.com/info-detail-476094.html 一,下载并在终端中运行脚本编译ffmpeg ...

随机推荐

  1. android java 设计模式详解 Demo

    android java 设计模式详解 最近看了一篇设计模式的文章,深得体会,在此基础我将每种设计模式的案例都写成Demo的形式,方便读者研究学习, 首先先将文章分享给大家: 设计模式(Design ...

  2. GMM高斯混合模型 学习(2)

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaHpxMjAwODExMjExMDc=/font/5a6L5L2T/fontsize/400/fill/I0 ...

  3. Unity Game Starter Kit for Windows Store and Windows Phone Store games

    原地址:http://digitalerr0r.wordpress.com/2013/09/30/unity-game-starter-kit-for-windows-store-and-window ...

  4. Jquery重新学习之九[Ajax运用总结C]

    前两篇文章主要介绍Jquery如何利用Ajax进行操作数据,主要介绍调用的方法:其中Jquery.ajax()是Jquery中最底层的方法:Jquery还定义的一个方法跟几个事件为Jquery.aja ...

  5. 具有SSM框架的CRUD与多条件查询

    概述 居于ssm版本的crud跟多添加查询, 并带分页的demo 详细 代码下载:http://www.demodashi.com/demo/13653.html 一.功能展示 部门CRUD: 员工C ...

  6. Android API之onLayout, onMeasure

    android.view.ViewGroup protected void onLayout(boolean changed, int l, int t, int r, int b) 执行layout ...

  7. easyui框架Date日期类型以json形式显示到前台datagrid时,显示为[object Object]

    如下图,easyui当后台把时间数据返回转换成json然后加载在easyui的datagrid里面,显示为[object Object]      需要对时间格式添加格式的显示方法 /** * 时间格 ...

  8. css-input与文字的对齐

    前言 目前中文网站上面的文字,就我的个人感觉而言,绝大多数网站的主流文字大小为12px,因为在目前高分辨率显示器屏幕下,11px的汉字,其像素点开始不 规整,文字不如12px来的显示良好.12px大小 ...

  9. java基础学习总结——GUI编程(一) 还未仔细阅读

    一.AWT介绍

  10. Uva 10815-Andy's First Dictionary(串)

    Problem B: Andy's First Dictionary Time limit: 3 seconds Andy, 8, has a dream - he wants to produce ...