## v4l2src

v4l2src — Reads frames from a Video4Linux2 device

## Properties

gchar * | device | Read / Write
gchar * | device-name | Read
GstV4l2DeviceTypeFlags | flags | Read
guint | queue-size | Read / Write
gboolean | always-copy | Read / Write
gint | device-fd | Read
gint | brightness | Read / Write
gint | contrast | Read / Write
gint | decimate | Read / Write
gint | hue | Read / Write
gint | saturation | Read / Write
V4L2_TV_norms | norm | Read / Write
GstV4l2IOMode | io-mode | Read / Write
GstStructure * | extra-controls | Read / Write
gboolean | force-aspect-ratio | Read / Write
gchar * | pixel-aspect-ratio | Read / Write

## Signals

void | prepare-format | Run Last

## Types and Values

struct | GstV4l2Src

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ╰── GstElement
                    ╰── GstBaseSrc
                        ╰── GstPushSrc
                            ╰── GstV4l2Src

## Implemented Interfaces

GstV4l2Src implements GstURIHandler, GstTuner, GstColorBalance and GstVideoOrientation.

## Description

## 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, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 100/1 ]
| video/x-dv, systemstream=(boolean)true
| video/x-h263, variant=(string)itu
| video/x-h264, stream-format=(string)byte-stream, alignment=(string)au
| video/x-pwc1, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 100/1 ]
| video/x-pwc2, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 100/1 ]
| video/x-raw, format=(string){ RGB15, RGB16, BGR, RGB, BGRx, BGRA, xRGB, ARGB, GRAY8, YVU9, YV12, YUY2, UYVY, Y42B, Y41B, NV12_64Z32, YUV9, I420, YVYU, NV21, NV12 }, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 100/1 ]
| video/x-sonix, width=(int)[ 1, 32768 ], height=(int)[ 1, 32768 ], framerate=(fraction)[ 0/1, 100/1 ]
| video/x-vp8

## Functions

## Types and Values

### struct GstV4l2Src

    struct GstV4l2Src;

## Property Details

### The `“device”` property

      “device”                   gchar *

Device location.

Flags: Read / Write

Default value: "/dev/video0"

### The `“device-name”` property

      “device-name”              gchar *

Name of the device.

Flags: Read

Default value: NULL

### The `“flags”` property

      “flags”                    GstV4l2DeviceTypeFlags

Device type flags.

Flags: Read

### The `“queue-size”` property

      “queue-size”               guint

Number of buffers to be enqueud in the driver in streaming mode.

Flags: Read / Write

Allowed values: [1,16]

Default value: 2

### The `“always-copy”` property

      “always-copy”              gboolean

If the buffer will or not be used directly from mmap.

Flags: Read / Write

Default value: TRUE

### The `“device-fd”` property

      “device-fd”                gint

File descriptor of the device.

Flags: Read

Allowed values: >= G_MAXULONG

Default value: -1

### The `“brightness”` property

      “brightness”               gint

Picture brightness, or more precisely, the black level.

Flags: Read / Write

Default value: 0

### The `“contrast”` property

      “contrast”                 gint

Picture contrast or luma gain.

Flags: Read / Write

Default value: 0

### The `“decimate”` property

      “decimate”                 gint

Only use every nth frame.

Flags: Read / Write

Allowed values: >= 1

Default value: 1

### The `“hue”` property

      “hue”                      gint

Hue or color balance.

Flags: Read / Write

Default value: 0

### The `“saturation”` property

      “saturation”               gint

Picture color saturation or chroma gain.

Flags: Read / Write

Default value: 0

### The `“norm”` property

      “norm”                     V4L2_TV_norms

video standard.

Flags: Read / Write

Default value: none

### The `“io-mode”` property

      “io-mode”                  GstV4l2IOMode

I/O mode.

Flags: Read / Write

Default value: GST_V4L2_IO_AUTO

### The `“extra-controls”` property

      “extra-controls”           GstStructure *

Extra v4l2 controls (CIDs) for the device.

Flags: Read / Write

### The `“force-aspect-ratio”` property

      “force-aspect-ratio”       gboolean

When enabled, the pixel aspect ratio will be enforced.

Flags: Read / Write

Default value: TRUE

### The `“pixel-aspect-ratio”` property

      “pixel-aspect-ratio”       gchar *

Overwrite the pixel aspect ratio of the device.

Flags: Read / Write

Default value: "1/1"

## Signal Details

### The `“prepare-format”` signal

    void
    user_function (GstV4l2Src *gstv4l2src,
                   gint        arg1,
                   GstCaps    *arg2,
                   gpointer    user_data)

#### Parameters

gstv4l2src | the object which received the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last