简体   繁体   English

在Mac 10.8上安装ffmpeg ios库armv7,armv7s,i386和Universal

[英]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.ta​​r.bz2https://ffmpeg.org/download.html ),并解压到文件夹中的文件

Make sure you have the latest Command Line Tools under Xcode >; 确保在Xcode>下具有最新的命令行工具; Preferences >; 首选项>; Downloads >; 下载>; Components 组件

Install gas-preprocessor 安装气体预处理器

  1. Click on the ZIP icon to download https://github.com/mansr/gas-preprocessor . 单击ZIP图标以下载https://github.com/mansr/gas-preprocessor
  2. Copy gas-preprocessor.pl to /usr/bin directory. 将gas-preprocessor.pl复制到/ usr / bin目录。
  3. Change permission of gas-preprocessor.pl by setting the privilege to Read & Write for all. 通过将权限设置为所有人均具有读写权限来更改gas-preprocessor.pl的权限。

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 安装气体预处理器

  1. Click on the ZIP icon to download https://github.com/mansr/gas-preprocessor . 单击ZIP图标以下载https://github.com/mansr/gas-preprocessor
  2. Copy gas-preprocessor.pl to /usr/bin directory. 将gas-preprocessor.pl复制到/ usr / bin目录。
  3. Change permission of gas-preprocessor.pl by setting the privilege to Read & Write for all. 通过将权限设置为所有人均具有读写权限来更改gas-preprocessor.pl的权限。

Download my shell script from: https://gist.github.com/m1entus/6983547 从以下位置下载我的Shell脚本: https : //gist.github.com/m1entus/6983547

  1. Run 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库,您可以使用以下小脚本

  1. Download ffmpeg source 下载ffmpeg源
  2. Download https://github.com/wang-bin/build_ffmpeg 下载https://github.com/wang-bin/build_ffmpeg
  3. Open terminal and run export FFSRC=/path/to/ffmpeg 打开终端并运行export FFSRC=/path/to/ffmpeg
  4. Goto build_ffmpeg folder and run: ./ios.sh 转到build_ffmpeg文件夹并运行: ./ios.sh
  5. After successful building, result will be in sdk-ios folder 成功构建后,结果将在sdk-ios文件夹中
  6. Add include folder and lib folder in your Xcode project 在Xcode项目中添加include文件夹和lib文件夹

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在带有10.9的xCode 6.1 Mac上安装ffmpeg ios库armv7,armv7s,i386和Universal - Installing ffmpeg ios libraries armv7, armv7s, i386 and universal on xCode 6.1 Mac with 10.9 为armv7,armv7s,arm64,i386和通用构建ffmpeg iOS库 - Building ffmpeg iOS libraries for armv7, armv7s, arm64, i386 and universal 具有i386 x86_64 armv7 armv7s arm64的通用IOS静态库 - universal IOS static library with i386 x86_64 armv7 armv7s arm64 无法为armv7进行编译,此处有效的体系结构为armv6,armv7和i386 - Cannot compile for armv7s here valid architectures are armv6, armv7 and i386 Mac上的iOS模拟器是运行i386架构,而不是armv7? - iOS simulator on mac is running i386 architecture, not armv7? $(ARCHS_STANDARD_32_BIT)vs. armv6,armv7 / armv7s vs. i386 - $(ARCHS_STANDARD_32_BIT) vs. armv6, armv7/armv7s vs. i386 检查依赖项...没有要编译的体系结构(ARCHS = i386,VALID_ARCHS = arm64 armv7s armv7) - Check dependencies… No architectures to compile for (ARCHS=i386, VALID_ARCHS=arm64 armv7s armv7) 没有要编译的架构(ARCHS = i386,VALID_ARCHS = arm64 armv7 armv7s) - No architectures to compile for (ARCHS=i386, VALID_ARCHS=arm64 armv7 armv7s) 如何构建支持i386和armv7的ios框架 - how to build ios framework to support i386 and armv7 无法为armv7和armv7s编译FFMpeg - Unable to compile FFMpeg for armv7 and armv7s
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM