FFMPEG在Android [英] FFMPEG on Android

查看:175
本文介绍了FFMPEG在Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有FFMPEG编译(libffmpeg.so)在Android上。现在我要球泡要么喜欢RockPlayer的应用程序或使用现有的Andr​​oid MM框架调用FFMPEG。

I have got FFMPEG compiled (libffmpeg.so) on Android. Now I have to buld either an application like RockPlayer or use existing android MM framework to invoke FFMPEG.

  1. 你有没有关于在Android / StageFright整合FFmpeg的步骤/方法/ code /例子吗?

  1. Do you have steps / procedures / code / example on integrating FFMPEG on Android / StageFright?

您可以请指导我怎么可以使用这个库为MM播放?

Can you please guide me on how can I use this library for MM playback?

我有一个要求,我已经音频和视频TS,我需要养活到FFMPEG,并得到它去codeD /渲染。我怎样才能做到这一点在Android上,因为IOMX API是基于OMX,不能外挂FFMPEG这里。

I have a requirement where I have already Audio and Video TS, which I need to feed to FFMPEG and get it decoded / rendered. How can I do this on Android, since IOMX apis are OMX based and cannot plug-in FFMPEG here.

另外,我无法找到FFmpeg的原料药,需要加以用于播放文件。

Also I could not find documentation on the FFMPEG apis which need to be used for playback.

能否请你帮我这些问题,让我开始吗?你的帮助是极大的AP preciated。

Can you please help me with these questions and get me started on this? Your help is greatly appreciated.

推荐答案

下面是我得到的ffmpeg所经历的步骤来对Android的:

Here are the steps I went through in getting ffmpeg to work on Android:

  1. 在建的ffmpeg的静态库为Android。这是通过使用的 libffmpeg )达到= http://source.android.com/porting/build_system.html">Android构建系统。只要把源代码在/外部和离开。你需要提取仿生(libc中),并从Android构建的zlib(libz进行),以及作为的ffmpeg库依赖于它们。
  2. 创建一个使用Android的一个动态库,包装的ffmpeg功能 NDK 。有很多资料在那里有关如何使用NDK的工作。基本上,你需要写一些C / C ++ code出口,你需要出来的ffmpeg到库中的Java可以通过JNI交互的功能。 NDK的,您可以轻松地对你在步骤1中所产生的静电库链接,只是一个类似的行添加到Android.mk: LOCAL_STATIC_LIBRARIES:= libav codeC了li​​bavformat libavutil的libc libz进行

  1. Build static libraries of ffmpeg for Android. This was achieved by building olvaffe's ffmpeg android port (libffmpeg) using the Android Build System. Simply place the sources under /external and make away. You'll need to extract bionic(libc) and zlib(libz) from the Android build as well, as ffmpeg libraries depend on them.
  2. Create a dynamic library wrapping ffmpeg functionality using the Android NDK. There's a lot of documentation out there on how to work with the NDK. Basically you'll need to write some C/C++ code to export the functionality you need out of ffmpeg into a library java can interact with through JNI. The NDK allows you to easily link against the static libraries you've generated in step 1, just add a line similar to this to Android.mk: LOCAL_STATIC_LIBRARIES := libavcodec libavformat libavutil libc libz

从Java源代码使用的ffmpeg-包裹动态库。有足够的资料对JNI在那里,你应该就可以了。

Use the ffmpeg-wrapping dynamic library from your java sources. There's enough documentation on JNI out there, you should be fine.

使用ffmpeg的播放情况看,有许多例子(FFmpeg的二进制文件本身就是一个很好的例子),这里 SA基础教程。最好的文档可以在报头中找到。

Regarding using ffmpeg for playback, there are many examples (the ffmpeg binary itself is a good example), here's a basic tutorial. The best documentation can be found in the headers.

祝你好运:)

这篇关于FFMPEG在Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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