【发布时间】:2013-04-05 11:27:45
【问题描述】:
我正在尝试为具有 arm7 架构的 IOS 平台编译 FFMPEG 库。我从 http://www.ffmpeg.org 下载了 FFMPEG 库。
我成功地为 iPhoneSimulator 的 i386 架构构建了静态库。但我需要 iPhoneOS 的库。使用配置命令我得到一个错误。以下是我的命令详细信息。
对于 i386(无错误):
./configure --enable-cross-compile --disable-debug --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc --disable-network --disable-everything --enable-protocol=file --enable-demuxer=mov --enable-muxer=mpegts --enable-bsf=h264_mp4toannexb --arch=i386 --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc --as='./gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneOS6.1.sdk --cpu=i386 --extra-cflags='-arch i386' --extra-ldflags='-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk' --prefix="/Users/amit/Desktop/LivuLib-master/LivuLIb/ffmpeg/bin/newLib"
对于 armv7:
./configure --enable-cross-compile --disable-debug --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc --disable-network --disable-everything --enable-protocol=file --enable-demuxer=mov --enable-muxer=mpegts --enable-bsf=h264_mp4toannexb --arch=armv7 --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='./gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk --cpu=cortex-a9 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk' --prefix="/Users/amit/Desktop/LivuLib-master/LivuLIb/ffmpeg/bin/newLib"
对于 Arm7 的上述命令,我收到此错误:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc is unable to create an executable file.
C compiler test failed.
If you think configure made a mistake, make sure you are using the latest
version from SVN.
所以请给我一个可能的解决方案。为什么它不起作用?还是我需要更新任何东西。谢谢。
【问题讨论】:
-
有关 LGPL 和 iOS 不兼容性的信息,请参阅此页面,在尝试在 iOS 应用程序中使用 ffmpeg 之前,您需要考虑这一点:compatibility-between-the-iphone-app-store-and-the-lgpl。
-
对于那些寻找使用 Xcode 5 交叉编译 iOS 平台的 ffmpeg 库的答案的人,请研究来自 ffmpeg4ios.org 的构建脚本并修改 SDK 以获得最新版本。类似问题stackoverflow.com/questions/19092796/build-ffmpeg-with-xcode-5
-
这是一个基于 iOS 7.0 SDK (Xcode 5) 为 iOS 6.1+ 构建 FFmpeg 的脚本:github.com/renebigot/build_FFmpeg_for_iOS 它将构建通用(armv7、armv7s 和 i386)静态库。
标签: ios objective-c linux video ffmpeg