<div dir="ltr"><div><div><div><div>Hi Sebastian.<br><br></div>Looking into the to the problem of converting and/or resize I420 or NV12 output from the omxh264dec (and others), there seem to be ways to both convert to other raw formats as well as perhaps resize the output all using the GPU.<br><br></div>The OpenMAX Il-component <b>video_splitter </b>(input port 250, output ports 251-254 - only one is needed) can take input as I420 and output as OMX_COLOR_Format32bitARGB8888 or OMX_COLOR_Format32bitBGRA8888 (one of which I believe is called a byte stream of R, G, B and A bytes (RGBA)) and possibly OMX_COLOR_Format24bitRGB888 or OMX_COLOR_Format24bitBGR888 (one of which is believed to be RGB). I'm not sure it can do both RGB(A) and BGR(A).<br><br></div>Anyway, it should be possible to connect the encoder's port 131 to the video_splitter's port 250, set the splitter port 250 format to I420, perhaps provide buffers for this, set the splitter port 251 to RGBA or RGB and feed it data buffers from downstream (perhaps shm) for zero-copying. An of course the video_splitter component has to be started and prepared for state chage etc.<br><br></div><div>For video resizing (and conversion) the OpenMAX image component <b>resize</b> can take I420 input on port 60 AND scale AND convert to image formats such as RGBA and RGB (I am 95% sure) and output these to output port 61 on data buffers from downstreams (perhaps shm).<br><br></div><div>All this of course applies to the other omxXXXdec modules.<br></div><div><br></div><div>The same should be possible for the input for omxh264enc and the other encoders in a way so the encoders can take I420/RGB/RGBA at any size and the decoders can output I420/RGB/RGBA at any size.<br><br></div><div>The "any size" may be to take it to far. There are some restrictions for either the encoder and the decoder. For one of them, the width and height must both be even numbers and for the other, both must be a multipla of 16. I just don't know if you can link OpenMAX video modules to OpenMAX image modules. At least some timing may be set and controlled out-of-band when going over an image module .... perhaps.<br><br></div><div>I tried looking to the GStreamer code, but I can't really see where to add the functionality and I am still struggling with the very poorly documented OpenMAX examples and docs.<br><br></div><div>I hope this is worth looking at. Especailly converting from I420 to RGBA for is nearly impossible on the Pi-platform for 720p and quite impossible for 1080p with the current gstreamer version, conversion alone take a lot of CPU not really present.<br><br></div><div>Does it help to open a ticket for an improvement?<br><br></div><div>Best regards<br></div><div>Peter Maersk-Moller<br></div><div><div><br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 23, 2016 at 3:18 PM, Sebastian Dröge <span dir="ltr"><<a href="mailto:sebastian@centricular.com" target="_blank">sebastian@centricular.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Di, 2016-02-23 at 13:43 +0100, Peter Maersk-Moller wrote:<br>
> <br>
> > I420 is already supported, no?<br>
> My mistake. So far it seems I420 is the only one that works.<br>
> Testing the following pipeline:<br>
><br>
> gst-launch-1.0 -v videotestsrc is-live=1 ! 'video/x-<br>
> raw,format='$format ! omxh264enc ! fakesink<br>
><br>
> with these formats :I420 YV12 YUY2 UYVY AYUV RGBx BGRx xRGB xBGR RGBA<br>
> BGRA ARGB ABGR RGB BGR Y41B Y42B YVYU Y444 v210 v216 NV12 NV21 NV16<br>
> NV61 NV24 GRAY8 GRAY16_BE GRAY16_LE v308 RGB16 BGR16 RGB15 BGR15 UYVP<br>
> A420 RGB8P YUV9 YVU9 IYU1 ARGB64 AYUV64 r210 I420_10LE I420_10BE<br>
> I422_10LE I422_10BE Y444_10LE Y444_10BE GBR GBR_10LE GBR_10BE<br>
> NV12_64Z32 A420_10LE A420_10BE A422_10LE A422_10BE A444_10LE<br>
> A444_10BE<br>
><br>
> Then only format that works is I420.<br>
><br>
> Shouldn't 'gst-inspect-1.0 omxh264enc' report that the only format it<br>
> takes is I420?<br>
<br>
</span>As said in the previous mail, it support I420 *and* NV12 currently.<br>
It's just that on the RPi the encoder only supports I420 and nothing<br>
else.<br>
<br>
So what it should do is to report I420 and NV12 in general, and in the<br>
RPi specific gstomx.conf you would override the pad template to only<br>
list I420.<br>
<span class=""><br>
> > For the other formats, adding support for them would definitely be<br>
> > a<br>
> > good idea. Can you file a bug for this, ideally with a patch?<br>
> I can. Is the above description enough for the bug report?<br>
><br>
> For the patch, can you point to the code where you detect hardware<br>
> capabilities before reporting it for the sink pad of omxh264enc ?<br>
> Is the code in omxh264enc prepared for reporting multiple sink<br>
> capabilities, or just one. Not sure I know how to extend the code to<br>
> report multiple capabilities. When done, I can try to look into how<br>
> to make the hardware encoder accept other formats than I420 as it<br>
> should be able to. Maybe it needs some of these *broadcom tunnels*<br>
> for conversion that some of the encoding examples for BCM2835/2836<br>
> shows.<br>
<br>
</span>There is no hardware capability probing API for this (or it's not<br>
implemented anywhere in a meaningful way). The code I showed you is<br>
where the format specific handling is, the other changes would be for<br>
the pad templates which would just be hardcoded... in code with a<br>
default and in the gstomx.conf for the RPi.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Sebastian Dröge, Centricular Ltd · <a href="http://www.centricular.com" rel="noreferrer" target="_blank">http://www.centricular.com</a><br>
<br>
</div></div><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br></div>