Android - 集成 ffmpeg 和 android-ndk-r9c

2024-02-15

我看过很多关于 FFmpeg 以及在 Android 中使用 FFmpeg 的帖子,但我发现这些帖子大多数都是针对旧版本的 FFmpeg 或 Android NDK。我能够得到结果https://github.com/mconf/android-ffmpeg https://github.com/mconf/android-ffmpeg,其中包括文件:“libavcodec.so”、“libavformat.so”、“libavutil.so”、“libswscale.so”。然而,仅仅将这些文件添加到我的项目中似乎不足以使用 FFmpeg。 (我跟着https://stackoverflow.com/a/21773572/1877798 https://stackoverflow.com/a/21773572/1877798作为参考指南)。可能是我在项目中配置这些文件时做错了,或者是我在为 Android 构建 FFmpeg 时做错了。 (是否应该有更多文件?)

我想知道最近是否有在 Android 项目中构建或集成 FFmpeg 的指南。我正在使用 FFmpeg(截至 2014 年 2 月 27 日)和 Android NDK 9c。 如果没有,有人对其他图书馆有其他建议吗?我正在尝试获取一组图像文件并以编程方式创建视频/动画 gif。

谢谢! :-)

~~编辑~~

我已经发现http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/comment-page-4/ http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/comment-page-4/以及在 GitHub 上找到的其他几个。然而,他们似乎都在构建 FFmpeg 方面遇到了困难。我使用的是 Mac OS X

这是我的脚本:

