2013-04-05 31 views
3

我试图编译FFMPEG库的IOS平台与ARM7架构。我从http://www.ffmpeg.org下载了FFMPEG库。试图编译与armv6和arv7架构的iPhoneOS平台的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. 

所以请给我一个可能的解决方案。为什么它不起作用?或者我需要更新任何东西。谢谢。

+0

有关LGPL和iOS不兼容性的信息,请参阅此页面,在尝试在iOS应用程序中使用ffmpeg之前,您需要考虑此问题:[兼容性 - iphone-app-store-and-the-lgpl]( http://multinc.com/2009/08/24/compatibility-between-the-iphone-app-store-and-the-lgpl/)。 – MoDJ 2013-06-19 22:05:10

+0

下面是一个为基于iOS 7.0 SDK(Xcode 5)的iOS 6.1+构建FFmpeg的脚本:https://github.com/renebigot/build_FFmpeg_for_iOS它将构建通用(armv7,armv7s和i386)静态库。 – Massale 2013-10-09 00:11:30

+0

对于那些寻找使用Xcode 5交叉编译iOS平台的ffmpeg库的答案的人,请从http://www.ffmpeg4ios.org/学习构建脚本并修改SDK以获取最新版本。类似的问题http://stackoverflow.com/questions/19092796/build-ffmpeg-with-xcode-5 – 2013-10-01 15:17:08

回答

2

我意识到这个问题被问到约2.5个月前,所以提问者可能已经移动,但我在搜索同一问题的答案时遇到了它。所以,希望这会对那里的人有所帮助!

我真的不得不做的是验证所有我使用的路径实际上指向的东西存在。

具体来说,我试图运行:

./configure \ 
--prefix=armv7 \ 
--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.0.sdk" \ 
--target-os=darwin \ 
--cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" \ 
--extra-cflags="-arch armv7 -mfpu=neon -miphoneos-version-min=6.0" \ 
--extra-ldflags="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -miphoneos-version-min=6.0" \ 
--arch=arm --cpu=cortex-a9 --enable-pic 

^从http://www.tangentsoftworks.com/2012/11/12/how-to-prepare-your-mac-for-ios-development-with-ffmpeg-libraries/

当我无法得到它的工作,我决定不再懒惰和实际检查中列出的目录路径:任何以“/ Applications/...”开头的东西。 我发现我没有安装“iPhoneOS6.0.sdk”(它在路径中被引用)。

更改脚本来此工作:

./configure \ 
--prefix=armv7 \ 
--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 armv7 -mfpu=neon -miphoneos-version-min=6.0" \ 
--extra-ldflags="-arch armv7 -isysroot /applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -miphoneos-version-min=6.0" \ 
--arch=arm --cpu=cortex-a9 --enable-pic 

总之,只要仔细检查你的路。希望有所帮助!

+0

谢谢你的答案。现在我无法再次检查代码,因为代码不可用。但有一件事我想提到,我已经尝试过每个sdk文件,例如6.0,6.1和其他,我也尝试过多个系统。但我仍然无法做到。 – iDevAmit 2013-06-06 03:51:45

+0

让我知道如果/当你尝试上述,工作(至少对我来说),建立例程。希望你有成功。另外,您是否真的看过自己的路径,以便您可以看到计算机上实际存在哪些SDK? – u2Fan 2013-06-06 13:16:53