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

PropertyDescriptionTypeDefaultRequired
detect_scene_motionDetects motion in the scene.booltrueNo
detect_camera_motionDetects camera view changing (such as pan/tilt/zoom).boolfalseNo
sensitivityMotion detection sensitivity. Higher sensitivity will detect smaller motions. Range: 0 - 100slider-optional50No
displayDisplay motion detection state on video.booltrueNo
drop_frames_without_motionIf enabled, will drop frames that have no motion.boolfalseNo
processing_intervalDetect motion every nth frame. Higher values reduce processing load but delay detection. Range: 1 - 30slider-optional1No
processing_resolutionProcessing resolution. Options: Medium, SmallenummediumNo

Metadata

Metadata PropertyDescription
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

KeyTypeDescription
fullframe.motion_deltaBooleanTrue if scene motion state changed since last frame, else False.
fullframe.motionBooleanTrue if scene motion is currently detected, else False
fullframe.motion_scoreFloatA number between 0 and 1 that indicates the extent of detected scene motion. Larger number means higher amount of motion.
fullframe.motion_durationFloatNumber of seconds since scene motion started, when motion is True. -1 if motion is False.
fullframe.time_since_motion_stoppedFloatNumber of seconds since scene motion last stopped. -1 if motion is currently True.
camera.motion_deltaBooleanTrue if camera motion state changed since last frame, else False.
camera.motionBooleanTrue if camera motion is currently detected, else False
camera.motion_info.pxFloatHorizontal camera motion in pixels.
camera.motion_info.pyFloatVertical camera motion in pixels.
camera.motion_info.tFloatRotational camera motion in degrees.
camera.motion_info.zFloatCamera zoom as a ratio. Numbers less than 1 imply zoom in, more than 1 imply zoom out
camera.motion_durationFloatNumber of seconds since camera motion started, when motion is True. -1 if motion is False.
camera.time_since_motion_stoppedFloatNumber of seconds since camera motion last stopped. -1 if motion is currently True.