## videodetect videodetect — Detect patterns in a video signal |

## Synopsis

    struct              GstVideoDetect;

## Object Hierarchy

      GObject
       +----GstObject
             +----GstElement
                   +----GstBaseTransform
                         +----GstVideoFilter
                               +----GstVideoDetect

## Properties

      "message"                  gboolean              : Read / Write / Construct
      "pattern-count"            gint                  : Read / Write / Construct
      "pattern-data-count"       gint                  : Read / Write / Construct
      "pattern-height"           gint                  : Read / Write / Construct
      "pattern-sensitivity"      gdouble               : Read / Write / Construct
      "pattern-width"            gint                  : Read / Write / Construct
      "bottom-offset"            gint                  : Read / Write / Construct
      "left-offset"              gint                  : Read / Write / Construct
      "pattern-center"           gdouble               : Read / Write / Construct

## Description

This plugin detects "pattern-count" squares in the bottom left corner of the video frames. The squares have a width and height of respectively "pattern-width" and "pattern-height". Even squares must be black and odd squares must be white.

When the pattern has been found, "pattern-data-count" squares after the pattern squares are read as a bitarray. White squares represent a 1 bit and black squares a 0 bit. The bitarray will will included in the element message that is posted (see below).

After the pattern has been found and the data pattern has been read, an element message called `"GstVideoDetect"` will be posted on the bus. If the pattern is no longer found in the frame, the same element message is posted with the have-pattern field set to FALSE. The message is only posted if the "message" property is TRUE.

The message's structure contains these fields:

- gboolean `"have-pattern"`: if the pattern was found. This field will be set to TRUE for as long as the pattern was found in the frame and set to FALSE for the first frame that does not contain the pattern anymore.

- GstClockTime `"timestamp"`: the timestamp of the buffer that triggered the message.

- GstClockTime `"stream-time"`: the stream time of the buffer.

- GstClockTime `"running-time"`: the running_time of the buffer.

- GstClockTime `"duration"`: the duration of the buffer.

- guint64 `"data-uint64"`: the data-pattern found after the pattern or 0 when have-signal is FALSE.

- guint `"data"`: the data-pattern found after the pattern or 0 when have-signal is FALSE.

### Example launch line

    1
    gst-launch videotestsrc ! videodetect ! ffmpegcolorspace ! ximagesink

Last reviewed on 2007-05-30 (0.10.5)

## Synopsis

### Element Information

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

### Element Pads

name | sink
direction | sink
presence | always
details | video/x-raw-yuv, format=(fourcc){ I420, YV12, Y41B, Y42B, Y444, YUY2, UYVY, AYUV, YVYU }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

name | src
direction | source
presence | always
details | video/x-raw-yuv, format=(fourcc){ I420, YV12, Y41B, Y42B, Y444, YUY2, UYVY, AYUV, YVYU }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

## Details

### struct GstVideoDetect

    struct GstVideoDetect;

Opaque datastructure.

## Property Details

### The `"message"` property

      "message"                  gboolean              : Read / Write / Construct

Post statics messages.

Default value: TRUE

### The `"pattern-count"` property

      "pattern-count"            gint                  : Read / Write / Construct

The number of pattern markers.

Allowed values: >= 0

Default value: 4

### The `"pattern-data-count"` property

      "pattern-data-count"       gint                  : Read / Write / Construct

The number of extra data pattern markers.

Allowed values: >= 0

Default value: 5

### The `"pattern-height"` property

      "pattern-height"           gint                  : Read / Write / Construct

The height of the pattern markers.

Allowed values: >= 1

Default value: 16

### The `"pattern-sensitivity"` property

      "pattern-sensitivity"      gdouble               : Read / Write / Construct

The sensitivity around the center for detecting the markers (0.0 = lowest, 1.0 highest).

Allowed values: [0,1]

Default value: 0.3

### The `"pattern-width"` property

      "pattern-width"            gint                  : Read / Write / Construct

The width of the pattern markers.

Allowed values: >= 1

Default value: 4

### The `"bottom-offset"` property

      "bottom-offset"            gint                  : Read / Write / Construct

The offset from the bottom border where the pattern starts.

Allowed values: >= 0

Default value: 0

### The `"left-offset"` property

      "left-offset"              gint                  : Read / Write / Construct

The offset from the left border where the pattern starts.

Allowed values: >= 0

Default value: 0

### The `"pattern-center"` property

      "pattern-center"           gdouble               : Read / Write / Construct

The center of the black/white separation (0.0 = lowest, 1.0 highest).

Allowed values: [0,1]

Default value: 0.5

## See Also

GstVideoMark