首页 文章

为iOS6.0 ARMv7处理器构建FFMPEG库

提问于
浏览
13

WARNING:

我刚刚被其他用户告知,有一些法律问题围绕着使用FFMPEG for iOS,留下链接http://multinc.com/2009/08/24/compatibility-between-the-iphone-app-store-and-the-lgpl/

当我第一次感到慌乱的时候,我写了一下这个问题 . 现在我休息一下后可以更清楚了 .

编辑:了解到你必须为ARMv7,ARMv7s和iOS6.0构建

我正在尝试在XCode 4.5.1项目中使用FFMPEG库 . 我正在尝试为ARMv7构建它 . 我正在寻找的是确切的过程和一些解释 . 我知道这不是一个记录良好的问题 . 但我知道其他人也和我有同样的问题 .

What I have been able to do.

我已经能够构建用于测试的库 .

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.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/arm-apple-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 = / applications / xcode .app / contents / Developer / Platforms / iPhoneOS.platform / Developer / SDKs / 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_选择:-no-thumb} -mthumb-interwork'

这些是需要注意的事项 .

  • 我必须下载(https://github.com/yuvi/gas-preprocessor)将文件gas-preprocessor.pl复制到/ usr / local / bin . 设置读写权限(777)

  • 确保我使用正确的GCC编译器:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/arm-apple-darwin10-llvm-gcc -4.2

  • 确保我使用的是正确的SDK:/applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk

  • --extra-cflags = "-arch armv7"原因:错误:无法识别的命令行选项“-arch”

Here in lies the problem.

我可以像这样包含库

libavcodec / avcodec.h

但是当我开始编写编码器时 . 我收到了这个警告,还有无数的错误 .

忽略文件/Users/Jimmy/Development/source.ffmpeg/Library/libavutil.a,文件是为归档而构建的,而不是被链接的体系结构(armv7s):/ Users / Jimmy / Development / sources.ffmpeg / Library / libavutil . 一个

这意味着我没有构建正确的二进制文件 .

What I'm looking for is someone whose done it before, to walk all of us through the process of building FFMPEG for iOS6.0 and ARMv7 and the majority of things to look out for. 非常感谢 .

1 回答

  • 12

    这是我的工作配置在iOS 6上交叉编译 FFmpeg 这个拱是 ARMv7

    NOTE: You must have to have gas-preprocessor.pl inside /usr/local/bin/ please do not continue until you have gas-preprocessor.pl on your bin directory

    • here下载FFmpeg 1.0 "Angel"

    • 解压缩并将其放在某处,即 Desktop 文件夹

    • 打开终端并浏览到 unzipped FFmpeg folder

    • 复制并粘贴以下命令,( be patient will take a while

    ./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

    • 现在在终端 makewait a little more )上键入以下命令

    • 一旦完成,现在键入终端 sudo make installwait again

    • 转到 /usr/local/lib 找到新鲜出炉的 armv7

    • 享受!

    亚历克斯


    添加了对armv7的支持

    This armv7s configure is totally untested and i dont really know if this would work, i don't own an iPhone 5 so we need someone to test the final armv7s libs

    ./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 . 平台/开发人员的/ usr / bin中/海湾合作委员会”--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

相关问题