iOS8.1 ffmpeg编译git
最近项目须要,从新编译了一下ffmpegxcode
网上找了诸多脚本,都没有运行成功。app
最后在CSDN上找到的脚本,修改后编译成功。ui
贴下来分享给你们:spa
#!/bin/shcode
#Create by Kingxl orm
#http://itjoy.orgserver
#Make sure you have installed: Xcode/Preferences/Downloads/Components/Command Line Toolsget
#FFmpeg source -->git://source.ffmpeg.org/ffmpeg.gitit
#Build armv7 armv7s arm64
#Download FFmpeg source
#git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
#Setting your SDK Version.
SDK_VERSION="8.1"
#ARCH
ARCHS="armv7 armv7s arm64"
#Output DIR
DEST=/Users/huzhanlong/Documents/FionaWork/2014stream/libffmpeg/
DEVPATH=/Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDK_VERSION}.sdk
export CC=`xcodebuild -find gcc`
for ARCH in $ARCHS; do
echo "Building $ARCH ......"
./configure \
--enable-cross-compile \
--target-os=darwin \
--arch=$ARCH \
--sysroot=$DEVPATH \
--extra-cflags="-arch $ARCH" \
--extra-ldflags="-L$DEVPATH/usr/lib/system -arch $ARCH" \
--prefix=$DEST/$ARCH \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-iconv \
--disable-bzlib \
--enable-avresample \
--disable-asm
make && make install && make clean
echo "Installed:$DEST/$ARCH"
done
脚本中的DEST路径须要改成你本身的路径,SDK版本也须要改成你的SDK版本
以上代码作成.sh文件放在ffmpeg文件夹下,终端编译经过.