ios ffmpeg库 编译记录

如果avcodec_find_encoder返回空(null),那么肯定是ffmpeg configure的时候没有带上--enable-libx264这个选项。另外要标明x264的位置,否则configure报错。除了注明x264的位置,还要先编译x264。这儿要注意,一定要对应arm处理器的类型。如果你现在在编译armv7版本的ffmpeg,那么x264也要编译armv7的版本。x264编译的configure见我的另一篇博文:http://blog.csdn.net/ixfly/article/details/7621258


ffmpeg configure指令。

./configure \
--enable-libx264 \
--enable-gpl \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffserver \
--enable-cross-compile \
--arch=arm \
--target-os=darwin \
--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk \
--cpu=cortex-a8 \
--extra-cflags='-arch armv7' \
--extra-ldflags='-arch armv7' \
--enable-pic \
--extra-ldflags=-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system \
--extra-cflags=-I/Users/liulei/Desktop/svn/LiaoVideoCoder/x264 \
--extra-ldflags=-L/Users/liulei/Desktop/svn/LiaoVideoCoder/x264 \
--enable-small \
--disable-debug \
--disable-doc 

替换静态库时一点要先clean项目,彻底杀死iPhone上的应用。否则不会重新编译。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值