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

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;
  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.

Owner: GstMotioncells

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.

Owner: GstMotioncells

Flags: Read / Write

Default value: "255,255,0"


The “datafile” property

  “datafile”                 gchar *

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

Owner: GstMotioncells

Flags: Read / Write

Default value: NULL


The “datafileextension” property

  “datafileextension”        gchar *

Extension of datafile.

Owner: GstMotioncells

Flags: Read / Write

Default value: "vamc"


The “display” property

  “display”                  gboolean

Toggle display of motion cells on current frame.

Owner: GstMotioncells

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.

Owner: GstMotioncells

Flags: Read / Write

Allowed values: [1,60]

Default value: 5


The “gridx” property

  “gridx”                    gint

Number of horizontal grid cells.

Owner: GstMotioncells

Flags: Read / Write

Allowed values: [8,32]

Default value: 10


The “gridy” property

  “gridy”                    gint

Number of vertical grid cells.

Owner: GstMotioncells

Flags: Read / Write

Allowed values: [8,32]

Default value: 10


The “minimummotionframes” property

  “minimummotionframes”      gint

Minimum number of motion frames triggering a motion event.

Owner: GstMotioncells

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.

Owner: GstMotioncells

Flags: Read / Write

Default value: NULL


The “motioncellthickness” property

  “motioncellthickness”      gint

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

Owner: GstMotioncells

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.

Owner: GstMotioncells

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.

Owner: GstMotioncells

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.

Owner: GstMotioncells

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.

Owner: GstMotioncells

Flags: Read / Write

Allowed values: [0,180]

Default value: 0


The “sensitivity” property

  “sensitivity”              gdouble

Motion detection sensitivity.

Owner: GstMotioncells

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.

Owner: GstMotioncells

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.

Owner: GstMotioncells

Flags: Read / Write

Default value: TRUE