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

2024-04-25

WARNING:

我刚刚被另一位用户告知,在 iOS 上使用 FFMPEG 存在一些法律问题,请在此处留下链接http://multinc.com/2009/08/24/compatibility- Between-the-iphone-app-store-and-the-lgpl/ 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 构建它。我正在寻找的是确切的过程和一些解释。我知道这不是一个有据可查的问题。但我知道其他人也有和我一样的问题。

我已经能够做到的事情。

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

1)我已经能够克隆ffmpeg。对于初学者来说,这将帮助您通过创建包含 ffmpeg 源的目录来开始。 (向写这篇文章的人致敬)

git 克隆 git://source.ffmpeg.org/ffmpeg.git ffmpeg

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

。/配置 --禁用文档 --禁用 ffmpeg --禁用 ffplay --禁用 ffserver --启用交叉编译 --拱=臂 --target-os=达尔文 --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=皮质-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 -操作系统 -gdwarf-2 -isysroot /applications/xcode.app/contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -m${thumb_opt:-no-thumb} -mthumb-interwork'

这些是一些需要注意的事情。

  • 我必须下载(https://github.com/yuvi/gas-preprocessor 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”

问题就出在这里。

我可以像这样包含库

libavcodec/avcodec.h

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

忽略文件 /Users/Jimmy/Development/source.ffmpeg/Library/libavutil.a,该文件是为存档而构建的,该存档不是正在链接的体系结构(armv7s):/Users/Jimmy/Development/source.ffmpeg/Library/libavutil。 A

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

我正在寻找以前做过这件事的人,引导我们所有人完成为 iOS6.0 和 ARMv7 构建 FFMPEG 的过程以及需要注意的大部分事情。万分感谢。


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

注意:您必须拥有气体预处理器.pl https://github.com/yuvi/gas-preprocessor inside /usr/local/bin/请不要继续,直到您完成为止气体预处理器.pl https://github.com/yuvi/gas-preprocessor在你的 bin 目录下

  • 从以下位置下载 FFmpeg 1.0“天使”here https://ffmpeg.org/download.html

  • 解压它并将其放置在某个地方,即您的Desktop folder

  • 打开终端并浏览到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 (再等一下)

  • Go to /usr/local/lib找到你新鲜出炉的armv7 libs

  • Enjoy!

Alex


添加了对armv7s的支持

这个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 /海湾合作委员会 --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='-archarmv7s' --extra-ldflags='-archarmv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk' --enable-pic --enable-decoder=rawvideo --disable-asm

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

为 iOS6.0 ARMv7 处理器构建 FFMPEG 库 的相关文章

  • 从时间戳间隔获取缺失的月份

    我从服务器接收时间 以秒为单位 然后使用以下代码将 tjose 秒转换为月份 NSDateFormatter dateFormatter NSDateFormatter alloc init autorelease dateFormatte
  • 以编程方式创建 UILabel

    我通过代码执行了以下操作 UILabel label UILabel alloc initWithFrame CGRectMake 40 70 300 50 label backgroundColor UIColor clearColor
  • 无法向引导服务器注册 com.XXXXX.deviceapp

    我在设备中运行时遇到此错误 请确实需要全面的帮助来解决此问题 无法向引导服务器注册 com XXXXX deviceapp 错误 未知错误代码 这通常意味着该进程的另一个实例已经在运行或挂在调试器中 程序收到信号 SIGABRT 我就遇到过
  • gcc总是做这种优化吗? (公共子表达式消除)

    作为示例 假设表达式sys gt pot atoms item gt P kind mass在循环内求值 循环只改变item 因此表达式可以简化为atoms item gt P kind mass通过将变量定义为atoms sys gt p
  • Xcode -- 让force_load 使用相对路径

    某些库在链接到 Xcode 项目时需要 all load 链接器标志 但是 如果库之间存在符号冲突 这会导致链接器错误 解决方案是使用 force load 它可以有效地让您在某些库上使用 all load 但不能在其他库上使用 然而 这反
  • 计算指向 CLLocation 的罗盘航向 - 适用于 iOS 的半正弦函数

    我了解如何获取 2 个 CLLocation 之间的距离 我需要确定从 CLLocation 到另一个 CLLocation 的广义罗盘方位 N NE E 等 在我实现使用半正矢公式推导方位之前 是否有一个通用的开源库或代码片段 您发现可以
  • 如何在iphone中画同心圆?

    我想画一个戒指 环应填充在外圆中 我参考了一个文档http developer apple com library mac documentation GraphicsImaging Conceptual drawingwithquartz
  • 将左按钮添加到 UINavigationBar (iPhone)

    我创建了一个新的基于导航的 iPhone 应用程序 我将其添加到 RootViewController 中 void viewDidLoad super viewDidLoad UIBarButtonItem addButton UIBar
  • CALayer 的 display/drawRect 方法中到底应该发生什么?

    如果有的话 这些方法中哪一个适合 更改 CATextLayer 的文本 将不同的图像加载到 CAImageLayer 中 告诉子层自我更新 老兄 我可能喝醉了 但是没有drawRect方法CAlayers 我想你可以使用drawInCont
  • UITableViewCell - 理解“可重用”

    UITableViewCell tableView UITableView tableView cellForRowAtIndexPath NSIndexPath indexPath static NSString reuseIdentif
  • 如何将NSDate转换为unix时间戳iphone sdk?

    如何转换NSDate转换为 Unix 时间戳 我读过很多相反的帖子 但我没有找到与我的问题相关的任何内容 我相信这是您正在寻找的 NSDate 选择器 NSTimeInterval timeIntervalSince1970
  • 如何解决 iPhone 应用程序中的无效转换说明符警告

    我有 iphone 应用程序 其中为标签分配值 但是当我构建它时 它显示以下警告无效转换说明符 这是标签赋值的代码 label1 text NSString stringWithFormat d newvalue1 The 被解释为格式字符
  • iphone XMPP 应用程序运行后台

    我使用 XMPP 框架创建了一个聊天应用程序 当我退出应用程序 进入后台模式 时 我想接收聊天消息 并且还需要显示图标徽章 我该怎么做 您确实可以通过将基于 XMPP 框架的应用程序称为 VoIP 应用程序来在 iOS4 中的后台运行该应用
  • 即使只有单个项目,也强制 uiscrollview 弹跳滚动

    我有一个 UIScrollView 其中包含不同数量的项目 子视图 当有多个项目时 滚动弹跳起作用 然而 有时滚动视图应该只有一项 我想向用户提供他们的滚动被识别的反馈 从而产生反弹效果 但是 UIScrollView 仅禁用一项滚动 答案
  • iPhone:AVAudioPlayer 不支持的文件类型

    我的应用程序从我们的服务器下载 mp3 并将其播放给用户 该文件为 64 kbps 如果我理解正确的话 这完全在 iPhone 的可接受范围内 我在几十个网站上查找了如何执行此操作 他们都建议我这样做 NSData data NSData
  • iPhone 4 移动网络应用程序像素缩放问题

    我无法让我的移动 Web 应用程序在 iPhone 4 上正确呈现 根据 Wikipedia iPhone 4 的像素为 960 宽 x 680 高度 而其他 iPhone 的像素为 480 宽 x 340 像素 在我当前的构建中 图像和
  • 软件预取手动指令合理的场景

    我读过有关 x86 和 x86 64 Intel 的内容gcc提供特殊的预取指令 include
  • Apple 应用程序加载器 - 如何更改正在使用的 Apple ID?

    我想切换 Apple App Loader 使用的 Apple ID 我找不到更改应用程序本身使用的帐户的方法 谷歌搜索没有带来任何有用的信息 当我启动加载程序应用程序时 它给我一个错误 您的 Apple ID 或密码输入不正确 20101
  • 开发iPhone游戏需要什么? [关闭]

    就目前情况而言 这个问题不太适合我们的问答形式 我们希望答案得到事实 参考资料或专业知识的支持 但这个问题可能会引发辩论 争论 民意调查或扩展讨论 如果您觉得这个问题可以改进并可能重新开放 访问帮助中心 help reopen questi
  • 用更有意义的文本替换 GCC 输出中的 a-hats [重复]

    这个问题在这里已经有答案了 可能的重复 为什么 gcc 的所有错误消息中都有 https stackoverflow com questions 547071 why does gcc have a in all its error mes

随机推荐