# v4l2sink

v4l2sink can be used to display video to v4l2 devices (screen overlays provided by the graphics hardware, tv-out, etc)

## Example launch lines

     gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video1

This pipeline displays a test pattern on /dev/video1

     gst-launch-1.0 -v videotestsrc ! navigationtest ! v4l2sink

A pipeline to test navigation events. While moving the mouse pointer over the test signal you will see a black box following the mouse pointer. If you press the mouse button somewhere on the video and release it somewhere else a green box will appear where you pressed the button and a red one where you released it. (The navigationtest element is part of gst-plugins-good.) You can observe here that even if the images are scaled through hardware the pointer coordinates are converted back to the original video frame geometry so that the box can be drawn to the correct position. This also handles borders correctly, limiting coordinates to the image area

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBaseSink
                        ╰──GstVideoSink
                            ╰──v4l2sink

## Implemented interfaces

    GstTuner
    GstColorBalance
    GstVideoOrientation

## Factory details

Authors: – Rob Clark ,

Classification: – `Sink/Video`

Rank – none

Plugin – video4linux2

Package – GStreamer Good Plug-ins

## Pad Templates

### `sink`

    video/x-raw(memory:DMABuf):
             format: DMA_DRM
         drm-format: { (string)RGB8, (string)AR15, (string)XR15_BE, (string)AR15_BE, (string)RG16, (string)RG16_BE, (string)RG24, (string)BG24, (string)AR24, (string)RA24, (string)RX24, (string)AB24, (string)XB24, (string)BA24, (string)AR30, (string)"R8\ \ ", (string)"R4\ \ ", (string)"R10\ ", (string)"R12\ ", (string)"R16\ ", (string)"R16\ _BE", (string)GR88, (string)YUV9, (string)YVU9, (string)YUYV, (string)UYVY, (string)VYUY, (string)YU11, (string)NV12:0x0400000000000001, (string)NV24, (string)NV42, (string)NV12:0x0b00000000000001, (string)P010, (string)NV61, (string)NV16, (string)NV21, (string)NV12:0x0400000000000002, (string)NV12, (string)YU16, (string)YVYU, (string)YV12, (string)YU12, (string)BX24, (string)XR24, (string)XR15 }
              width: [ 1, 32768 ]
             height: [ 1, 32768 ]
          framerate: [ 0/1, 2147483647/1 ]

    video/x-raw(memory:DMABuf, format:Interlaced):
             format: DMA_DRM
         drm-format: { (string)RGB8, (string)AR15, (string)XR15_BE, (string)AR15_BE, (string)RG16, (string)RG16_BE, (string)RG24, (string)BG24, (string)AR24, (string)RA24, (string)RX24, (string)AB24, (string)XB24, (string)BA24, (string)AR30, (string)"R8\ \ ", (string)"R4\ \ ", (string)"R10\ ", (string)"R12\ ", (string)"R16\ ", (string)"R16\ _BE", (string)GR88, (string)YUV9, (string)YVU9, (string)YUYV, (string)UYVY, (string)VYUY, (string)YU11, (string)NV12:0x0400000000000001, (string)NV24, (string)NV42, (string)NV12:0x0b00000000000001, (string)P010, (string)NV61, (string)NV16, (string)NV21, (string)NV12:0x0400000000000002, (string)NV12, (string)YU16, (string)YVYU, (string)YV12, (string)YU12, (string)BX24, (string)XR24, (string)XR15 }
              width: [ 1, 32768 ]
             height: [ 1, 32768 ]
          framerate: [ 0/1, 2147483647/1 ]
     interlace-mode: alternate
    image/jpeg:
             parsed: true
    video/mpeg:
        mpegversion: 4
       systemstream: false
    video/mpeg:
        mpegversion: { (int)1, (int)2 }
    video/mpegts:
       systemstream: true
    video/x-av1:
      stream-format: obu-stream
          alignment: tu
    video/x-bayer:
             format: { bggr, gbrg, grbg, rggb, bggr10le, gbrg10le, grbg10le, rggb10le, bggr12le, gbrg12le, grbg12le, rggb12le, bggr14le, gbrg14le, grbg14le, rggb14le, bggr16le, gbrg16le, grbg16le, rggb16le }
              width: [ 1, 32768 ]
             height: [ 1, 32768 ]
          framerate: [ 0/1, 2147483647/1 ]
    video/x-dv:
       systemstream: true
    video/x-fwht:
    video/x-h263:
            variant: itu
    video/x-h264:
      stream-format: { (string)byte-stream, (string)avc }
          alignment: au
    video/x-h265:
      stream-format: byte-stream
          alignment: au
    video/x-pwc1:
              width: [ 1, 32768 ]
             height: [ 1, 32768 ]
          framerate: [ 0/1, 2147483647/1 ]
    video/x-pwc2:
              width: [ 1, 32768 ]
             height: [ 1, 32768 ]
          framerate: [ 0/1, 2147483647/1 ]
    video/x-raw:
             format: { RGB16, BGR, RGB, ABGR, xBGR, RGBA, RGBx, BGR10A2_LE, BGR15, GRAY8, GRAY16_LE, GRAY16_BE, YUV9, YVU9, YUY2, YVYU, UYVY, VYUY, Y41B, NV12_64Z32, NV12_8L128, NV12_10BE_8L128, NV24, NV12_16L32S, P010_10LE, NV61, NV16, NV21, NV12, Y42B, YV12, I420, ARGB, xRGB, BGRA, BGRx, RGB15 }
              width: [ 1, 32768 ]
             height: [ 1, 32768 ]
          framerate: [ 0/1, 2147483647/1 ]
    video/x-sonix:
              width: [ 1, 32768 ]
             height: [ 1, 32768 ]
          framerate: [ 0/1, 2147483647/1 ]
    video/x-vp8:
    video/x-vp9:
    video/x-wmv:
         wmvversion: 3
             format: { WVC1, WMV3 }

    video/x-raw(format:Interlaced):
             format: { RGB16, BGR, RGB, ABGR, xBGR, RGBA, RGBx, BGR10A2_LE, BGR15, GRAY8, GRAY16_LE, GRAY16_BE, YUV9, YVU9, YUY2, YVYU, UYVY, VYUY, Y41B, NV12_64Z32, NV12_8L128, NV12_10BE_8L128, NV24, NV12_16L32S, P010_10LE, NV61, NV16, NV21, NV12, Y42B, YV12, I420, ARGB, xRGB, BGRA, BGRx, RGB15 }
              width: [ 1, 32768 ]
             height: [ 1, 32768 ]
          framerate: [ 0/1, 2147483647/1 ]
     interlace-mode: alternate

