v4l2src

v4l2src

Synopsis

struct              GstV4l2Src;

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GstObject
               +----GstElement
                     +----GstBaseSrc
                           +----GstPushSrc
                                 +----GstV4l2Src

Implemented Interfaces

GstV4l2Src implements GstURIHandler, GstTuner, GstColorBalance and GstVideoOrientation.

Properties

  "device"                   gchar*                : Read / Write
  "device-name"              gchar*                : Read
  "flags"                    GstV4l2DeviceTypeFlags  : Read
  "device-fd"                gint                  : Read
  "brightness"               gint                  : Read / Write
  "contrast"                 gint                  : Read / Write
  "hue"                      gint                  : Read / Write
  "saturation"               gint                  : Read / Write
  "norm"                     V4L2_TV_norms         : Read / Write
  "io-mode"                  GstV4l2IOMode         : Read / Write
  "extra-controls"           GstStructure*         : Read / Write
  "force-aspect-ratio"       gboolean              : Read / Write
  "pixel-aspect-ratio"       gchar*                : Read / Write

Signals

  "prepare-format"                                 : Run Last

Description

v4l2src can be used to capture video from v4l2 devices, like webcams and tv cards.

Example launch lines

1
gst-launch-1.0 v4l2src ! xvimagesink
This pipeline shows the video captured from /dev/video0 tv card and for webcams.
1
gst-launch-1.0 v4l2src ! jpegdec ! xvimagesink
This pipeline shows the video captured from a webcam that delivers jpeg images.

Synopsis

Element Information

plugin

video4linux2

author

Edgard Lima <edgard.lima@indt.org.br>, Stefan Kost <ensonic@users.sf.net>

class

Source/Video

Element Pads

name

src

direction

source

presence

always

details

image/jpeg

video/mpeg, mpegversion=(int)4, systemstream=(boolean)false

video/mpeg, mpegversion=(int)2

video/mpegts, systemstream=(boolean)true

video/x-bayer, format=(string){ bggr, gbrg, grbg, rggb }, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

video/x-dv, systemstream=(boolean)true

video/x-h263, variant=(string)itu

video/x-h264, stream-format=(string){ byte-stream, avc }, alignment=(string)au

video/x-pwc1, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

video/x-pwc2, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

video/x-raw, format=(string){ RGB16, BGR, RGB, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV24, NV61, NV16, NV21, NV12, I420, BGRA, BGRx, ARGB, xRGB, BGR15, RGB15 }, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

video/x-sonix, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

video/x-vp8

video/x-wmv, wmvversion=(int)3, format=(string)WVC1

Details

struct GstV4l2Src

struct GstV4l2Src;

Opaque object.

Property Details

The "device" property

  "device"                   gchar*                : Read / Write

Device location.

Default value: "/dev/video0"


The "device-name" property

  "device-name"              gchar*                : Read

Name of the device.

Default value: NULL


The "flags" property

  "flags"                    GstV4l2DeviceTypeFlags  : Read

Device type flags.


The "device-fd" property

  "device-fd"                gint                  : Read

File descriptor of the device.

Allowed values: >= G_MAXULONG

Default value: -1


The "brightness" property

  "brightness"               gint                  : Read / Write

Picture brightness, or more precisely, the black level

Default value: 0


The "contrast" property

  "contrast"                 gint                  : Read / Write

Picture contrast or luma gain

Default value: 0


The "hue" property

  "hue"                      gint                  : Read / Write

Hue or color balance

Default value: 0


The "saturation" property

  "saturation"               gint                  : Read / Write

Picture color saturation or chroma gain

Default value: 0


The "norm" property

  "norm"                     V4L2_TV_norms         : Read / Write

TV norm

Default value: none


The "io-mode" property

  "io-mode"                  GstV4l2IOMode         : Read / Write

IO Mode

Default value: GST_V4L2_IO_AUTO


The "extra-controls" property

  "extra-controls"           GstStructure*         : Read / Write

Additional v4l2 controls for the device. The controls are identified by the control name (lowercase with '_' for any non-alphanumeric characters).

Since 1.2


The "force-aspect-ratio" property

  "force-aspect-ratio"       gboolean              : Read / Write

When enabled, the pixel aspect ratio queried from the device or set with the pixel-aspect-ratio property will be enforced.

Default value: TRUE

Since 1.2


The "pixel-aspect-ratio" property

  "pixel-aspect-ratio"       gchar*                : Read / Write

The pixel aspect ratio of the device. This overwrites the pixel aspect ratio queried from the device.

Default value: "1/1"

Since 1.2

Signal Details

The "prepare-format" signal

void                user_function                      (GstV4l2Src *v4l2src,
                                                        gint        fd,
                                                        GstCaps    *caps,
                                                        gpointer    user_data)      : Run Last

This signal gets emitted before calling the v4l2 VIDIOC_S_FMT ioctl (set format). This allows for any custom configuration of the device to happen prior to the format being set. This is mostly useful for UVC H264 encoding cameras which need the H264 Probe & Commit to happen prior to the normal Probe & Commit.

v4l2src :

the v4l2src instance

fd :

the file descriptor of the current device

caps :

the caps of the format being set

user_data :

user data set when the signal handler was connected.

Since 0.10.32