pynvr - Python NVR (Network Video Recorder) based on OpenCV.
Source can be found here: https://github.com/JFF-Bohdan/pynvrGeneral information
pynvr can interract with cameras using OpenCV
(supports many types of connection including connection to USB cameras
and network cameras using RTSP, for example)
Captured video stream must be analysed for motion and then saved to files according to specific rules.
When motion detected (or rule triggered) not only video after start must be saved but some frames before (pre-alarm/pre-event frames) must be saved to output file.