iOS8.1 ffmpeg編譯

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文件夾下,終端編譯經過.

相關文章
相關標籤/搜索