![](/img/trans.png)
[英]Building iPhone static library for armv6 and armv7 that includes another static library
[英]Building FFMPEG library for iOS6.0 ARMv7 Processor
警告:
我刚刚被其他用户告知,有一些法律问题围绕着使用FFMPEG for iOS,请点击这里链接http://multinc.com/2009/08/24/compatibility-between-the-iphone-app-store-和最LGPL /
当我第一次感到慌乱的时候,我写了一下这个问题。 现在我可以在休息一下后更清楚。
编辑:了解到你必须为ARMv7,ARMv7s和iOS6.0构建
我正在尝试在XCode 4.5.1项目中使用FFMPEG库。 我正在尝试为ARMv7构建它。 我正在寻找的是确切的过程和一些解释。 我知道这不是一个记录良好的问题。 但我知道其他人和我有同样的问题。
我能做什么。
我已经能够构建用于测试的库。
1)我已经能够克隆ffmpeg。 对于初学者,这将通过使用ffmpeg源创建目录来开始。 (感谢写这篇文章的人)
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
2)我已经能够编写一个没有任何错误的配置文件。 我们稍后会回到这一部分。 这是我附加到./configure的命令
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch = arm --target-os = darwin --cc = / Applications / Xcode 。应用程序/内容/开发/平台/ iPhoneOS.platform /开发人员的/ usr / LLVM-GCC-4.2 /斌/ ARM-苹果darwin10-LLVM-GCC-4.2
--as ='gas-preprocessor / gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/arm-apple-darwin10-llvm -GCC-4.2'
--sysroot = /应用/ xcode.app /内容/开发商/平台/ iPhoneOS.platform /开发商/软件开发工具包/ iPhoneOS6.0.sdk
--cpu = cortex-a8 --extra-ldflags =' - arch = armv7 -isysroot /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk'--enable -pic --disable-bzlib --disable-gpl --disable-shared --enable-static --disable-mmx --disable-debug --disable-neon --extra-cflags =' - pipe -Os -gdwarf -2 -isysroot /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -m $ {thumb_opt:-no-thumb} -mthumb-interwork'
这些是需要注意的事项。
这就是问题所在。
我可以像这样包含库
使用libavcodec /中avcodec.h
但是当我开始编写编码器时。 我收到了这个警告,还有无数的错误。
忽略文件/Users/Jimmy/Development/source.ffmpeg/Library/libavutil.a,文件是为存档而构建的,而不是被链接的架构(armv7s):/ Users / Jimmy / Development / sources.ffmpeg / Library / libavutil。一种
这意味着我没有构建正确的二进制文件。
我正在寻找的是之前完成它的人,让我们所有人都在构建针对iOS6.0和ARMv7的FFMPEG以及大多数需要注意的事项。 万分感谢。
这是我的工作配置在iOS 6上交叉编译FFmpeg
,拱门是ARMv7
注意:您必须要有gas-preprocessor.pl里面/usr/local/bin/
请不要继续,直到你有gas-preprocessor.pl你的bin目录
从这里下载FFmpeg 1.0“天使”
解压缩并将其放在某处,即Desktop
文件夹
打开终端并浏览到解unzipped FFmpeg folder
复制并粘贴以下命令,( 耐心等待一段时间 )
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch = arm --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 = / Applications / Xcode.app / Contents / Developer / Platforms / iPhoneOS.platform / Developer / SDKs / iPhoneOS6.0.sdk --cpu = cortex-a8 --extra- cflags =' - arch armv7'-extra-ldflags =' - arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk'-enable- pic --enable-decoder = rawvideo --disable-asm
现在在终端make
上键入以下命令( 稍等一会儿 )
一旦完成,现在键入终端sudo make install
( 再次等待 )
转到/usr/local/lib
找到新近出炉的armv7
库
请享用!
亚历克斯
这个armv7s配置是完全未经测试的,我真的不知道这是否可行,我没有iPhone 5所以我们需要有人来测试最终的armv7s库
./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch = arm --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 = / Applications / Xcode.app / Contents / Developer / Platforms / iPhoneOS.platform / Developer / SDKs / iPhoneOS6.0.sdk --cpu = cortex-a8 --extra- cflags =' - arch armv7s' - extra-ldflags =' - arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk'-enable- pic --enable-decoder = rawvideo --disable-asm
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.