[英]Installing ffmpeg ios libraries armv7, armv7s, i386 and universal on Mac with 10.8
如何在带有10.8的Mac上安装最新的ffmpeg ios库armv7,armv7s,i386和Universal?
After a couple of days I have made step by step instructions for this install: 几天后,我逐步说明了此安装:
FFmpeg Build Instructions MAC 10.8 or better FFmpeg构建说明MAC 10.8或更高版本
Copy ffmpeg-2.0.tar.bz2 ( https://ffmpeg.org/releases/ffmpeg-1.0.7.tar.bz2 , https://ffmpeg.org/download.html ) and Unzip to Documents folder 复制的ffmpeg-2.0.tar.bz2( https://ffmpeg.org/releases/ffmpeg-1.0.7.tar.bz2 , https://ffmpeg.org/download.html ),并解压到文件夹中的文件
Make sure you have the latest Command Line Tools under Xcode >; 确保在Xcode>下具有最新的命令行工具; Preferences >;
首选项>; Downloads >;
下载>; Components
组件
Install gas-preprocessor 安装气体预处理器
Bug in xcrun starting in version 10.8 从版本10.8开始的xcrun中的错误
open terminal and paste in following command and press enter: 打开终端并粘贴以下命令,然后按Enter:
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"
cd to ffmpeg-2 folder and paste in following command and press enter: cd到ffmpeg-2文件夹并粘贴以下命令,然后按Enter:
mkdir armv7
mkdir armv7s
mkdir i386
mkdir -p universal/lib
To config armv7s library paste in following command and press enter: 要配置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
(Note same rule as above: if config fails go to Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ and make sure that the sdk folder is iPhoneOS6.1.sdk, if not change the config command to reflect iPhoneOSx.x.sdk and change all targets to xx)
(请注意与上述相同的规则:如果配置失败,请转至Applications / Xcode.app / Contents / Developer / Platforms / iPhoneOS.platform / Developer / SDKs /,并确保sdk文件夹为iPhoneOS6.1.sdk,如果未更改, config命令以反映iPhoneOSx.x.sdk并将所有目标更改为xx)
To build and install armv7s library paste in following command and press enter: 要构建和安装armv7s库,请粘贴以下命令,然后按Enter:
make clean && make && make install
To config i386 (so simulator will work ) library paste in following command and press enter: 要配置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
(Note: this is not the same command as the previous two config commands, if you just arrow up to them this will fail)
(注意:此命令与前两个配置命令不同,如果仅将它们指向箭头,则该命令将失败)
To build and install i386 library paste in following command and press enter: 要构建和安装i386库,请粘贴以下命令,然后按Enter:
make clean && make && make install
To make universal library ( which is the library added to xcode ) paste in following command and press enter: 要创建通用库(这是添加到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 ../..
Support universal ffmpeg library for iOS7 and XCode5: 支持适用于iOS7和XCode5的通用ffmpeg库:
Make sure you have the latest Command Line Tools under Xcode >; 确保在Xcode>下具有最新的命令行工具; Preferences >;
首选项>; Downloads >;
下载>; Components
组件
Install gas-preprocessor 安装气体预处理器
Download my shell script from: https://gist.github.com/m1entus/6983547 从以下位置下载我的Shell脚本: https : //gist.github.com/m1entus/6983547
sh build-ffmpeg.sh
. sh build-ffmpeg.sh
。 I needed arm64 support and this script worked for me: https://github.com/kewlbear/FFmpeg-iOS-build-script 我需要arm64支持,并且此脚本对我有用: https : //github.com/kewlbear/FFmpeg-iOS-build-script
Use 使用
./build-ffmpeg.sh arm64 x86_64
for iOS 64-bit and simulator architecture. 适用于iOS 64位和模拟器架构。 Then copy the contents in the "fat" directory into your Xcode project.
然后将“ fat”目录中的内容复制到您的Xcode项目中。
The only modification I made to the script was uncommenting this line: 我对脚本所做的唯一修改是取消注释此行:
CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-avresample"
to compile the libavresample library. 编译libavresample库。
Edit: It's not working with armv7 and armv7s however, using iOS 7.1 SDK. 编辑:但是,使用iOS 7.1 SDK不能与armv7和armv7s一起使用。 If I find a solution I'll post here.
如果找到解决方案,请在此处发布。
For building ffmpeg iOS libraries you can use this little scripts . 为了构建ffmpeg iOS库,您可以使用以下小脚本 。
export FFSRC=/path/to/ffmpeg
export FFSRC=/path/to/ffmpeg
build_ffmpeg
folder and run: ./ios.sh
build_ffmpeg
文件夹并运行: ./ios.sh
sdk-ios
folder sdk-ios
文件夹中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.