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_scene_motion | Detects motion in the scene. | bool | true | No |
detect_camera_motion | Detects camera view changing (such as pan/tilt/zoom). | bool | false | No |
sensitivity | Motion detection sensitivity. Higher sensitivity will detect smaller motions. Range: 0 - 100 | slider-optional | 50 | No |
display | Display motion detection state on video. | bool | true | No |
drop_frames_without_motion | If enabled, will drop frames that have no motion. | bool | false | No |
processing_interval | Detect motion every nth frame. Higher values reduce processing load but delay detection. Range: 1 - 30 | slider-optional | 1 | No |
processing_resolution | Processing resolution. Options: Medium, Small | enum | medium | 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 3 months ago