videobox: GStreamer Good Plugins 1.0 Plugins Reference Manual

## videobox videobox |

## Properties

gdouble | alpha | Read / Write
gdouble | border-alpha | Read / Write
gint | bottom | Read / Write
GstVideoBoxFill | fill | Read / Write
gint | left | Read / Write
gint | right | Read / Write
gint | top | Read / Write
gboolean | autocrop | Read / Write

## Types and Values

struct | GstVideoBox
enum | GstVideoBoxFill

## Object Hierarchy

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

## Description

This plugin crops or enlarges the image. It takes 4 values as input, a top, bottom, left and right offset. Positive values will crop that much pixels from the respective border of the image, negative values will add that much pixels. When pixels are added, you can specify their color. Some predefined colors are usable with an enum property.

The plugin is alpha channel aware and will try to negotiate with a format that supports alpha channels first. When alpha channel is active two other properties, alpha and border_alpha can be used to set the alpha values of the inner picture and the border respectively. an alpha value of 0.0 means total transparency, 1.0 is opaque.

The videobox plugin has many uses such as doing a mosaic of pictures, letterboxing video, cutting out pieces of video, picture in picture, etc..

Setting autocrop to true changes the behavior of the plugin so that caps determine crop properties rather than the other way around: given input and output dimensions, the crop values are selected so that the smaller frame is effectively centered in the larger frame. This involves either cropping or padding.

If you use autocrop there is little point in setting the other properties manually because they will be overriden if the caps change, but nothing stops you from doing so.

Sample pipeline:

    1
    2
    gst-launch-1.0 videotestsrc ! videobox autocrop=true ! \
      "video/x-raw, width=600, height=400" ! videoconvert ! ximagesink

## Synopsis

### Element Information

plugin | videobox
author | Wim Taymans <wim@fluendo.com>
class | Filter/Effect/Video

### Element Pads

name | sink
direction | sink
presence | always
details | video/x-raw, format=(string){ AYUV, ARGB, BGRA, ABGR, RGBA, xRGB, BGRx, xBGR, RGBx, RGB, BGR, Y444, Y42B, YUY2, YVYU, UYVY, I420, YV12, Y41B, GRAY8, GRAY16_BE, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

name | src
direction | source
presence | always
details | video/x-raw, format=(string){ AYUV, ARGB, BGRA, ABGR, RGBA, xRGB, BGRx, xBGR, RGBx, RGB, BGR, Y444, Y42B, YUY2, YVYU, UYVY, I420, YV12, Y41B, GRAY8, GRAY16_BE, GRAY16_LE }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

## Functions

## Types and Values

### struct GstVideoBox

    struct GstVideoBox;

### enum GstVideoBoxFill

#### Members

VIDEO_BOX_FILL_BLACK |  |
VIDEO_BOX_FILL_GREEN |  |
VIDEO_BOX_FILL_BLUE |  |
VIDEO_BOX_FILL_RED |  |
VIDEO_BOX_FILL_YELLOW |  |
VIDEO_BOX_FILL_WHITE |  |
VIDEO_BOX_FILL_LAST |  |

## Property Details

### The `“alpha”` property

      “alpha”                    gdouble

Alpha value picture.

Flags: Read / Write

Allowed values: [0,1]

Default value: 1

### The `“border-alpha”` property

      “border-alpha”             gdouble

Alpha value of the border.

Flags: Read / Write

Allowed values: [0,1]

Default value: 1

### The `“bottom”` property

      “bottom”                   gint

Pixels to box at bottom (<0 = add a border).

Flags: Read / Write

Default value: 0

### The `“fill”` property

      “fill”                     GstVideoBoxFill

How to fill the borders.

Flags: Read / Write

Default value: Black

### The `“left”` property

      “left”                     gint

Pixels to box at left (<0 = add a border).

Flags: Read / Write

Default value: 0

### The `“right”` property

      “right”                    gint

Pixels to box at right (<0 = add a border).

Flags: Read / Write

Default value: 0

### The `“top”` property

      “top”                      gint

Pixels to box at top (<0 = add a border).

Flags: Read / Write

Default value: 0

### The `“autocrop”` property

      “autocrop”                 gboolean

If set to `TRUE` videobox will automatically crop/pad the input video to be centered in the output.

Flags: Read / Write

Default value: FALSE

## See Also

GstVideoCrop