Skip to content

Handles Ezviz camera motion events, stores event video to AWS S3 Cloud storage

Notifications You must be signed in to change notification settings

vicanis/camrec3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


EZViz surveillance camera free playback solution

About

I need a solution to store CCTV events somewhere in the cloud (preferably Amazon S3), to be able to download them later. All of the EZViz cameras has its own cloud service, but it is not suitable for me for some reasons:

  • I have to pay for that
  • The payment amount depends on the duration of the archived records
  • There is no subscription plan to store records older than 30-day
  • The subsription plan for maximum storage duration (30-day) has a crazy price of ~$100 per year

Solution details

  • There is a server that stores the RTSP stream (recorder app). The server has a backend application (processor) with REST API endpoint to return the event file by its timestamp.
  • I configured the EZViz application to send notification emails to the email address of my own domain name.
  • The notification email is processed with Amazon Simple Email Service:
    • Saves raw message to Amazon S3 bucket
    • Triggers Amazon Lambda function (mailhandler)
  • The mailhandler processes email:
    • Extract timestamp from the email body
    • Creates a Amazon DynamoDB record that contains email ID, event timestamp and processing flag (is false)
  • There is another Amazon Lambda function (eventprocessor) that is triggered by Amazon EventBridge every minute:
    • Get unprocessed events from the DynamoDB table with timestamp less than 2 minutes ago:
      • Fetch event video file from the backend server
      • Store it in the S3 bucket
      • Update processed flag, set file path in the DynamoDB record
  • I built a simple dashboard application to view all videos for a specific date

Live demo:

Netlify Status

https://camera.fbuzz.pro

Quality Gate Status

Tech stack

Camera backend (recorder, processor):

  • Go
  • ffmpeg
  • gorilla/mux

Amazon Lambda functions:

  • Go

Dashboard application:

  • NextJS
  • React
  • Typescript
  • Tailwind CSS
  • Deployed on the Netlify

Configuration

Prerequisites

  1. Domain name ownership with DNS hosting feature
  2. Amazon Web Services account
  3. A Linux server to process RTSP stream and upload event videos to the cloud. I use Raspberry Pi 3B+ for this purpose.
    1. Docker installation
    2. Nginx

Configuration procedure

  1. Enable email notifications
  2. Setup Amazon Route 53
  3. Setup Amazon Simple Email Service
  4. Setup Amazon S3
  5. Setup Amazon Lambda
  6. Setup Amazon DynamoDB
  7. Setup processor server
  8. Deploy camera dashboard

Enable email notifications

Configure camera settings in the EZViz application to send motion event notifications via E-Mail. Motion event messages will start arriving in the inbox.

Message example:

Setup Amazon Route 53, Amazon Simple Email Service

Add appropriate MX records to the domain name.

Configure Amazon Simple Email Service to receive incoming emails to your domain name and store raw messages into the Amazon S3 bucket.

Configure email address in the EZViz application to send emails to your domain address.

About

Handles Ezviz camera motion events, stores event video to AWS S3 Cloud storage

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published