scottlamb / moonfire-nvr

Moonfire NVR, a security camera network video recorder
Other
1.19k stars 138 forks source link

Enhancement/Design: Push/Pull? #220

Closed jlpoolen closed 2 years ago

jlpoolen commented 2 years ago

Push/Pull For new Content?

For a robust surveillance system, I had in mind that there should be the four areas:

1) Moonfire-nvr: full preservation of camera output,

2) Motion: a module which determine if an event warrants attentions, e.g. motion (See Issue #28 and Issue #29.)

3) AI: and artificial intelligence ("AI") module that detects what objects are found, e.g. person, car, cat, rat

4) Messaging: an alarm/messaging system based on results from AI, the logical intelligence component

Moonfire-nvr accomplishes well the preservation component; it is the foundation. And the Web interface is great to be able to extract snippets once you have decided what the start and stop times should be. I'm still looking into the motion and AI and currently I am focused on the AI component since it requires complex hardware to handle the intensive computational AI requires. Motion could be further broken down into two components: the camera's motion output and after-processing motion detection with software such as The Motion Project.

I think it would be desirable to have Moonfire-nvr be able to advertise or stream/push new content it receives. An alternative is to have the separate processes ping Moonfire-nvr to keep abreast of new events. The latter seems to be a "pull" concept, and the former a "push" concept. The push model seems easier, just offer a fire hose output, i.e. an rtsp server?, that lets other modules connect with. But offering a fire hose of data burdens the system's input/output with all these streams. I'm starting to see why gstreamer's paradigm of stream pipeline is a desirable architecture. A plugin model seems desirable.

I'm finding that I have Reolink's software determine events and save snippets, usually 15-30 seconds MP4 files in a directory. During rain, I can accumulate over 800 files for 11 cameras in a period of 6 hours. I currently use the output of Reolink as organized in a directory and exposed through Windows Explorer to be a first-look manifest of events. If I see files saved from adjacent cameras around the same time, then I know something triggered Moonfire's motion detection and I use Window's explorer with a module that displays a preview image of a particular frame of a selected file to show me quickly what is in the scene of that file.

I just wanted to get the concept "push" and "pull" in relation to Moonfire-nvr documented and see what Scott thinks. But, it's something that is going to have to be considered as further development evolves.

jlpoolen commented 2 years ago

Addendum: For Windows users, the K-lite package is invaluable for managing videos files through Windows Explorer.

K-Lite Codec Pack or K-Lite Mega Codec Pack 2022-04-21_07-00-16

CodecTweakTool_2022-04-21_06-59-27

CodecTweakTool_2022-04-21_07-02-40