Motion Detection
Detects scene and camera motion in the video stream.
Overview
The Motion detection node detects camera and/or scene motion in the video, adds motion detection metadata to the frame metadata, and can drop frames when there is no motion to reduce downstream processing. This node makes it easy to build use cases such as motion triggered recordings, or to reduce downstream processing when there is no motion.
Inputs & Outputs
- Inputs : 1, Media Format : Raw Video
- Outputs : 1, Media Format: Raw Video
- Output Metadata : MOtion Information
Properties
| Property | Description | Type | Default | Required |
|---|---|---|---|---|
detect_camera_motion | Detects camera view changing (such as pan/tilt/zoom). | bool | false | No |
detect_scene_motion | Detects motion in the scene, optionally within specified regions of interest. | bool | true | No |
roi_labels | Regions of interest labels. Comma separated. | string | - | No |
rois | Regions of interest for scene movement detection. If defined, only detects motion within these regions. Comma separated vertices, semicolon separated polygons. | string | null | No |
sensitivity | Sensitivity of motion detection. Higher sensitivity detects smaller motions. Range: 0-100 | float | 50 | No |
display | Display motion detection state on video? | bool | true | No |
display_rois | Display ROI polygons on video? | bool | true | No |
drop_frames_without_motion | Drop frames without motion? | bool | false | No |
processing_interval | Detect motion every nth frame. Higher values reduce processing load but delay detection. Range: 1-30 | int | 1 | No |
reference_interval | Update reference every nth frame. Higher values help detect slow movements better. Range: 2-30. Leave empty for auto. | int | null | No |
no_motion_interval | Declare motion stopped after n seconds without motion. Leave empty for auto. | int | null | No |
processing_resolution | Processing resolution. Options: medium, small | enum | medium | No |
thread_number | Number of threads to use in parallel processing. | number | null | No |
debug | Debug mode. Enable for extra debug information. | bool | false | No |
Metadata
| Metadata Property | Description |
|---|---|
nodes.<node_id> | Describes the Motion detection state. Format: as defined in the table below. <node_id> for Motion Detection Nodes is of the form annotate_motionX (ex. annotate_motion1) |
Example
"nodes": {
"annotate_motion1": {
"type": "annotate_motion",
"rois": {
"fullframe": {
"motion_delta": False,
"motion": True,
"motion_score": 0.8,
"motion_duration": 30,
"time_since_motion_stopped": -1
},
"camera": {
"motion_delta": True,
"motion": True,
"motion_info": {
"px": 24.0,
"py": 0.0,
"t": 0.1,
"z": 0.98
},
"motion_duration": 0,
"time_since_motion_stopped": -1
}
}
}
}Format
| Key | Type | Description |
|---|---|---|
fullframe.motion_delta | Boolean | True if scene motion state changed since last frame, else False. |
fullframe.motion | Boolean | True if scene motion is currently detected, else False |
fullframe.motion_score | Float | A number between 0 and 1 that indicates the extent of detected scene motion. Larger number means higher amount of motion. |
fullframe.motion_duration | Float | Number of seconds since scene motion started, when motion is True. -1 if motion is False. |
fullframe.time_since_motion_stopped | Float | Number of seconds since scene motion last stopped. -1 if motion is currently True. |
camera.motion_delta | Boolean | True if camera motion state changed since last frame, else False. |
camera.motion | Boolean | True if camera motion is currently detected, else False |
camera.motion_info.px | Float | Horizontal camera motion in pixels. |
camera.motion_info.py | Float | Vertical camera motion in pixels. |
camera.motion_info.t | Float | Rotational camera motion in degrees. |
camera.motion_info.z | Float | Camera zoom as a ratio. Numbers less than 1 imply zoom in, more than 1 imply zoom out |
camera.motion_duration | Float | Number of seconds since camera motion started, when motion is True. -1 if motion is False. |
camera.time_since_motion_stopped | Float | Number of seconds since camera motion last stopped. -1 if motion is currently True. |
Updated 18 days ago
