实战ios下编译ffmpeg

 1。先下载两个源码

       iFrameExractor    git://github.com/lajos/iFrameExtractor.git

       ffmpeg   git://source.ffmpeg.org/ffmpeg.git    这个最新到1.0

    说明下,开始学习的时候看网上都是给  git clone git://github.com/lajos/iFrameExtractor.git 的地址。这个地址搞的郁闷死了,首先不懂git是啥东西,在浏览器上粘贴地址并回车没有反应(火狐上),在终端输入执行后,提示git no find。没有办法,学习git(哥没有搞过linux下的东东)。在还不明白git的怎么回事的时候,无意在Safari上粘贴地址并回车。有反应了。原来把git clone取消复制后面的地址就可以。 擦擦擦。  

      记得把ffmpeg文件夹放到iFrameExractor中。。

   2。下载ffmpeg-iphone-build(网址:https://nodeload.github.com/gabriel/ffmpeg-iphone-build/zip/master

        拷贝gas-preprocessor.pl到/usr/local/bin 

   说明:这个下载比上个下载就简单多了(哥不熟悉git)

  3。在终端下: cd /iFrameExtractor/ffmpeg   建议开始就执行  sudo -s (获取权限命令)

  4。在终端下输入 ./configure --prefix=/iFrameExtractor/ffmpeg --libdir=iFrameExtractor/ffmpeg/lib --enable-gpl --enable-static --disable-shared  --enable-swscale --enable-zlib --enable-bzlib --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-pthreads

 5。执行make 这里会有一堆的编译情况。看到这些编译,心里踏实了(因为至少在做事情)

     最好先升级Command Line Tools  。方法:Xcode/Preferences/Downloads/Components 安装Command Line Tools

 6。执行make install。 (执行完后 到iFrameExtractor/ffmpeg/lib文件上去看看)

    出现了 libavcodec    libavdevice    libavformat    libavutil    libswscale5个.a文件.终于出来了。

   用xcode 打开iFrameExractor工程,确认Header Search Paths里有:"$(SRCROOT)/ffmpeg"路径。  $(SRCROOT)表示工程路径。同时可以看到iFrameExractor工程下ffmpeg文件下的.a文件都不是红色的了。

  

真机上编译(模拟器上i386,真机上是arm的,真机还分arm6 和arm7 ) 以下是针对arm7的

  7。 ./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' -- sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk' --enable-pic

  8。执行 make 和make install  就有上面的几个.a文件。 ok

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值