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

Factory details

Authors: – Rob Clark ,

Classification:Sink/Video

Rank – none

Plugin – video4linux2

Package – GStreamer Good Plug-ins

Pad Templates

sink

image/jpeg:
video/mpeg:
    mpegversion: 4
   systemstream: false
video/mpeg:
    mpegversion: { (int)1, (int)2 }
video/mpegts:
   systemstream: true
video/x-bayer:
         format: { bggr, gbrg, grbg, rggb }
          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:Interlaced):
         format: { RGB16, BGR, BGRA, ABGR, xBGR, RGBx, ARGB, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV24, NV61, NV16, NV21, NV12, I420, xRGB, BGRx, RGB, BGR15, RGB15 }
          width: [ 1, 32768 ]
         height: [ 1, 32768 ]
      framerate: [ 0/1, 2147483647/1 ]
 interlace-mode: alternate
video/x-raw:
         format: { RGB16, BGR, ABGR, xBGR, RGBx, GRAY8, GRAY16_LE, GRAY16_BE, YVU9, YV12, YUY2, YVYU, UYVY, Y42B, Y41B, YUV9, NV12_64Z32, NV24, NV61, NV16, NV21, NV12, I420, ARGB, xRGB, RGB, BGRA, BGRx, BGR15, 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

Presencealways

Directionsink

Object typeGstPad


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