【发布时间】:2013-08-02 21:44:41
【问题描述】:
如何在 10.8 的 Mac 上安装最新的 ffmpeg ios 库 armv7、armv7s、i386 和通用?
【问题讨论】:
-
请参考这篇文章 github 存储库它会帮助你:stackoverflow.com/questions/19341770/ffmpeg-ios-7-library/…
如何在 10.8 的 Mac 上安装最新的 ffmpeg ios 库 armv7、armv7s、i386 和通用?
【问题讨论】:
几天后,我为这个安装制定了分步说明:
FFmpeg 构建说明 MAC 10.8 或更高版本
复制 ffmpeg-2.0.tar.bz2 (https://ffmpeg.org/releases/ffmpeg-1.0.7.tar.bz2, https://ffmpeg.org/download.html) 并解压到 Documents 文件夹
确保你在 Xcode 下拥有最新的命令行工具 >;偏好 >;下载 >;组件
安装气体预处理器
从版本 10.8 开始的 xcrun 中的错误
打开终端并粘贴以下命令并回车:
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"
cd 到 ffmpeg-2 文件夹并粘贴以下命令并回车:
mkdir armv7
mkdir armv7s
mkdir i386
mkdir -p universal/lib
要配置 armv7s 库,请粘贴以下命令并回车:
./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
(注意与上面相同的规则:如果配置失败转到 应用程序/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ 并确保 sdk 文件夹是 iPhoneOS6.1.sdk,如果不更改 配置命令以反映 iPhoneOSx.x.sdk 并更改所有目标 到 x.x)
要构建和安装 armv7s 库,请粘贴以下命令并回车:
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 下拥有最新的命令行工具 >;偏好 >;下载 >;组件
安装气体预处理器
从https://gist.github.com/m1entus/6983547下载我的shell脚本
sh build-ffmpeg.sh。【讨论】:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc is unable to create an executable file. C compiler test failed. GCC 在 Xcode5 中显然已贬值。我很不确定下一步该做什么。
我需要 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 库。
编辑:但是,它不适用于 armv7 和 armv7s,使用 iOS 7.1 SDK。如果我找到解决方案,我会在这里发布。
【讨论】:
要构建 ffmpeg iOS 库,您可以使用 this little scripts。
export FFSRC=/path/to/ffmpeg
build_ffmpeg 文件夹并运行:./ios.sh
sdk-ios文件夹中【讨论】: