gstreamer v4l2src

Nicolas Dufresne nicolas.dufresne at collabora.com
Thu Feb 19 09:53:11 PST 2015


Le 2015-02-19 02:55, Marianna Smidth Buschle a écrit :
> Hi,
>
> I'm working with a v4l2 camera and want to implement some processes 
> using gstreamer.
> I'm using the v4l2src element to get my images and was wondering if 
> there is a way to set the crop area or any plan to implement it.
> Using the videocrop element is not an option. I need to set the crop 
> area of video4linux in order to get higher framerate from the camera.
About no camera driver supports that, but patches are welcome as long as 
they don't break other use cases. Ideally, this would be with SELECTION 
API, which replaces CROP.

"I need to set the crop area of video4linux in order to get higher 
framerate from the camera" makes very little sense. If you can't get the 
highest rate it is most likely because you are saturating the bus (most 
of the time USB 2). In this case, my recommendation is to request JPEG 
images instead of RAW.

gst-launch-1.0 v4l2src ! image/jpeg ! jpegdec ! ...

>
> Moreover I have had a hard time trying to find information about the 
> "extra-controls" property.
> What it is exactly and how to use it?

It is poorly documented and hard to use, but usable. From the 
gst-launch-1.0, the structure property have the following syntax:

gst-launch-1.0 v4l2src extra-controls="name,key=value,key=value,..." ! ...

The structure name is currently ignored, so any name will do. I notice 
that we don't currently initially set this property, so it cannot be 
used to enumerate the controls. That would probably be a nice feature to 
add. We already enumerate controls in gst_v4l2_fill_lists(); A working 
example:

GST_DEBUG=3 gst-launch-1.0 v4l2src extra-controls="c,brightness=100" ! 
xvimagesink

And to get the list:
    v4l2-ctl --list-ctrls

cheers,
Nicolas


More information about the gstreamer-devel mailing list