motioneye-project / motioneye

A web frontend for the motion daemon.
GNU General Public License v3.0
3.96k stars 650 forks source link

Feature to upload a snapshot as soon as movement is detected #1332

Open rodrigouroz opened 5 years ago

rodrigouroz commented 5 years ago

I want to fork the repo and create a new feature for uploading a snapshot (the first frame perhaps) when movement is detected. The idea is to upload a picture as quickly as possible when movement is detected, while the clip is being recorded and uploaded. I tested MotionEye and loved it, however when movement is detected you have to wait for the clip to be finished and uploaded, I'm thinking on a situation where the hardware running this is tampered or disabled before the clip is uploaded. Uploading a picture should be faster. I'm willing to implementing this myself and wanted to ask recommendations to people more used to this repo. Where should I start looking?

ccrisan commented 5 years ago

I don't think you need to fork anything: you can use the "Run A Command" option to execute a command whenever motion is detected. That corresponds to on_event_start Motion option.

rodrigouroz commented 5 years ago

Ok, it's not clear to me which info I'll get in the command from that event by looking at the code, I'll give it a try. I guess I could grab a frame from the detected camera as soon as the command is called.

ccrisan commented 5 years ago

@rodrigouroz you might need to look at Motion as well. Grabbing the first frame might be more difficult than it sounds.