## videorate

videorate — Drops/duplicates/adjusts timestamps on video frames to make a perfect stream

## Synopsis

    struct              GstVideoRate;

## Object Hierarchy

      GObject
       +----GstObject
             +----GstElement
                   +----GstBaseTransform
                         +----GstVideoRate

## Properties

      "drop"                     guint64               : Read
      "duplicate"                guint64               : Read
      "in"                       guint64               : Read
      "new-pref"                 gdouble               : Read / Write
      "out"                      guint64               : Read
      "silent"                   gboolean              : Read / Write
      "skip-to-first"            gboolean              : Read / Write
      "average-period"           guint64               : Read / Write
      "drop-only"                gboolean              : Read / Write
      "force-fps"                GstFraction           : Read / Write / Construct
      "max-rate"                 gint                  : Read / Write / Construct

## Description

This element takes an incoming stream of timestamped video frames. It will produce a perfect stream that matches the source pad's framerate.

The correction is performed by dropping and duplicating frames, no fancy algorithm is used to interpolate frames (yet).

By default the element will simply negotiate the same framerate on its source and sink pad.

This operation is useful to link to elements that require a perfect stream. Typical examples are formats that do not store timestamps for video frames, but only store a framerate, like Ogg and AVI.

A conversion to a specific framerate can be forced by using filtered caps on the source pad.

The properties "in", "out", "duplicate" and "drop" can be read to obtain information about number of input frames, output frames, dropped frames (i.e. the number of unused input frames) and duplicated frames (i.e. the number of times an input frame was duplicated, beside being used normally).

An input stream that needs no adjustments will thus never have dropped or duplicated frames.

When the "silent" property is set to FALSE, a GObject property notification will be emitted whenever one of the "duplicate" or "drop" values changes. This can potentially cause performance degradation. Note that property notification will happen from the streaming thread, so applications should be prepared for this.

### Example pipelines

    1

    gst-launch -v filesrc location=videotestsrc.ogg ! oggdemux ! theoradec ! videorate ! video/x-raw-yuv,framerate=15/1 ! xvimagesink

Decode an Ogg/Theora file and adjust the framerate to 15 fps before playing. To create the test Ogg/Theora file refer to the documentation of theoraenc.

    1

    gst-launch -v v4lsrc ! videorate ! video/x-raw-yuv,framerate=25/2 ! theoraenc ! oggmux ! filesink location=v4l.ogg

Capture video from a V4L device, and adjust the stream to 12.5 fps before encoding to Ogg/Theora.

Last reviewed on 2006-09-02 (0.10.11)

## Synopsis

### Element Information

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

### Element Pads

name | sink
direction | sink
presence | always
details | video/x-raw-yuv
| video/x-raw-rgb
| video/x-raw-gray
| image/jpeg
| image/png

name | src
direction | source
presence | always
details | video/x-raw-yuv
| video/x-raw-rgb
| video/x-raw-gray
| image/jpeg
| image/png

## Details

### struct GstVideoRate

    struct GstVideoRate;

Opaque data structure.

## Property Details

### The `"drop"` property

      "drop"                     guint64               : Read

Number of dropped frames.

Default value: 0

### The `"duplicate"` property

      "duplicate"                guint64               : Read

Number of duplicated frames.

Default value: 0

### The `"in"` property

      "in"                       guint64               : Read

Number of input frames.

Default value: 0

### The `"new-pref"` property

      "new-pref"                 gdouble               : Read / Write

Value indicating how much to prefer new frames (unused).

Allowed values: [0,1]

Default value: 1

### The `"out"` property

      "out"                      guint64               : Read

Number of output frames.

Default value: 0

### The `"silent"` property

      "silent"                   gboolean              : Read / Write

Don't emit notify for dropped and duplicated frames.

Default value: TRUE

### The `"skip-to-first"` property

      "skip-to-first"            gboolean              : Read / Write

Don't produce buffers before the first one we receive.

Default value: FALSE

Since 0.10.25

### The `"average-period"` property

      "average-period"           guint64               : Read / Write

Arrange for maximum framerate by dropping frames beyond a certain framerate, where the framerate is calculated using a moving average over the configured.

Allowed values: <= G_MAXLONG

Default value: 0

Since 0.10.36

### The `"drop-only"` property

      "drop-only"                gboolean              : Read / Write

Only drop frames, no duplicates are produced.

Default value: FALSE

Since 0.10.36

### The `"force-fps"` property

      "force-fps"                GstFraction           : Read / Write / Construct

Forced output framerate

Since 0.10.36

### The `"max-rate"` property

      "max-rate"                 gint                  : Read / Write / Construct

maximum framerate to pass through

Allowed values: >= 1

Default value: 2147483647

Since 0.10.36