How and why v4l2src able to take YV12 format?

Nicolas Dufresne nicolas at ndufresne.ca
Fri Nov 15 17:08:43 UTC 2019


Le vendredi 15 novembre 2019 à 05:36 -0600, jeyp4 a écrit :
> Wow, wonderful answer.
> 
> I have 2 queries:
> 
> 1. In version < 1.14, How format=YV12 was working?
>     
>     I mean my usb device capability is MJPG 1280x720 at 60fps and YUYV
> 1280x720 at 5fps (in USB2 connection). Although if I set 
> v4l2src video/x-raw, format=YV12
>  in pipeline, it can work at 60 fps even in USB2 connection.
> 
> So what I can infer is, pipeline is performing 
> jpegdec ! videoconvert
>  inherently. Am i correct?

Correct ! 720p is now pretty lightweight for today's PC CPU. It was
working through an equivalent, but hidden in libv4l2 of:

  v4l2src ! image/jpeg,framerate=60/1 ! jpegdec ! videoconvert ! ...

USB2 does not have the bandwidth to reach that framerate/resolution
uncompressed. We also have code in v4l2src that favours higher
framerate, so I supposed that it decided that using the "emulated"
format at 60fps was better then native format at 5fps. Your app can
always override this decision with caps filter of course.

> 
> 2. How to see current value of 
> GST_V4L2_USE_LIBV4L2
>  in any system?

On Linux, in a terminal:
  echo $GST_V4L2_USE_LIBV4L2

When programming in C you can use g_getenv().

> How to modify current value of 
> GST_V4L2_USE_LIBV4L2
>  in any system?

In shell, export GST_V4L2_USE_LIBV4L2=1, or prior to gst_init() you can
do g_setenv(), see GLib documentation for more details. There is some
effort to ensure the decision remains the same, if not, let me know.

Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20191115/4ad1bbfa/attachment.sig>


More information about the gstreamer-devel mailing list