motioncells: GStreamer Bad Plugins 1.0 Plugins Reference Manual

## motioncells motioncells |

## Properties

gboolean | calculatemotion | Read / Write
gchar * | cellscolor | Read / Write
gchar * | datafile | Read / Write
gchar * | datafileextension | Read / Write
gboolean | display | Read / Write
gint | gap | Read / Write
gint | gridx | Read / Write
gint | gridy | Read / Write
gint | minimummotionframes | Read / Write
gchar * | motioncellsidx | Read / Write
gint | motioncellthickness | Read / Write
gchar * | motionmaskcellspos | Read / Write
gchar * | motionmaskcoords | Read / Write
gboolean | postallmotion | Read / Write
gint | postnomotion | Read / Write
gdouble | sensitivity | Read / Write
gdouble | threshold | Read / Write
gboolean | usealpha | Read / Write

## Types and Values

struct | GstMotioncells

## Description

Performs motion detection on videos.

### Example launch line

    1
    gst-launch-1.0 videotestsrc pattern=18 ! videorate ! videoscale ! video/x-raw,width=320,height=240,framerate=5/1 ! videoconvert ! motioncells ! videoconvert ! xvimagesink

## Synopsis

### Element Information

plugin | opencv
author | Robert Jobbagy <jobbagy dot robert at gmail dot com>, Nicola Murino <nicola dot murino at gmail.com>
class | Filter/Effect/Video

### Element Pads

name | sink
direction | sink
presence | always
details | video/x-raw, format=(string)RGB, 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)RGB, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]

## Functions

## Types and Values

### struct GstMotioncells

    struct GstMotioncells {
      GstOpencvVideoFilter element;
      GstState state;
      gboolean display, calculate_motion, firstgridx, firstgridy, changed_gridx,
          changed_gridy, changed_startime;
      gboolean previous_motion, changed_datafile, postallmotion, usealpha,
          firstdatafile, firstframe;
      gboolean sent_init_error_msg, sent_save_error_msg;
      gchar *prev_datafile, *cur_datafile, *basename_datafile, *datafile_extension;
      gint prevgridx, gridx, prevgridy, gridy, id;
      gdouble sensitivity, threshold;
      motionmaskcoordrect *motionmaskcoords;
      cellscolor *motioncellscolor;
      motioncellidx *motioncellsidx, *motionmaskcellsidx;
      int motionmaskcoord_count, motioncells_count, motionmaskcells_count;
      int thickness;
      guint gap, datafileidx, postnomotion, minimum_motion_frames;
      guint64 motion_begin_timestamp, last_motion_timestamp, motion_timestamp,
          last_nomotion_notified, prev_buff_timestamp, cur_buff_timestamp;
      gint64 diff_timestamp, starttime;
      guint64 consecutive_motion;
      gint width, height;
      //time stuff
      GTimeVal tv;
      double framerate;
      //Video width and height are known in "gst_motion_cells_handle_sink_event",
      // but not when setting the "motionmaskcoords".
      gchar has_delayed_mask;
    };

## Property Details

### The `“calculatemotion”` property

      “calculatemotion”          gboolean

Toggles motion calculation. If FALSE, this filter does nothing.

Flags: Read / Write

Default value: TRUE

### The `“cellscolor”` property

      “cellscolor”               gchar *

Color for motion cells in R,G,B format. Max per channel is 255.

Flags: Read / Write

Default value: "255,255,0"

### The `“datafile”` property

      “datafile”                 gchar *

Location of motioncells data file (empty string means no saving).

Flags: Read / Write

Default value: NULL

### The `“datafileextension”` property

      “datafileextension”        gchar *

Extension of datafile.

Flags: Read / Write

Default value: "vamc"

### The `“display”` property

      “display”                  gboolean

Toggle display of motion cells on current frame.

Flags: Read / Write

Default value: FALSE

### The `“gap”` property

      “gap”                      gint

Interval in seconds after which motion is considered finished and a motion finished bus message is posted.

Flags: Read / Write

Allowed values: [1,60]

Default value: 5

### The `“gridx”` property

      “gridx”                    gint

Number of horizontal grid cells.

Flags: Read / Write

Allowed values: [8,32]

Default value: 10

### The `“gridy”` property

      “gridy”                    gint

Number of vertical grid cells.

Flags: Read / Write

Allowed values: [8,32]

Default value: 10

### The `“minimummotionframes”` property

      “minimummotionframes”      gint

Minimum number of motion frames triggering a motion event.

Flags: Read / Write

Allowed values: [1,60]

Default value: 1

### The `“motioncellsidx”` property

      “motioncellsidx”           gchar *

Describe a cell with its line and column idx separated with ":". Pass multiple cells as a comma-separated list.

Flags: Read / Write

Default value: NULL

### The `“motioncellthickness”` property

      “motioncellthickness”      gint

Motion Cell Border Thickness. Set to -1 to fill motion cell.

Flags: Read / Write

Allowed values: [G_MAXULONG,5]

Default value: 1

### The `“motionmaskcellspos”` property

      “motionmaskcellspos”       gchar *

Describe a cell with its line and column idx separated with ":". Pass multiple cells as a comma-separated list.

Flags: Read / Write

Default value: NULL

### The `“motionmaskcoords”` property

      “motionmaskcoords”         gchar *

Describe a region with its upper left and lower right x, y coordinates separated with ":". Pass multiple regions as a comma-separated list.

Flags: Read / Write

Default value: NULL

### The `“postallmotion”` property

      “postallmotion”            gboolean

Post bus messages for every motion frame or just motion start and motion stop.

Flags: Read / Write

Default value: FALSE

### The `“postnomotion”` property

      “postnomotion”             gint

If non 0, post a no_motion event on the bus if no motion is detected for the given number of seconds.

Flags: Read / Write

Allowed values: [0,180]

Default value: 0

### The `“sensitivity”` property

      “sensitivity”              gdouble

Motion detection sensitivity.

Flags: Read / Write

Allowed values: [0,1]

Default value: 0.5

### The `“threshold”` property

      “threshold”                gdouble

Threshold value for motion. Filter detects motion when at least this fraction of the cells have moved.

Flags: Read / Write

Allowed values: [0,1]

Default value: 0.01

### The `“usealpha”` property

      “usealpha”                 gboolean

Toggle usage of alpha blending on frames with motion cells.

Flags: Read / Write

Default value: TRUE