编译ffmepg模拟器版本:
1. 到https://github.com/gabriel/ffmpeg-iphone-build下载ffmpeg-iphone-build
2.先将gas-preprocessor.pl拷贝到/usr/sbin/目录中。
3.到ffmpeg官网上下载ffmpeg源码
4.在终端下定位到ffmpeg的目录运行
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-avfilter --disable-debug --disable-encoders --enable-cross-compile --disable-decoders --disable-armv5te --enable-decoder=h264 --enable-pic --cc=/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' --extra-ldflags=-L/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/system --sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk --target-os=darwin --arch=i386 --cpu=i386 --extra-cflags='-arch i386' --extra-ldflags='-arch i386'
5.输入make命令
6.将libavcodec.a,libavdevice.a,libavformat.a,libavutil.a,libswscale.a到对应的目录下拷贝出来。
mkdir i386
mkdir lib
mv libavcodec/libavcodec.a i386/
mv libavdevice/libavdevice.a i386/
mv libavformat/libavformat.a i386/
mv libavutil/libavutil.a i386/
mv libswscale/libswscale.a i386/
./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 --enable-decoder=rawvideo --disable-asm
9 make
10
mv libavcodec/libavcodec.a armv7/
mv libavdevice/libavdevice.a armv7/
mv libavformat/libavformat.a armv7/
mv libavutil/libavutil.a armv7/
mv libswscale/libswscale.a armv7/
lipo -create -arch armv7 armv7/libavcodec.a -arch i386 i386/libavcodec.a -output universal/libavcodec.a
lipo -create -arch armv7 armv7/libavdevice.a -arch i386 i386/libavdevice.a -output universal/libavdevice.a
lipo -create -arch armv7 armv7/libavformat.a -arch i386 i386/libavformat.a -output universal/libavformat.a
lipo -create -arch armv7 armv7/libavutil.a -arch i386 i386/libavutil.a -output universal/libavutil.a
lipo -create -arch armv7 armv7/libswscale.a -arch i386 i386/libswscale.a -output universal/libswscale.a
11.用xcode打开iFrameExtractor.xcodeproj,现在编译会出错,需要修改几个地方:
左边选中工程,中间选中target,右面选中Build settings,在Architectures选项卡里面选择Architetures为Optimized(armv7),Base SDK为Latest iOS(iOS 4.3) Valid Architectures填写armv7.
编译目标选择iOS Device,当然,如果有连接电脑的设备,可以选择设备.
https://github.com/yuvi/gas-preprocessor/issues/16
https://github.com/rodisbored/ffmpeg_x264_iOS5_build
你打开文本编辑程序,讲完整的程序粘贴到文本里。保存成airport.sh,后缀名一定要.sh。
1.mov格式解析
http://blog.csdn.net/sunshine1314/article/details/2547275
2。mov解析的开源工程:bento4和ffmpeg,其中bento4直接有xcode的工程文件,和比较详细的test代码
3。ffmpeg如何解析帧图像,可以看看extracting-frames-from-movies-on-iphone
http://www.codza.com/extracting-frames-from-movies-on-iphone
4。ffmpeg iphone编译
http://www.cnblogs.com/wwwkhd/archive/2011/08/09/2131780.html
5.图解autoscan、aclocal、autoheader、automake、autoconf、configure、make http://jaguar13.iteye.com/blog/614427
6第十五章 make的常见错误信息
http://www.linuxsir.org/main/doc/gnumake/GNUmake_v3.80-zh_CN_html/make-15.html
编译出错,提示:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc is unable to create an executable file.
C compiler test failed.
Undefined symbols for architecture armv7:
"_BZ2_bzDecompressInit", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
"_BZ2_bzDecompressEnd", referenced from:
_matroska_decode_buffer in libavformat.a(matroskadec.o)
"_BZ2_bzDecompress", referenced from:
_matroska_decode_buffer in libavformat.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即可),重新编译即可.