# gdkpixbufoverlay

The gdkpixbufoverlay element overlays a provided GdkPixbuf or an image loaded from file onto a video stream.

Changing the positioning or overlay width and height properties at runtime is supported, but it might be prudent to to protect the property setting code with GST_BASE_TRANSFORM_LOCK and GST_BASE_TRANSFORM_UNLOCK, as g_object_set is not atomic for multiple properties passed in one go.

Changing the image at runtime is supported.

## Example launch line

     gst-launch-1.0 -v videotestsrc ! gdkpixbufoverlay location=image.png ! autovideosink

Overlays the image in image.png onto the test video picture produced by videotestsrc.

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBaseTransform
                        ╰──GstVideoFilter
                            ╰──gdkpixbufoverlay

## Factory details

Authors: – Tim-Philipp Müller

Classification: – `Filter/Effect/Video`

Rank – none

Plugin – gdkpixbuf

Package – GStreamer Good Plug-ins

## Pad Templates

### `sink`

    video/x-raw:
             format: { A444_16LE, A444_16BE, AYUV64, RGBA64_LE, ARGB64, ARGB64_LE, BGRA64_LE, ABGR64_LE, RGBA64_BE, ARGB64_BE, BGRA64_BE, ABGR64_BE, A422_16LE, A422_16BE, A420_16LE, A420_16BE, A444_12LE, GBRA_12LE, A444_12BE, GBRA_12BE, Y412_LE, Y412_BE, A422_12LE, A422_12BE, A420_12LE, A420_12BE, A444_10LE, GBRA_10LE, A444_10BE, GBRA_10BE, A422_10LE, A422_10BE, A420_10LE, A420_10BE, BGR10A2_LE, RGB10A2_LE, Y410, A444, GBRA, AYUV, VUYA, RGBA, RBGA, ARGB, BGRA, ABGR, A422, A420, AV12, Y444_16LE, GBR_16LE, Y444_16BE, GBR_16BE, v216, P016_LE, P016_BE, Y444_12LE, GBR_12LE, Y444_12BE, GBR_12BE, I422_12LE, I422_12BE, Y212_LE, Y212_BE, I420_12LE, I420_12BE, P012_LE, P012_BE, Y444_10LE, GBR_10LE, Y444_10BE, GBR_10BE, r210, I422_10LE, I422_10BE, NV16_10LE32, Y210, UYVP, v210, I420_10LE, I420_10BE, P010_10LE, NV12_10LE40, NV12_10LE32, P010_10BE, MT2110R, MT2110T, NV12_10BE_8L128, NV12_10LE40_4L4, Y444, BGRP, GBR, RGBP, NV24, v308, IYU2, RGBx, xRGB, BGRx, xBGR, RGB, BGR, Y42B, NV16, NV61, YUY2, YVYU, UYVY, VYUY, I420, YV12, NV12, NV21, NV12_16L32S, NV12_32L32, NV12_4L4, NV12_64Z32, NV12_8L128, Y41B, IYU1, YUV9, YVU9, BGR16, RGB16, BGR15, RGB15, RGB8P, GRAY16_LE, GRAY16_BE, GRAY10_LE32, GRAY8 }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]

Presence – always

Direction – sink

Object type – GstPad

