How to use Motion Detection
When motion is detected it is called an event. This tutorial applies to any event, even Object Detections. This is an updated version of How to use Motion Detection with the new Dashboard v3.
This article assumes you have already successfully setup a Monitor and it is in Watch-Only Mode.
RTSP / H.264 camera users please be sure to have a peek at this article before moving onward : How I optimized my RTSP camera.
Side Note : Traditional Recording was renamed to Event-Based Recording.
Detector Settings
- Open the Monitor Settings for a Monitor
- On the left side click on Detector Settings to quickly scroll to the section.
- Set Enabled to Yes. Motion Detection will be on by default.
Recording on Motion
In the Detector Settings you will find the following key options
- ONVIF Events : This can be ignored if you plan to use Shinobi's internal Motion Detection. Learn more here.
- Save Events : Save Events in the database. This will allow display of the events over video during playback.
- Trigger Record : This will order the camera to record if it is set to "Watch-Only" when an Event is detected.
- Buffer Time from Event : The amount of seconds to record before the trigger happened. If this is consistently inaccurate you will need to look at the optimization guide or force encoding on the server.
- Recording Timeout : The length of time "Trigger Record" will run for. This is read in minutes. This includes Buffer Time from Event.
- Timeout Reset on Next Event : Enable to reset the active Recording Timeout back to the beginning when a new event occurs while recording.
If you're ready to test you can skip the Regions seciton of this article.
These settings apply to Object Detection as well.
Regions (Zones)
After enabling the Detector you'll see in the Motion Detection section the following key options
- Minimum Change : The motion confidence rating must exceed this value to be seen as a trigger. This number correlates directly to the confidence rating returned by the motion detector. This option was previously named "Indifference".
- Maximum Change : The motion confidence rating must be lower than this value to be seen as a trigger. Leave blank for no maximum. This option was previously named "Max Indifference".
- Full Frame : This will read the entire frame for differences. This is the same as creating a region that covers the entire screen. If no Region is added to this Monitor this option will default to Yes.
- Accuracy Mode (Added 2022-07-18) : This automatically divides a region into tiles for highly precise detections at the cost of additional resource use. When enabled you till be offered a Tile Size option which is read in pixels squared. Default Tile Size value is 20.
If Regions that you setup are not detecting correctly set your Minimum Change to a lower value OR enable Accuracy Mode.
What is Accuracy Mode
Accuracy Mode will cut the scene into a grid, by default grid blocks are 20 by 20 pixels. You can adjust it by changing the Tile Size. The blocks that are touching a region will become active and starting detecting motion.
To visualize this, enable the feature and open the Region Editor to see which blocks are touching your Region. Those ones become active. If you have no regions created the whole scene will become active.
Quickly Test Event-Based Recording
To quickly start a recording without having to engage the camera's scene open the Live Grid and click the Trigger Event button in the top left of the Stream window for the Monitor we edited.
This will start a recording and should complete after the Recording Timeout value has passed. This will not test the Motion Detection engine, just the recording portion after something has been detected.
Tip : Open your camera stream directly in VLC (copy the URL from Shinobi) and then keep an eye on the timestamp your camera offers when you press the Trigger Event button. This will let you see if has started with the correct Buffer Time.
If all successful you can go back and setup your Regions as well.