Presence – always

Direction – sink

Object type – GstPad

## Properties

### brightness

    “brightness” gint

Picture brightness, or more precisely, the black level

Flags : Read / Write

Default value : 0

### contrast

    “contrast” gint

Picture contrast or luma gain

Flags : Read / Write

Default value : 0

### crop-height

    “crop-height” guint

The height of the video crop; default is equal to negotiated image height

Flags : Read / Write

Default value : 0

### crop-left

    “crop-left” gint

The leftmost (x) coordinate of the video crop; top left corner of image is 0,0

Flags : Read / Write

Default value : 0

### crop-top

    “crop-top” gint

The topmost (y) coordinate of the video crop; top left corner of image is 0,0

Flags : Read / Write

Default value : 0

### crop-width

    “crop-width” guint

The width of the video crop; default is equal to negotiated image width

Flags : Read / Write

Default value : 0

### device

    “device” gchararray

Device location

Flags : Read / Write

Default value : /dev/video1

### device-fd

    “device-fd” gint

File descriptor of the device

Flags : Read

Default value : -1

### device-name

    “device-name” gchararray

Name of the device

Flags : Read

Default value : NULL

### extra-controls

    “extra-controls” GstStructure *

Extra v4l2 controls (CIDs) for the device

Flags : Read / Write

### flags

    “flags” GstV4l2DeviceTypeFlags *

Device type flags

Flags : Read

Default value : (none)

### force-aspect-ratio

    “force-aspect-ratio” gboolean

When enabled, the pixel aspect ratio will be enforced

Flags : Read / Write

Default value : true

### hue

    “hue” gint

Hue or color balance

Flags : Read / Write

Default value : 0

### io-mode

    “io-mode” GstV4l2IOMode *

I/O mode

Flags : Read / Write

Default value : auto (0)

### norm

    “norm” V4L2_TV_norms *

video standard

Flags : Read / Write

Default value : none (0)

### overlay-height

    “overlay-height” guint

The height of the video overlay; default is equal to negotiated image height

Flags : Read / Write

Default value : 0

### overlay-left

    “overlay-left” gint

The leftmost (x) coordinate of the video overlay; top left corner of screen is 0,0

Flags : Read / Write

Default value : 0

### overlay-top

    “overlay-top” gint

The topmost (y) coordinate of the video overlay; top left corner of screen is 0,0

Flags : Read / Write

Default value : 0

### overlay-width

    “overlay-width” guint

The width of the video overlay; default is equal to negotiated image width

Flags : Read / Write

Default value : 0

### pixel-aspect-ratio

    “pixel-aspect-ratio” gchararray

Overwrite the pixel aspect ratio of the device

Flags : Read / Write

Default value : NULL

### saturation

    “saturation” gint

Picture color saturation or chroma gain

Flags : Read / Write

Default value : 0

The results of the search are