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. ubuntu 下安装 VIM 依赖vim-common错误

    ubuntu 下安装 VIM 依赖vim-common错误 sudo apt-get remove vim-common   先把上面的错误依赖删除 sudo apt-get install vim  ...

  2. WPF显示经常使用的几个显示文字控件TextBox, TextBlock, Lable

    TextBox, TextBlock. Lable 当中TextBox 和Lable均继承了Control类 能够对其进行模板编辑. 而TextBlock没有继承Control所以不能对其进行模板编辑 ...

  3. 老生常谈,HashMap的死循环(转)

    本文转自掘金占小狼:用于理解HashMap为什么线程不安全,不能用于并发. 地址就在下文: 问题 由于HashMap并非是线程安全的,所以在高并发的情况下必然会出现问题,这是一个普遍的问题,虽然网上分 ...

  4. Qt Multimedia Backends(多媒体后端)翻译

    目录 MediaService plugins 媒体服务插件 不同后端支持的媒体播放器功能: 后端支持的摄像头(相机)功能 后端支持的音频解码功能 Audio plugins 音频插件 原文地址: Q ...

  5. 33、深入理解Java的接口和抽象类

    深入理解Java的接口和抽象类 对于面向对象编程来说,抽象是它的一大特征之一.在Java中,可以通过两种形式来体现OOP的抽象:接口和抽象类.这两者有太多相似的地方,又有太多不同的地方.很多人在初学的 ...

  6. 转:sock_ev——linux平台socket事件框架(socket代理类) .

    前面分析了对socket基本操作的封装,并按照数据的传送方式写了两个类,本篇将写一个代理类提供给库的使用者使用的类. /**************************************** ...

  7. spring Log4j关于No appenders could be found for logger的警告

    (spring环境下)配置Log4j时候,当启动WEB程序时,提示了如标题的警告,具体如下:log4j:WARN No appenders could be found for logger (org ...

  8. FFMPEG音视频解码

    文章转自:https://www.cnblogs.com/CoderTian/p/6791638.html 1.播放多媒体文件步骤 通常情况下,我们下载的视频文件如MP4,MKV.FLV等都属于封装格 ...

  9. 使用xftp连接VirtualBox中的centos6.5

    首先要在windows上安装xftp软件,这个是傻瓜式操作就不说了 安装完毕之后,在centos上查看是否装了xftpd服务. [root@centos Desktop]# rpm -qa | gre ...

  10. django 常用命令 详解

    check     compilemessages     createcachetable     dbshell     diffsettings     dumpdata     flush   ...