roflcoopter / viseron

Self-hosted, local only NVR and AI Computer Vision software. With features such as object detection, motion detection, face recognition and more, it gives you the power to keep an eye on your home, office or any other place you want to monitor.
MIT License
1.74k stars 179 forks source link

[FR] MQTT subs to forcibly trigger camera, reload config, etc. #15

Open akohlsmith opened 4 years ago

akohlsmith commented 4 years ago

Similar to my signal handler FR, this would have Viseron subscribe to a one or a few topics so I could send a message and have Viseron trigger a normal recording (i.e. the triggered recording would have length of the sum of lookback and timeout values in the recorder section).

Other things that would be very helpful for Viseron to be able to subscribe to would be a way to reload the config and maybe even forcibly run object detection (i.e. simulate a motion trigger).

Piggybacking on this FR - having Viseron publish when it sees motion (with the message containing data such as the bounding box coordinates, area and frame count) would make it possible to have a third party tool watch the camera feed and draw bounding boxes around the image as Viseron does its thing.

andreipopovici commented 4 years ago

Piggybacking on this piggyback, I was about to ask for a way to externally trigger motion detection, which would be useful for those who already have a PIR motion detector and would like it to trigger either object detection (and skip the CV motion detection, which may not be as good as PIR) or a recording directly.

Subscribing to a motion topic via MQTT (as well as object_detection and recording, why not?) would be awesome! It would open up so many possibilities such as offloading object detection to the cloud (for those who desire it), etc.

roflcoopter commented 4 years ago

Okay just to recap this so I am on the same page as you guys

1) You want to be able to start object detection manually. Should object detection run until instructed otherwise or do you want to pass a parameter for how long to run the detector? For Home Assistant im thinking this could be a new switch entity

2) Start recordings manually, same questions as i asked above applies here.

Subscribing to a motion topic via MQTT (as well as object_detection and recording, why not?) would be awesome! It would open up so many possibilities such as offloading object detection to the cloud (for those who desire it), etc.

Could you elaborate on this? Motion detection on/off is already published over MQTT

andreipopovici commented 4 years ago

@roflcoopter Not sure about object detection, @akohlsmith might clarify his use case.

In my case, I meant viseron should subscribe to a topic, so we can push an external message that would trigger motion/object_detection/recording manually. It could start as a simple message with no params, which would simply trigger the specified event, just as if it would've happened internally.

If others request them, then custom override parameters could be added, but the MVP would be to simply externally trigger internal events.

Edit: I see how the object_detection message might require some parameters that would set the appropriate sensor values in HA, as well as internal state. However, without jumping into the code, motion and record are simple events with no state required (only the config defaults), correct?

Itach1Uchixa commented 3 years ago

Being able to set cameras to record/object detection or at least to record state would be a great feature. For example, I am now doing a project that involves measuring the weight of the incoming payload and during this time my software must initiate camera recording to report it to the remote monitoring center afterward for documenting purposes.

shbatm commented 3 years ago

Adding onto this regarding externally triggering the object detection: I would also like to see this feature. I use Hikvision cameras and they have halfway decent internal event processing for motion, line crossing, zone intrusion, etc. Currently, I use these events to upload an FTP image and run Deepstack to post-process and eliminate false positives. Implementing this in viseron would (in my head at least) reduce some overhead--because you could disable the internal CV motion detection and just wait for an external trigger of when to process.

roflcoopter commented 3 years ago

This is coming soonish. Been working on an API for Viseron which will enable this