开发H264硬件去codeR Android的 - Stagefright或OpenMax的IL? [英] Developing H264 hardware decoder Android - Stagefright or OpenMax IL?

查看:736
本文介绍了开发H264硬件去codeR Android的 - Stagefright或OpenMax的IL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发H264 H / W加速的视频去$ C $为Android铬。到目前为止,我已经过来和一些库媒体codeC Stagefright 的OpenMax IL OpenMax的AL 的FFmpeg 。有些研究后,我发现 -

I am developing H264 H/W accelerated video decoder for android. So far, I've come around with some libraries MediaCodec, Stagefright, OpenMax IL, OpenMax AL and FFmpeg. After a bit research, I've found that -


  1. 我发现的使用stagefright用的FFmpeg的巨大资源,但作为其许可证,它是分布式软件相当严格的,我不能使用FFmpeg的。 (或者可能从这种方法丢弃FFmpeg的?)

  1. I found a great resource of using stagefright with FFmpeg, but I can not use FFmpeg as for its license, it is quite restrictive for distributed software. (Or possible to discard FFmpeg from this approach?)

我无法使用媒体codeC作为一个Java API,我必须通过JNI从相对较慢,我不允许C ++层调用它。

I can not use MediaCodec as its a Java API and I have to call it via the JNI from C++ layer which is relatively slow and I am not allowed.

我不能使用的OpenMax AL因为它仅通过缓冲队列支持MPEG-2传输流的解码。这排除了通过原料H264的NALU或其他媒体格式,对这一问题。

I can not use OpenMax AL as it only supports the decoding of MPEG-2 transport stream via a buffer queue. This rules out passing raw h264 NALUs or other media formats for that matter.

现在唯一剩下的是 - stagefright和OpenMax的IL。我才知道,stagefright使用OpenMax的(OMX)接口。所以,我应该挂stagefright或OpenMax的IL去?这将是更有前途?

Now only left are - stagefright and OpenMax IL. I came to know that stagefright uses OpenMax(OMX) interface. So should I go with stagefright or OpenMax IL? Which will be more promising?

另外,我才知道,Android的H / W加速去codeR是供应商特定的,每个厂商都有自己的OMX接口的API。是真的吗?如果是这样,我需要写H / W供应商的具体实现柜面的OpenMax IL的?什么stagefright? - 它是独立于硬件或依赖硬件?如果没有H / W indenpent实现使用stagefright或OpenMax的IL的方式,我需要至少支持高通的Snapdragon,三星的Exynos和的Tegra-4。

Also, I came to know that Android H/W accelerated decoder is vendor specific and every vendors has their own OMX interfacing APIs. Is it true? If so, do I need to write H/W vendor specific implementation incase of OpenMax IL? What about stagefright? - Is it hardware agnostic or hardware dependent? If there is no way of H/W indenpent implementation using stagefright or OpenMax IL, I need to support at least Qualcomm's Snapdragon, Samsung's Exynos and Tegra-4.

请注意,我需要取消code H264附件B流,并预计会在德code德codeD数据,我将送我的视频渲染管线。所以基本上,我只需要去codeR模块。

Note that, I need to decode H264 Annex B stream and expect decoded data after decode which I will send to my video rendering pipeline. So basically, I only need the decoder module.

我真的困惑了很多。请帮我在正确的方向推杆。在此先感谢!

I am really confused a lot. Please help me putting in right direction. Thanks in advance!

修改

我的软件是为商业目的和源$ C ​​$ c是私人为好。而我也通过限制客户端使用的ffmpeg。 :)

My software is for commercial purpose and the source code is private as well. And I am also restricted to use ffmpeg by client. :)

推荐答案

您真的应该去为媒体codeC。通过调用JNI Java方法确实有一些开销,但你应该记住的开销是什么量级。如果希望调用每个像素的函数,JNI调用的开销可能是有问题的。但对于使用Media codeC,你只能做每帧几个函数调用,塔顶有微不足道的。

You really should go for MediaCodec. Calling java methods via JNI does have some overhead, but you should keep in mind what order of magnitude the overhead is. If you'd call a function per pixel, the overhead of JNI calls might be problematic. But for using MediaCodec, you only do a few function calls per frame, and the overhead there is negligible.

请参阅例如<一href=\"http://git.videolan.org/?p=vlc.git;a=blob;f=modules/$c$cc/omxil/media$c$cc_jni.c;h=57df9889c97706436823a4960206e323565e221c;hb=b31df501269b56c65327be181cdca3df48946fb1\" rel=\"nofollow\">http://git.videolan.org/?p=vlc.git;a=blob;f=modules/$c$cc/omxil/media$c$cc_jni.c;h=57df9889c97706436823a4960206e323565e221c;hb=b31df501269b56c65327be181cdca3df48946fb1作为使用Media codeC使用JNI C code时的例子。正如其他人也走了这样,我可以向你保证,JNI开销不是一个理由考虑其他API比媒体codeC。

See e.g. http://git.videolan.org/?p=vlc.git;a=blob;f=modules/codec/omxil/mediacodec_jni.c;h=57df9889c97706436823a4960206e323565e221c;hb=b31df501269b56c65327be181cdca3df48946fb1 as an example on using MediaCodec from C code using JNI. As others also have gone this way, I can assure you that the JNI overhead is not a reason to consider other APIs than MediaCodec.

使用stagefright或直接OMX是有问题的; ABI的各个平台版本之间是不同的(所以你可以只针对一个版本,编译或多次针对不同的版本,在一个封装中封装这一切),而你不得不处理很多设备特定的怪癖,而媒体codeC应该(和现代版本一样)工作相同在所有设备上。

Using stagefright or OMX directly is problematic; the ABI differs between each platform version (so you can either only target one version, or compile multiple times targeting different versions, packaging it all up in one package), and you'd have to deal with a lot of device specific quirks, while MediaCodec should (and on modern versions does) work the same across all devices.

这篇关于开发H264硬件去codeR Android的 - Stagefright或OpenMax的IL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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