Efficient scaling and/or conversion from YUV420 (NV12) to RGBA

Nicolas Dufresne nicolas at ndufresne.ca
Thu Aug 2 12:25:13 UTC 2018


Le jeudi 02 août 2018 à 11:31 +0200, Iñigo Huguet a écrit :
> Hi.
> I'm using a pipeline to display live video from cameras to a QT
> application. Cameras' driver produces NV12 video, and for QT I'm
> using qmlglsink.
> Element qmlglsink seems to only accept RGBA, so I have to make the
> conversion. I'm doing it with this pipeline: v4l2src
> device="/dev/video1" ! video/x-
> raw,format=NV12,width=1440,height=1152,framerate=5/1 ! glupload !
> glcolorconvert ! qmlglsink sync=false
> However, I'm getting very poor performance, around 1fps or less, and
> glcolorconvert seems to be the bottleneck. With this pipeline I get
> 25 fps with no problem: v4l2src device="/dev/video1" ! video/x-
> raw,format=NV12,width=1440,height=1152,framerate=25/1 ! glupload !
> fakesink silent=false
> With 720x576 video I'm getting a better performance (obvious), but I
> need to use also 1440x1152 because this is video from the 4 cameras
> at the same time.
> Possible solutions that might be acceptable for me:
> More efficient way of converting from NV12 to RGBA
> Efficient way of scale down to 720x576, or even less, before color
> conversion
> Two previous options at the same time
> Other solutions you might suggest
> I'm running this on an ARM processor (Allwinner A20) with GPU and
> OpenGLES. This processor also have a Video Processing Unit that works
> with VDPAU.

VAAPI support is being worked own for this processor, through the new
Cedar kernel drivers. My guess for the performance, your Mali blob does
not support DMABuf importation, or not the way glupload implements it.
The bottleneck in that context is likely glupload, specially if your
v4l2src produce non-cache-able memory.

If you are not running on battery, you could probably concert to RGBA
before glupload, using software converter.

  v4l2src ! videoconvert n-threads=2 ! queue ! video/x-raw,fromat=RGBA ! glupload ! qmlglsink

> Thanks
> Iñigo
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list