构建iOS6.0 ARMv7处理器的FFMPEG库 [英] Building FFMPEG library for iOS6.0 ARMv7 Processor

查看:172
本文介绍了构建iOS6.0 ARMv7处理器的FFMPEG库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

警告:

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

I was just informed by another user that there are some legal issues revolving around using FFMPEG for iOS, leaving the link here http://multinc.com/2009/08/24/compatibility-between-the-iphone-app-store-and-the-lgpl/

我清理了有一点问题,当我第一次写信的时候我很慌张。现在我可以在休息一会儿后更清楚。

I cleaned up my question a little bit, when I wrote it the first time I was flustered. Now I can be more clear after taking a small break.


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

learned that you have to build for ARMv7, ARMv7s and iOS6.0

我试图在XCode 4.5.1项目中使用FFMPEG库。我正在为ARMv7构建它。我正在寻找的是确切的过程和一些解释。我明白这不是一个很好的记录问题。但是我知道其他pople与我一样的问题。

I'm trying to use the FFMPEG library in an XCode 4.5.1 project. And I'm trying to build it for ARMv7. What I'm looking for is the exact process, and some explanation. I understand that this is not a well documented problem. But I know that other pople have had the same problem as me.

我能够做的。

我已经能够构建库进行测试。

I have been able to build the library for testing.

1)我已经能够克隆ffmpeg。对于初学者,这将通过使用ffmpeg源创建一个目录来开始。 (对于写这篇文章的人来说,这样做)

1) I have been able to clone ffmpeg. For beginners this will get you started by creating a directory with the ffmpeg source. (Kudos to the guys who wrote it)


git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg

git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg

2)我已经能够编写一个没有任何错误的配置文件。我们稍后再回到这一部分。这是我附加的命令./configure

2) I have been able to write a config file that doesn't have any errors. We will go back to this part later. This is the command I attach to ./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

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

--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 /平台/ iPhoneOS.platform / Developer / SDKs / iPhoneOS6.0.sdk

--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 --D isable-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'

--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'

这些是需要注意的事情。

These are some things to note.


  • 我不得不下载( https://github.com/yuvi/gas-preprocessor )将文件gas-preprocessor.pl复制到/ usr / local /完事。设置读取写入权限(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/开发者/平台/ iPhoneOS.platform / Developer / SDKs / iPhoneOS6.0.sdk

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

  • I had to download ( https://github.com/yuvi/gas-preprocessor ) copy the file gas-preprocessor.pl at /usr/local/bin. Set permissions to read write (777)
  • Make sure I'm using the right GCC compiler: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/arm-apple-darwin10-llvm-gcc-4.2
  • Make sure I'm using the right SDK: /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk
  • --extra-cflags="-arch armv7" causes: error: unrecognized command line option "-arch"

这里是问题。

我可以包括这样的图书馆

I can include the library like so


libavcodec / avcodec.h

libavcodec/avcodec.h

但是当我开始编写编码器时。我收到这个警告和无数错误。

But when I started to write the encoder. I received this warning, and countless errors.


忽略文件/Users/Jimmy/Development/source.ffmpeg/Library/libavutil.a,文件是为存档而构建的,而不是架构被链接(armv7s):/Users/Jimmy/Development/source.ffmpeg/Library/libavutil.a

ignoring file /Users/Jimmy/Development/source.ffmpeg/Library/libavutil.a, file was built for archive which is not the architecture being linked (armv7s): /Users/Jimmy/Development/source.ffmpeg/Library/libavutil.a

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

That means that I didn't build the right binary.

我正在寻找的是以前做过的人,我们所有人通过为iOS6.0和ARMv7构建FFMPEG和大多数事情来寻找。感谢一下。

推荐答案

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

Here is my working Configure for cross-compiling FFmpeg on iOS 6 the arch is ARMv7

注意:您必须具有气体预处理器。在 / usr / local / bin / 中,请不要继续,直到你有 gas-preprocessor.pl

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


  • 此处下载FFmpeg 1.0Angel

  • Download FFmpeg 1.0 "Angel" from here

解压缩并将其放在某个地方,即您的桌面文件夹

Unzip it and place it somewhere i.e. your Desktop folder

打开终端并浏览到解压缩的FFmpeg文件夹

复制并粘贴以下命令,(请耐心等待一段时间

Copy and paste the following command, (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 =应用程序/ Xcode.app /内容/开发/平台/ iPhoneOS.platform /开发人员/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

./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 再次等待

    Once it has finished now type on terminal sudo make install (wait again)

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

    Go to /usr/local/lib to find your freshly baked armv7 libs

    享受!

    Alex

    这个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 /应用程序/ 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

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

    这篇关于构建iOS6.0 ARMv7处理器的FFMPEG库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