用于 android 的 ffmpeg(使用教程:“ffmpeg 和 Android.mk”)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2645041/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 06:45:29  来源:igfitidea点击:

ffmpeg for a android (using tutorial: "ffmpeg and Android.mk")

androidffmpegandroid-ndkcross-compilingandroid-ffmpeg

提问by Matthias

I am trying to compile ffmpeg for a android. I have found several posts on this theme but non of these seems to work. If tried to build ffmpeg like it is posted on [1]. Did anybody successfully compile ffmpeg using theses tutorial? I am not sure how to realize step 4 to 5.

我正在尝试为 android 编译 ffmpeg。我发现了几个关于这个主题的帖子,但这些帖子似乎都不起作用。如果尝试构建 ffmpeg,就像在 [1] 上发布的那样。有人使用这些教程成功编译了 ffmpeg 吗?我不确定如何实现步骤 4 到 5。

STEP4: Configuring ...

STEP5: cd to your NDK root dir, type make TARGET_ARCH=arm APP=ffmpeg-org

STEP4:配置...

STEP5:cd 到你的 NDK 根目录,输入 make TARGET_ARCH=arm APP=ffmpeg-org

It seems to me that building an application like it is explained in the tutorial in step 5 need some previous steps. Unfortunately I have no app in the folder to make. I am using the current android ndk release 3 and checked out the actual ffmpeg releases from [3] and [4]. I am thankful for every advice.

在我看来,构建第 5 步教程中所解释的应用程序需要一些先前的步骤。不幸的是,我在文件夹中没有要制作的应用程序。我正在使用当前的 android ndk 版本 3,并查看了 [3] 和 [4] 中的实际 ffmpeg 版本。我很感谢每一个建议。

[1] http://slworkthings.wordpress.com/
[2] http://gitorious.org/~olvaffe/ffmpeg/ffmpeg-android
[3] http://ffmpeg.org/download.html

[1] http://slworkthings.wordpress.com/
[2]http://gitorious.org/~olvaffe/ffmpeg/ffmpeg-android
[3]http://ffmpeg.org/download.html

回答by Guy

After looking around the net. The only working solution I found is supplied by Bambuser which ported ffmpeg to use in their android application.

在网上看了一圈之后。我找到的唯一可行的解​​决方案是由 Bambuser 提供的,它移植了 ffmpeg 以在他们的 android 应用程序中使用。

Code is here: http://bambuser.com/opensource

代码在这里:http: //bambuser.com/opensource

Basically you copy the .so files to your jni/lib directory, along with any .h files you might need, create a JNI wrapper through javah, and it works.

基本上,您将 .so 文件以及您可能需要的任何 .h 文件复制到 jni/lib 目录,通过 javah 创建一个 JNI 包装器,然后它就可以工作了。

EDIT:

编辑:

Since this post was written a few packaged ffmpeg projects for android surfaced, one of the easiest ones to compile and use is here: https://github.com/guardianproject/android-ffmpeg.

由于这篇文章是为 android 编写的几个打包的 ffmpeg 项目浮出水面,最容易编译和使用的项目之一是在这里:https: //github.com/guardianproject/android-ffmpeg

It takes the approach of statically compiling a binary (not a library) that is ran through shell command in run time. Search github for 'android ffmpeg' for forks and related projects.

它采用静态编译二进制文件(不是库)的方法,该二进制文件在运行时通过 shell 命令运行。在 github 中搜索“ android ffmpeg”以获取 fork 和相关项目。

Did not find a well packaged method based JNI implementation, though.

但是,没有找到基于 JNI 实现的封装良好的方法。

回答by monde_

I found a guide on ffmpeg on android here: http://rxwen.blogspot.com/2010/05/use-ffmpeg-to-setup-streaming-server-on.html

我在 android 上找到了关于 ffmpeg 的指南:http: //rxwen.blogspot.com/2010/05/use-ffmpeg-to-setup-streaming-server-on.html

He explains in another post how he got to do native programming on android to install ffmpeg. Hope it helps.

他在另一篇文章中解释了他如何在 android 上进行本地编程以安装 ffmpeg。希望能帮助到你。

回答by Sebastiano

I will provide a more updatedlist of sources which will explain how to build and, in some cases, even use FFMPEGon Android.

我将提供一个更新的源列表,其中将解释如何构建,在某些情况下,甚至FFMPEG在 Android 上使用。

This is the guide I liked the most: http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/

这是我最喜欢的指南:http: //www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/

If you need more options, you can take a look at these, which are equally good:

如果你需要更多的选择,你可以看看这些,它们同样好

回答by Griffin

In NDK r3, when you use the makecommand, the NDK will simply use the name of the folder in the "apps" folder for the name of your project. This assumes that you have your FFmpeg source files and android.mksomewhere within NDK/apps/ffmpeg-org/jni/

在 NDK r3 中,当您使用该make命令时,NDK 将简单地使用“apps”文件夹中的文件夹名称作为您的项目名称。这假设你有你的 FFmpeg 源文件和里面的android.mk某个地方NDK/apps/ffmpeg-org/jni/

In otherwords, ensure that your foldername is set to ffmpeg-org.

换句话说,确保您的文件夹名称设置为ffmpeg-org.

EDIT: You might find it worthwile to use NDK r4 which changes maketo ndk-build. In this new NDK, you don't need to have your project set up in any particular way, as ndk-buildsimply searches your project for Android.mkfiles to tell it what to compile.

编辑:您可能会发现使用 NDK r4 更改makendk-build. 在这个新的 NDK 中,您不需要以任何特定方式设置您的项目,ndk-build只需在您的项目中搜索Android.mk文件以告诉它要编译什么。