Web-based viewer/notifier for Hikvision FTP alerts

bubba123

Young grasshopper
Joined
Feb 5, 2015
Messages
47
Reaction score
13
I put this series of scripts together because I wasn't happy with the notification options on Zoneminder, nor was I happy with the default on-camera notifications options from Hikvision. I also couldn't get the iOS app and Push notifications working on Hik FW 5.1.6 (which I need because of more than 1 plane traversal option). I could probably have accomplished this with Blue Iris, but that'd also mean a high-CPU system running 24/7, instead I'm accomplishing something similar using on-camera motion detection (which is very good in my opinion), FTP upload and triggered recording to SMB. Below is my setup and the scripts; let me know if you have questions. I'm not a web-designer, hence the basic look, so feel free to clone the project and make this look nicer/add your own features:
  • Each camera should be configured to FTP images to a sub-directory in a common location. Some variation of motion detection should be enabled - this script handles notification suppression for sunrise/sunset and you can do per-camera time-based suppressions. Suppressed alerts will still be uploaded so they can be reviewed. Each camera is also configured to send email to my nvr user on my server (Raspberry Pi) an email upon an event happening.
  • My server (a Raspberry Pi) running VSFTPD, Samba, Apache, MySQL and Exim that performs all of this work. I have an external drive connected to my Rpi with a partition for each camera. Each partition has it's own Samba share on it for saving video events. A "nvr" user exists that can upload files via FTP and receive mail. A .procmailrc script exists to monitor incoming emails and trigger running of my script. You can forgo the email settings and procmail script and run my script via cron every 5-10 minutes, but this will mean you'll not know about an event "when it's happening". The procmail script sleeps for 30 seconds so FTP'ed images for the event will finish being received, so that's better than a 5-10 minute cronjob.

Benefits of using this:
  • Per-user authenticated review of event images on the web.
  • Per-user notification suppression (i.e. if something is going on and you want to ignore alerts for a period of time).
  • No exposing your camera to the Internet (unless you wish to do the camera NVR functions over the Internet).
  • Auto-suppression of events during sunrise/sunset with customized ignore times for each camera
  • [Add your own feature... :)]

The code and install docs are here: https://github.com/bdwilson/IPCamView I'll use this thread to provide assistance since the install isn't as straight-forward/polished as it could be. Hopefully others will find this useful.

Thanks,
Brian
 
Top