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. C++ 声明与引用

    任何一个技术或者知识点,都是为了解决某个问题.也就是都有他的使用场景,或者说为什么搞出这种技术. 1.解决的问题:现实生活中的例子,要使用一个工具,必要把工具放在这里,或者说我有这个工具.工具只能放在 ...

  2. MyEclipse发布按钮无效的办法

    删除存放您MyEclipse项目的目录下的“/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.genuitec.eclipse.as ...

  3. vb.net Bitmap Drawing

    Public Class Form1 Dim BMP As New Drawing.Bitmap(640, 480) Dim GFX As Graphics = Graphics.FromImage( ...

  4. Asp.Net Web Api 图片上传

    public string UploadFile()        {            if (Request.Content.IsMimeMultipartContent())         ...

  5. Java中解压文件名有中文的rar包出现乱码问题的解决

    import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import j ...

  6. 【Oracle】查看死锁与解除死锁

    1.查询死锁的进程(下面2条语句均可用) 语句1: select sess.sid, sess.serial#, lo.oracle_username, lo.os_user_name, ao.obj ...

  7. c#:无法将类型为“System.DBNull”的对象强制转换为类型“System.String”

    解决办法: 使用转换函数即可: Convert.ToString(要转换的值);

  8. cxf 生成客户端代码调用服务

    cxf是另一种发布webservice的方式,与jdk提供的相比 jdk提供的是wsimport cxf 提供的是 wsdl2java- d 地址 根据http://www.cnblogs.com/f ...

  9. mybatis WARN No appenders could be found for logger的解决方法

    log4j:WARN No appenders could be found for logger (org.apache.ibatis.logging.LogFactory).log4j:WARN ...

  10. nyoj 37 回文字符串 【DP】

    先反向复制一个新的字符串,然后再找出最长公共子串,在用长度n减去就可以 回文字符串 时间限制:3000 ms  |  内存限制:65535 KB 难度:4 描写叙述 所谓回文字符串,就是一个字符串,从 ...