1. 下载:
在终端中输入:git clone git://github.com/lajos/iFrameExtractor.git
注:该文件包中包含ffmpeg库以及demo。
2.编辑:
打开iFrameExtractor文件夹下ffmpeg中的build_armv6和build_armv7,修改./configure后面的参数,主要是SDK版本.我的是4.3,修改为:
./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/iPhoneOS4.3.sdk--cpu=arm1176jzf-s --extra-cflags='-arch armv6'--extra-ldflags='-arch armv6'
3. 编译:
出错,提示:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc isunable to create an executable file.
C compiler test failed.
Undefined symbols for architecture armv7:
"_BZ2_bzDecompressInit",referenced from:
_matroska_decode_buffer inlibavformat.a(matroskadec.o)
"_BZ2_bzDecompressEnd", referencedfrom:
_matroska_decode_buffer inlibavformat.a(matroskadec.o)
"_BZ2_bzDecompress", referencedfrom:
_matroska_decode_buffer inlibavformat.a(matroskadec.o)
添加库libbz2.1.0.dylib,再次编译,OK通过.
以下步骤可以忽略:
7. 修改了ffmpeg版本到最新版(0.7),编译的时候需要把common.mak复制到新版本目录.
编译的时候遇到错误:
ERROR: .endm without .macro at/usr/local/bin/gas-preprocessor.pl line 83,<ASMFILE> line 55
用老版本的libavcodec/arm/asm.S和libavcoec/arm/dsputil_arm.S覆盖新版本(实际上我怀疑只覆盖asm.S即可),重新编译即可.
原文地址:http://blog.csdn.net/tsingien/article/details/6457246