### `src`

    video/x-raw:
             format: { A444_16LE, A444_16BE, AYUV64, RGBA64_LE, ARGB64, ARGB64_LE, BGRA64_LE, ABGR64_LE, RGBA64_BE, ARGB64_BE, BGRA64_BE, ABGR64_BE, A422_16LE, A422_16BE, A420_16LE, A420_16BE, A444_12LE, GBRA_12LE, A444_12BE, GBRA_12BE, Y412_LE, Y412_BE, A422_12LE, A422_12BE, A420_12LE, A420_12BE, A444_10LE, GBRA_10LE, A444_10BE, GBRA_10BE, A422_10LE, A422_10BE, A420_10LE, A420_10BE, BGR10A2_LE, RGB10A2_LE, Y410, A444, GBRA, AYUV, VUYA, RGBA, RBGA, ARGB, BGRA, ABGR, A422, A420, AV12, Y444_16LE, GBR_16LE, Y444_16BE, GBR_16BE, v216, P016_LE, P016_BE, Y444_12LE, GBR_12LE, Y444_12BE, GBR_12BE, I422_12LE, I422_12BE, Y212_LE, Y212_BE, I420_12LE, I420_12BE, P012_LE, P012_BE, Y444_10LE, GBR_10LE, Y444_10BE, GBR_10BE, r210, I422_10LE, I422_10BE, NV16_10LE32, Y210, UYVP, v210, I420_10LE, I420_10BE, P010_10LE, NV12_10LE40, NV12_10LE32, P010_10BE, MT2110R, MT2110T, NV12_10BE_8L128, NV12_10LE40_4L4, Y444, BGRP, GBR, RGBP, NV24, v308, IYU2, RGBx, xRGB, BGRx, xBGR, RGB, BGR, Y42B, NV16, NV61, YUY2, YVYU, UYVY, VYUY, I420, YV12, NV12, NV21, NV12_16L32S, NV12_32L32, NV12_4L4, NV12_64Z32, NV12_8L128, Y41B, IYU1, YUV9, YVU9, BGR16, RGB16, BGR15, RGB15, RGB8P, GRAY16_LE, GRAY16_BE, GRAY10_LE32, GRAY8 }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]

Presence – always

Direction – src

Object type – GstPad

## Properties

### alpha

    “alpha” gdouble

Global alpha of overlay image

Flags : Read / Write

Default value : 1

### coef-x

    “coef-x” gdouble

In absolute positioning mode, the x coordinate of overlay image's top-left corner is now given by offset-x + (relative-x * overlay_width) + (coef-x * video_width). This allows to align the image absolutely and relatively to any edge or center position.

Flags : Read / Write

Default value : 0

Since : 1.12

### coef-y

    “coef-y” gdouble

In absolute positioning mode, the y coordinate of overlay image's top-left corner is now given by offset-y + (relative-y * overlay_height) + (coef-y * video_height). This allows to align the image absolutely and relatively to any edge or center position.

Flags : Read / Write

Default value : 0

Since : 1.12

### location

    “location” gchararray

Location of image file to overlay

Flags : Read / Write

Default value : NULL

### offset-x

    “offset-x” gint

For positive value, horizontal offset of overlay image in pixels from left of video image. For negative value, horizontal offset of overlay image in pixels from right of video image

Flags : Read / Write

Default value : 0

### offset-y

    “offset-y” gint

For positive value, vertical offset of overlay image in pixels from top of video image. For negative value, vertical offset of overlay image in pixels from bottom of video image

Flags : Read / Write

Default value : 0

### overlay-height

    “overlay-height” gint

Height of overlay image in pixels (0 = same as overlay image)

Flags : Read / Write

Default value : 0

### overlay-width

    “overlay-width” gint

Width of overlay image in pixels (0 = same as overlay image)

Flags : Read / Write

Default value : 0

### pixbuf

    “pixbuf” GdkPixbuf *

GdkPixbuf object to render.

Flags : Read / Write

Since : 1.6

### positioning-mode

    “positioning-mode” Gdk-pixbuf-positioning-mode *

Positioning mode of offset-x and offset-y properties. Determines how negative x/y offsets will be interpreted. By default negative values are for positioning relative to the right/bottom edge of the video image, but you can use this property to select absolute positioning relative to a (0, 0) origin in the top-left corner. That way negative offsets will be to the left/above the video image, which allows you to smoothly slide logos into and out of the frame if desired.

Flags : Read / Write

Default value : pixels-relative-to-edges (0)

Since : 1.6

### relative-x

    “relative-x” gdouble

Horizontal offset of overlay image in fractions of video image width, from top-left corner of video image (in relative positioning)

Flags : Read / Write

Default value : 0

### relative-y

    “relative-y” gdouble

Vertical offset of overlay image in fractions of video image height, from top-left corner of video image (in relative positioning)

Flags : Read / Write

Default value : 0

## Named constants

### Gdk-pixbuf-positioning-mode

#### Members

`pixels-relative-to-edges` (0) – pixels-relative-to-edges
`pixels-absolute` (1) – pixels-absolute

The results of the search are