#!/bin/bash
NDK=/Downloads/android-ndk-r9c
SYSROOT=$NDK/platforms/android-18/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64
# Note: Change the TOOLCHAIN to match that available for your host system.
# darwin-x86_64 is for Mac OS X, but you knew that.
function build_one
{
./configure \
    --prefix=$PREFIX \
    --enable-shared \
    --disable-static \
    --disable-doc \
    --disable-programs \
    --disable-doc \
    --disable-symver \
    --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
    --target-os=linux \
    --arch=arm \
    --enable-cross-compile \
    --sysroot=$SYSROOT \
    --extra-cflags="-Os -fpic $ADDI_CFLAGS" \
    --extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU 
ADDI_CFLAGS="-marm"
build_one

这是日志:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-        dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
/Downloads/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-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 Git.  If the latest version fails, report the problem to the
[email protected] /cdn-cgi/l/email-protection mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.
Makefile:2: config.mak: No such file or directory
Makefile:48: /common.mak: No such file or directory
Makefile:91: /libavutil/Makefile: No such file or directory
Makefile:91: /library.mak: No such file or directory
Makefile:168: /doc/Makefile: No such file or directory
Makefile:169: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'.  Stop.
Makefile:2: config.mak: No such file or directory
Makefile:48: /common.mak: No such file or directory
Makefile:91: /libavutil/Makefile: No such file or directory
Makefile:91: /library.mak: No such file or directory
Makefile:168: /doc/Makefile: No such file or directory
Makefile:169: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'.  Stop.
Makefile:2: config.mak: No such file or directory
Makefile:48: /common.mak: No such file or directory
Makefile:91: /libavutil/Makefile: No such file or directory
Makefile:91: /library.mak: No such file or directory
Makefile:168: /doc/Makefile: No such file or directory
Makefile:169: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'.  Stop.

试试这个,这是我迄今为止用过的最好的一个:https://github.com/bbcallen/ijkplayer https://github.com/bbcallen/ijkplayer

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

Android - 集成 ffmpeg 和 android-ndk-r9c 的相关文章

随机推荐

  • Node.js - 服务器关闭了连接?

    我正在 Node js 服务器上运行一个 Web 应用程序 并且需要它始终在线 因此我将永远使用它 但这是我在一段时间后得到的结果 Error Connection lost The server closed the connection
  • 如何改变ios中源图像的脸部肤色?

    我的代码 如何管理不同肤色的RGB值 以及如何应用 这段代码将改变脸部和头发的颜色 但我想要 1 仅脸部着色 不包括头发 void changeSkinColorValue float value WithImage UIImage nee
  • Angular:将参数传递给另一个组件

    我被 Angular2 困住了 我想从 a 传递参数产品页面 例如 产品 ID 到支付页面 这是我迄今为止尝试过的 付款 html Message message
  • 覆盖对象时的 Perl 内存管理

    我的问题是关于 Perl 如何在内部管理对象的数据 当在 Perl 中创建对象时 新的子例程通常会返回对受祝福的对象的引用 以下面的代码为例 Create a new object my object Object gt new data1
  • 如何找到当前系统时区?

    在 Linux 上 我需要找到当前配置的时区作为 Olson 位置 我希望我的 C 或 C 代码能够移植到尽可能多的 Linux 系统 例如 我住在伦敦 所以我当前的奥尔森位置是 欧洲 伦敦 我是not对 BST EST 等时区 ID 感兴
  • SQL代码转换为C#数据类型问题

    我试图回答这个问题所以问题 https stackoverflow com questions 58726514 sp execution time is extremely slow 给出以下 SQL 代码 DECLARE input1
  • 如何将文本转换为 SVG 路径?

    我在 ttf 文件中有一个字体 想要生成 SVG 并将文本转换为路径 我不需要图像 因此使用 imagettftext 或 Image Magick 字体渲染功能是不够的 我需要可以放大和缩小的形状 我想丢失有关所用字体的信息 并且不想在中
  • Java 8 Stream:如何将当前元素与下一个元素进行比较?

    如何从a中获取下一个元素List使用 Java 8 流 如果我迭代List 我想将当前元素与列表的下一个元素进行比较 使用 Java 8 Stream 可行吗 My free StreamEx https github com amaemb
  • Spark中的分布式缓存相当于什么? [复制]

    这个问题在这里已经有答案了 在Hadoop中 您可以使用分布式缓存来复制每个节点上的只读文件 Spark 中的等效方法是什么 我了解广播变量 但这仅适用于变量 而不适用于文件 看一下 SparkContext addFile 在每个节点上添
  • 为什么子进程收到信号后不继续运行?

    以下是我的代码 父进程分叉一个子进程 子进程暂停 直到父进程向它发送信号 然后它继续运行 我的问题是为什么子进程不继续 追随父母向他发送信号 我错过或误解了什么吗 include
  • 为 iPhone 应用程序创建的本地数据库保存在哪里?

    我开发了一个加载完全静态内容的应用程序 我存储的数据大小超过 4 MB 如果没有此内容 应用程序将无法运行 在我的情况下 我应该在哪里保存本地数据库 文档文件夹或库文件夹 我的应用程序因 iCloud 存储备份而被拒绝 1 我应该在哪里保存
  • NoMethodError:Rails 中 nil:NilClass 未定义方法“类型”

    尝试加载使用 Rails 构建的网站上的某一页面时出现 NoMethodError 请参阅下面的完整堆栈跟踪 如果我改变false to true生产中 rb 在线 config cache classes false 然后问题就消失了 但
  • 凯尔·辛普森 (Kyle Simpson) 的 OLOO 模式与原型设计模式

    Kyle Simpson 的 OLOO 对象链接到其他对象 模式 与原型设计模式有什么不同吗 除了用专门表示 链接 原型的行为 的东西来创造它并澄清这里没有发生 复制 类的行为 之外 他的模式到底引入了什么 Here s 凯尔模式的示例 h
  • 为什么更改我的框的innerHTML 会使我的按钮在Greasemonkey 中停止工作?

    因此 我编写了一个脚本 在新选项卡中一次加载一个图像 感谢 Brock 让停止按钮可以工作HERE https stackoverflow com a 26418958 996364 然后我打破了它 添加了我在等待该问题的答案时写入的计数器
  • RESTful 身份验证作为一种状态形式

    Its 不可能的无需状态即可进行身份验证 那么 在设计带有身份验证的 RESTful 软件时 我们是否会为了安全性而牺牲这种架构呢 这能走多远 你可以存储任意数量的状态 只要它是为了构建更安全的系统吗 表示状态转移或 REST http e
  • Select2 - 如何插入粗体标题?

    我查看了 select2 的所有文档 但找不到如何插入这些粗体标题 有人可以提供一个完整的代码示例 需要 CSS 吗 来说明如何实现这一点 您可以通过使用来实现这一点optgroup tag
  • 仅在页面加载时处理 f:viewParam

    我正在使用一个
  • Mongoose / MongoDB - 使用预定义的模式附加到文档对象数组的简单示例

    为了简单起见 假设这些是我的集合模式 var MessageDeliverySchema new Schema from type String to type String status type String var Messages
  • 为什么 chrome 不运行这个 javascript

    当我在 Chrome 版本 2 中运行它时 它不会返回字符串 但它可以在 Firefox 版本 3 中运行 为什么是这样
  • Android - 集成 ffmpeg 和 android-ndk-r9c

    我看过很多关于 FFmpeg 以及在 Android 中使用 FFmpeg 的帖子 但我发现这些帖子大多数都是针对旧版本的 FFmpeg 或 Android NDK 我能够得到结果https github com mconf android