Open tskisner opened 6 months ago
Just a note: this agent does require the opencv
and imutils
packages. Let me know if you want me to add another "extra" key to setup.py for this case.
This is great. Thanks for reviewing @davidvng, and thanks for the PR @tskisner!
Just a note: this agent does require the
opencv
andimutils
packages. Let me know if you want me to add another "extra" key to setup.py for this case.
This would be good to do. If these will be used in the functions that @davidvng suggested get pulled out for use in the ACTi camera agent then I don't mind them going in the main install_requires
, else a new extras_require
group would be great.
Since I assume you're busy with other things now that you're back from the site @tskisner, let's go ahead and merge this as is (with added requirements to the setup.py
though), and @davidvng will take over making these improvements in separate PRs. That'll allow us to stand-up the agent for the cameras already deployed on site, and move forward with these suggestions. Sound good?
This is now ready for re-review @davidvng.
This agent adds support for acquiring snapshots and short recordings from cameras that can stream the RTSP protocol.
Description
This new agent records frames to disk (default every 10s) and passes them through a motion detection algorithm. If there is motion, a 60 second recording is taken. Recordings can also be triggered directly as an agent Task. Both images and video are stored to disk in circular buffers which by default hold the most recent 2 days of snapshots and 120 minutes of triggered videos. Use of this agent requires the opencv / cv2 and imutils packages.
Note that each agent instance handles exactly one camera. This enables using different settings for different camera placements.
Motivation and Context
This agent was created to support the Dahua security cameras at the site. These are interior cameras designed to capture unauthorized access or theft.
How Has This Been Tested?
This agent has been tested on a local system (laptop) at the site. It has been run for several hours and successfully detected motion in one of the containers as people went in and out. Note that I only tested this running as a local agent on the host system. I verified that the CPU and memory use are not too dramatic. There is a brief spike at the end of a recording when the list of frames is encoded to mp4. Here is an example of motion detection, which draws a green box around the areas where a change was detected:
Types of changes
Checklist: