[英]Installing ffmpeg ios libraries armv7, armv7s, i386 and universal on xCode 6.1 Mac with 10.9
[英]Installing ffmpeg ios libraries armv7, armv7s, i386 and universal on Mac with 10.8
如何在帶有10.8的Mac上安裝最新的ffmpeg ios庫armv7,armv7s,i386和Universal?
幾天后,我逐步說明了此安裝:
FFmpeg構建說明MAC 10.8或更高版本
復制的ffmpeg-2.0.tar.bz2( https://ffmpeg.org/releases/ffmpeg-1.0.7.tar.bz2 , https://ffmpeg.org/download.html ),並解壓到文件夾中的文件
確保在Xcode>下具有最新的命令行工具; 首選項>; 下載>; 組件
安裝氣體預處理器
從版本10.8開始的xcrun中的錯誤
打開終端並粘貼以下命令,然后按Enter:
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"
cd到ffmpeg-2文件夾並粘貼以下命令,然后按Enter:
mkdir armv7
mkdir armv7s
mkdir i386
mkdir -p universal/lib
要配置armv7s庫,請粘貼以下命令,然后按Enter:
./configure --prefix=armv7s --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" --extra-cflags="-arch armv7s -mfpu=neon -miphoneos-version-min=6.1" --extra-ldflags="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.1" --arch=arm --cpu=cortex-a9 --enable-pic
(請注意與上述相同的規則:如果配置失敗,請轉至Applications / Xcode.app / Contents / Developer / Platforms / iPhoneOS.platform / Developer / SDKs /,並確保sdk文件夾為iPhoneOS6.1.sdk,如果未更改, config命令以反映iPhoneOSx.x.sdk並將所有目標更改為xx)
要構建和安裝armv7s庫,請粘貼以下命令,然后按Enter:
make clean && make && make install
要配置i386(以便模擬器可以工作)庫,請粘貼以下命令,然后按Enter:
./configure --prefix=i386 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk" --arch=i386 --cpu=i386 --enable-pic --disable-asm
(注意:此命令與前兩個配置命令不同,如果僅將它們指向箭頭,則該命令將失敗)
要構建和安裝i386庫,請粘貼以下命令,然后按Enter:
make clean && make && make install
要創建通用庫(這是添加到xcode的庫),請粘貼以下命令,然后按Enter:
cd armv7/lib
for file in *.a
do
cd ../..
xcrun -sdk iphoneos lipo -output universal/lib/$file -create -arch armv7 armv7/lib/$file -arch armv7s armv7s/lib/$file -arch i386 i386/lib/$file
echo "Universal $file created."
cd -
done
cd ../..
支持適用於iOS7和XCode5的通用ffmpeg庫:
確保在Xcode>下具有最新的命令行工具; 首選項>; 下載>; 組件
安裝氣體預處理器
從以下位置下載我的Shell腳本: https : //gist.github.com/m1entus/6983547
sh build-ffmpeg.sh
。 我需要arm64支持,並且此腳本對我有用: https : //github.com/kewlbear/FFmpeg-iOS-build-script
使用
./build-ffmpeg.sh arm64 x86_64
適用於iOS 64位和模擬器架構。 然后將“ fat”目錄中的內容復制到您的Xcode項目中。
我對腳本所做的唯一修改是取消注釋此行:
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-avresample"
編譯libavresample庫。
編輯:但是,使用iOS 7.1 SDK不能與armv7和armv7s一起使用。 如果找到解決方案,請在此處發布。
為了構建ffmpeg iOS庫,您可以使用以下小腳本 。
export FFSRC=/path/to/ffmpeg
build_ffmpeg
文件夾並運行: ./ios.sh
sdk-ios
文件夾中
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.