iFrameExtractor:https://github.com/lajos/iFrameExtractor.git
ffmpeg-iphone-build-master :https://github.com/gabriel/ffmpeg-iphone-build.git
ffmpeg: git://source.ffmpeg.org/ffmpeg.git
在终端输入 git clone https://github.com/lajos/iFrameExtractor.git
然后再输入 git clone https://github.com/gabriel/ffmpeg-iphone-build.git
以及 git clone git://source.ffmpeg.org/ffmpeg.git
克隆下来,将ffmpeg文件夹放进ffmpeg-iphone-build目录下,并把文件夹名修改成ffmpeg-armv7
然后修改 build-armv7可执行文件(真机) 在 ./configure 修改成自己XCODE对应的路径 (XCODE5用下面这个行不通,会报错)
#!/bin/sh trap exit ERR FFMPEG_DIR=ffmpeg-armv7 SCRIPT_DIR=$( (cd -P $(dirname $0) && pwd) ) echo "Pulling r22403..." cd $FFMPEG_DIR mkdir -p dist # Default configure options CONFIGURE_OPTIONS="--enable-gpl --enable-postproc --enable-swscale --enable-avfilter --disable-asm --enable-cross-compile" # Add x264 if exists X264_DIST="$SCRIPT_DIR/x264-armv7/dist" if [ -d "$X264_DIST" ]; then CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS --enable-libx264 --extra-ldflags=-L$X264_DIST/lib --extra-cflags=-I$X264_DIST/include" fi # Add xvid if exists XVID_DIST="$SCRIPT_DIR/xvid-armv7" if [ -d "$XVID_DIST" ]; then CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS --enable-libxvid --extra-ldflags=-L$XVID_DIST/lib --extra-cflags=-I$XVID_DIST/include" fi echo "Configure options: $CONFIGURE_OPTIONS" ./configure --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as="$SCRIPT_DIR/gas-preprocessor.pl/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" --extra-ldflags=-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk --extra-cflags="-mdynamic-no-pic" --prefix="dist"$CONFIGURE_OPTIONS --target-os=darwin --arch=armv7 --cpu=armv7 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7' make && make install echo "Installed: $FFMPEG_DIR/dist"
libavcodec.a、libavdevice.a、libvfilter.a、libavformat.a
libvutil.a、libwresamle.a、libwscale.a以及他们相关的头文件
(头文件不要直接添加到项目中)
将以上静态库加入项目Link Binary With Libraries中
另外请确保libiconv.dylib、libbz2.dylib、libz.dylib也在Link Binary With Libraries中
将 Build Settings中(注意)
Library Search Paths 添加 /Users/dale_hui/Music/FFMPEG_DemoByhui/FFMPEG_DemoByhui/ffmpeg/lib 这个路径就是你存放以上几个刚生成出来的路径
Header Search Paths 添加 /Users/dale_hui/Music/FFMPEG_DemoByhui/FFMPEG_DemoByhui/ffmpeg/include 这个路径就是刚才生成出头文件的路径
其次Archiectures 要 删掉 $(ARCHS_STANDARD_32_BIT) 添加armv6,armv7
著作权声明:本文由 http://blog.csdn.net/dalehui/ 原创,欢迎转载分享。请尊重作者劳动,转载时保留该声明和作者博客链接,谢谢!