简体   繁体   English

如何在Android上使用GStreamer的硬件加速视频编码?

[英]How to use hardware accelerated video encoding of GStreamer on Android?

I am trying to design hardware accelerated video encoder based on Android. 我正在尝试设计基于Android的硬件加速视频编码器。 I have done research for some time but I did not find much useful. 我已经进行了一段时间的研究,但发现没有什么用。

Anyway, I saw the Gstreamer ( http://gstreamer.freedesktop.org/ ). 无论如何,我看到了Gstreamer( http://gstreamer.freedesktop.org/ )。 It is said this can provide hardware video encoder. 据说这可以提供硬件视频编码器。 However, after I read the manual, I found nothing about encoder. 但是,阅读本手册后,我对编码器一无所知。

Does anyone know about this stuff? 有人知道这个东西吗? Thank you! 谢谢!

It's going to be dependent on your hardware. 这将取决于您的硬件。 What device are you running on? 您在什么设备上运行?

If your processor contains an IP core that implements video encoding/decoding, the manufacturer needs to either offer a driver so you can call this hardware, or ideally go a step further and offer a specific plugin for GStreamer that does it. 如果您的处理器包含实现视频编码/解码的IP内核,则制造商需要提供驱动程序以便可以调用此硬件,或者理想情况下更进一步,并为执行此操作的GStreamer提供特定的插件。

For example, the Freescale i.MX6 processor (used in the Wandboard and CuBox ) has a driver maintained by Freescale: https://github.com/Freescale/gstreamer-imx 例如,飞思卡尔i.MX6处理器(在WandboardCuBox中使用 )具有飞思卡尔维护的驱动程序: https : //github.com/Freescale/gstreamer-imx

TI OMAP processors have support: http://processors.wiki.ti.com/index.php/GStreamer , also see TI Distributed Codec Engine . TI OMAP处理器支持: http : //processors.wiki.ti.com/index.php/GStreamer ,另请参阅TI 分布式编解码器引擎

Broadcom processors have support: https://packages.debian.org/wheezy/gstreamer0.10-crystalhd Broadcom处理器具有以下支持: https : //packages.debian.org/wheezy/gstreamer0.10-crystalhd

There are also several standard interfaces to video accelerator hardware, including VDPAU , VAAPI , and OpenMax IL . 还有一些视频加速器硬件的标准接口,包括VDPAUVAAPIOpenMax IL If your processor is not one of the above, someone may have written a driver that maps one of these standard interfaces to your hardware. 如果您的处理器不是上述处理器之一,则可能是有人编写了将这些标准接口之一映射到您的硬件的驱动程序。

The Rasberry Pi is apparently supported by the OpenMax IL plugin: http://gstreamer.freedesktop.org/releases/gst-omx/1.0.0.html Rasberry Pi显然受到OpenMax IL插件的支持: http ://gstreamer.freedesktop.org/releases/gst-omx/1.0.0.html

If you don't know whether your processor is supported, I'd search for the name and various combinations of "VDPAU", "VAAPI", etc. 如果您不知道您的处理器是否受支持,我将搜索名称和“ VDPAU”,“ VAAPI”等的各种组合。

There are a wide variety of encoding options in Gstreamer to take a raw stream and encode it. Gstreamer中有各种各样的编码选项可以获取原始流并对其进行编码。 Pretty much any element ending in "enc" can be used to do the encoding. 几乎所有以“ enc”结尾的元素都可以用来进行编码。 Here is a good example of a few encoding pipelines: 这是一些编码管道的好例子:

https://developer.ridgerun.com/wiki/index.php/TVP5146_GStreamer_example_pipelines https://developer.ridgerun.com/wiki/index.php/TVP5146_GStreamer_example_pipelines

With that said, I'd caution that video encoding is extremely hardware intensive. 话虽如此,但我要提醒您,视频编码非常耗费硬件。 I would also look at getting a special purpose hardware encoder and to not do software encoding via GStreamer if you're stream is a robust size. 我还将考虑获得一种专用的硬件编码器,并且如果您的数据流足够强大,则不要通过GStreamer进行软件编码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM