A privacy-focused, intelligent security camera system.

Overview

Self-Hosted Home Security Camera System

A privacy-focused, intelligent security camera system.

Features:

  • Multi-camera support w/ minimal configuration. Supports USB cameras and the Raspberry Pi camera module.
  • Motion detection that automatically saves videos and lets you view them in the web app.
  • Encrypted in transit, both from the cameras to the server and the server to your browser.
  • Self-Hosted
  • Free and Open Source

Example screenshots

Setting up the server

Docker:

  1. Clone this repository
  2. Generate SSL certificates: ./create-certs.sh. Alternatively, you may place your own certs in the certs dir
  3. Build and run the docker containers: API_URL=<server-hostname:server-port> docker-compose up -d --build. For example, if the API was running on the host sec-cam-server and port 8444, you should use API_URL=sec-cam-server:8444

Adding a camera

Installation:

NOTE: These instructions assume you are deploying to a raspberry pi running Raspbian OS.

  1. Install the python3-opencv package and dependencies: sudo apt-get install python3-opencv libatlas-base-dev
  2. Clone this repository
  3. Install the package: cd backend && python3 -m pip install .[streamer]. If you are using the Raspberry Pi camera module, run cd backend && python3 -m pip install .[streamer,picam].
  4. Update --server_url in run.sh to point at the host you deployed the server to.
  5. In the Web UI, you should see live video from that camera.
Comments
  • CORS error with self-signed certificates

    CORS error with self-signed certificates

    Some browsers like Firefox don't like cross-origin requests to URLs using self-signed certs even if you've already trusted certificate on the UI.

    Workaround:

    In the browser you're using, load an API endpoint (something like https://:8444/rooms) and go through the "this certificate can't be trusted" warning. Then, go back to the UI and refresh the page and see if its fixed.

    bug help wanted 
    opened by scottbarnesg 5
  • Run one system

    Run one system

    Can this be ran on all on one system with just a usb camera plugged in, and being able to serve the web user interface to localhost? Also, if so, would it all be in one container, or multiple? Thanks

    question 
    opened by neu-ma-tic 2
  • Add authentication

    Add authentication

    Currently, the UI is available to anyone with network access to the host. We need to develop or integrate an authentication solution to provide login capabilities.

    enhancement 
    opened by scottbarnesg 2
  • Fix CORS issue with self-signed certificates

    Fix CORS issue with self-signed certificates

    Changes:
    • Updates Flask server to serve React app.
    • Removes unused nginx config
    • Moves frontend container to an intermediate container in server
    • Updates default server port for both the UI and API to 8443
    Testing:
    • Check out this branch
    • Generate new (untrusted) certs: ./create-certs.sh
    • Start the server: docker-compose up -d --build
    • Open the Web UI in Firefox at https://localhost:8443. After clicking through the certificate warnings, open the debug console and verify there are no CORS errors.
    • Navigate to the videos page: https://localhost:8443/videos. Verify the videos load correctly and that there are no CORS errors in the debug console.

    Closes #16

    opened by scottbarnesg 1
  • Improve motion detection algorithm

    Improve motion detection algorithm

    Currently, the motion detection algorithm performs background subtraction on the incoming video frames to detection motion. This can cause "false positives", flagging motion that we don't care about (e.g. the wind blowing tree branches)

    This should be enhanced to identify more specific "objects of interest" (e.g. a person walking by).

    enhancement help wanted 
    opened by scottbarnesg 1
  • Run camera streamer code as a systemd service

    Run camera streamer code as a systemd service

    • Adds a base .service file for running streamer as a systemd service.
    • Adds create-streamer-service.sh to configure .service file for per-system installation.
    • Updates README.md with instructions on how to install streamer service under systemd.
    opened by scottbarnesg 0
  • Improve motion detection

    Improve motion detection

    Changes:

    • Replaces background-subtraction based motion detection with contour-based approach
    • Saved videos now have a box drawn around areas in which motion is detected
    • Adds --capture-delay argument to streamer.
    • Adds a size limit to the streamer's frame capture queue.

    Closes #5

    opened by scottbarnesg 0
  • Add authentication

    Add authentication

    Tasks:

    • [x] Implement authentication logic
    • [x] Add login endpoint
    • [x] Enforce authentication on endpoints
    • [x] Integrate authentication into UI
    • [x] Cache token as a cookie
    • [x] Add mechanism to create a user
    • [x] Add /api prefix to all API endpoints
    • [x] Validate token on every page
    • [x] Implement authentication for SocketIO
    • [x] Make Login and Registration pages look acceptable
    • [x] Update README

    Closes #4

    opened by scottbarnesg 0
  • Fix docker-compose build hanging with large video directory

    Fix docker-compose build hanging with large video directory

    Changes:

    • Adds .dockerignore w/ entry to ignore video data dir

    Testing:

    • Create data/videos and put lots of data into it.
    • Check out this branch and run docker-compose build server
    • Verify the command does not hang

    Fixes #20

    opened by scottbarnesg 0
  • Update image transmission to use a video stream

    Update image transmission to use a video stream

    References:

    • https://pericror.com/software/python-create-a-webrtc-video-stream-from-images/
    • https://github.com/aiortc/aiortc
    • https://pypi.org/project/av/
    enhancement 
    opened by scottbarnesg 0
  • Redesign the UI

    Redesign the UI

    The existing UI provides minimal functionality and needs an overhaul

    Key changes:

    • Update video stream page to allow clicking on stream to increase its size on the page. Possible reduce non-selected videos to side-bar.
    • Update the video replay page to make videos searchable by date, time, camera id, etc.
    enhancement help wanted 
    opened by scottbarnesg 0
Releases(0.3.6)
  • 0.3.6(Nov 19, 2022)

  • 0.3.5(Sep 11, 2022)

  • 0.3.4(Aug 11, 2022)

  • 0.3.3(Aug 3, 2022)

    • Updates UI to automatically refresh session token before it expires.
    • Automatically redirects the UI to the login page if token validation fails.
    Source code(tar.gz)
    Source code(zip)
  • 0.3.2(Jul 31, 2022)

    • Improves motion detection algorithm, replacing background subtraction with contour-based algorithm.
    • Recorded videos now have a box drawn around the area of motion detected.
    • Moves motion detection threshold value from input argument to environment variable
    Source code(tar.gz)
    Source code(zip)
  • 0.3.1(Jul 24, 2022)

  • 0.3.0(Jul 23, 2022)

  • 0.2.9(Jun 20, 2022)

  • 0.2.8(Jun 20, 2022)

  • 0.2.7(May 3, 2022)

  • 0.2.6(Apr 24, 2022)

  • 0.2.5.a(Apr 22, 2022)

  • 0.2.4(Apr 21, 2022)

  • 0.2.3(Mar 28, 2022)

    • Makes the motion detection threshold configurable via the cli
    • Fixes an issue that caused docker-compose to hang with a large video data directory
    Source code(tar.gz)
    Source code(zip)
  • 0.2.2(Mar 27, 2022)

    • Fixes an issue that caused CORS errors in some browsers when using self-signed certificates.
    • Updates the server configuration to serve both the Web UI and API from the Flask server.
    • Updates the default server listening port to 8443 for both the web app and API.
    Source code(tar.gz)
    Source code(zip)
  • 0.2.1(Mar 21, 2022)

    • Bug fixes for the motion detection algorithm.
    • Updates the list of saved videos to display in order w/ most recent first.
    • Adds support for dynamically setting the API url in the UI at runtime
    • Updates frontend docker container to Node v16
    Source code(tar.gz)
    Source code(zip)
Owner
Scott Barnes
Software Engineer
Scott Barnes
An adaptive hierarchical energy management strategy for hybrid electric vehicles

An adaptive hierarchical energy management strategy This project contains the source code of an adaptive hierarchical EMS combining heuristic equivale

19 Dec 13, 2022
A simple code to convert image format and channel as well as resizing and renaming multiple images.

Rename-Resize-and-convert-multiple-images A simple code to convert image format and channel as well as resizing and renaming multiple images. This cod

Happy N. Monday 3 Feb 15, 2022
a morph transfer UGATIT for image translation.

Morph-UGATIT a morph transfer UGATIT for image translation. Introduction 中文技术文档 This is Pytorch implementation of UGATIT, paper "U-GAT-IT: Unsupervise

55 Nov 14, 2022
Trading and Backtesting environment for training reinforcement learning agent or simple rule base algo.

TradingGym TradingGym is a toolkit for training and backtesting the reinforcement learning algorithms. This was inspired by OpenAI Gym and imitated th

Yvictor 1.1k Jan 02, 2023
Code for ICCV2021 paper SPEC: Seeing People in the Wild with an Estimated Camera

SPEC: Seeing People in the Wild with an Estimated Camera [ICCV 2021] SPEC: Seeing People in the Wild with an Estimated Camera, Muhammed Kocabas, Chun-

Muhammed Kocabas 187 Dec 26, 2022
Few-NERD: Not Only a Few-shot NER Dataset

Few-NERD: Not Only a Few-shot NER Dataset This is the source code of the ACL-IJCNLP 2021 paper: Few-NERD: A Few-shot Named Entity Recognition Dataset.

THUNLP 319 Dec 30, 2022
Pytorch implementation of MalConv

MalConv-Pytorch A Pytorch implementation of MalConv Desciprtion This is the implementation of MalConv proposed in Malware Detection by Eating a Whole

Alexander H. Liu 58 Oct 26, 2022
FairFuzz: AFL extension targeting rare branches

FairFuzz An AFL extension to increase code coverage by targeting rare branches. FairFuzz has a particular advantage on programs with highly nested str

Caroline Lemieux 222 Nov 16, 2022
Patch-Diffusion Code (AAAI2022)

Patch-Diffusion This is an official PyTorch implementation of "Patch Diffusion: A General Module for Face Manipulation Detection" in AAAI2022. Require

H 7 Nov 02, 2022
On the Analysis of French Phonetic Idiosyncrasies for Accent Recognition

On the Analysis of French Phonetic Idiosyncrasies for Accent Recognition With the spirit of reproducible research, this repository contains codes requ

0 Feb 24, 2022
Learning Time-Critical Responses for Interactive Character Control

Learning Time-Critical Responses for Interactive Character Control Abstract This code implements the paper Learning Time-Critical Responses for Intera

Movement Research Lab 227 Dec 31, 2022
Computational inteligence project on faces in the wild dataset

Table of Contents The general idea How these scripts work? Loading data Needed modules and global variables Parsing the arrays in dataset Extracting a

tooraj taraz 4 Oct 21, 2022
Automatic Idiomatic Expression Detection

IDentifier of Idiomatic Expressions via Semantic Compatibility (DISC) An Idiomatic identifier that detects the presence and span of idiomatic expressi

5 Jun 09, 2022
N-gram models- Unsmoothed, Laplace, Deleted Interpolation

N-gram models- Unsmoothed, Laplace, Deleted Interpolation

Ravika Nagpal 1 Jan 04, 2022
PyTorch Implementation of Region Similarity Representation Learning (ReSim)

ReSim This repository provides the PyTorch implementation of Region Similarity Representation Learning (ReSim) described in this paper: @Article{xiao2

Tete Xiao 74 Jan 03, 2023
Hand-distance-measurement-game - Hand Distance Measurement Game

Hand Distance Measurement Game This is program is made to calculate the distance

Priyansh 2 Jan 12, 2022
Code for the ICME 2021 paper "Exploring Driving-Aware Salient Object Detection via Knowledge Transfer"

TSOD Code for the ICME 2021 paper "Exploring Driving-Aware Salient Object Detection via Knowledge Transfer" Usage For training, open train_test, run p

Jinming Su 2 Dec 23, 2021
Code for the paper "There is no Double-Descent in Random Forests"

Code for the paper "There is no Double-Descent in Random Forests" This repository contains the code to run the experiments for our paper called "There

2 Jan 14, 2022
🏎️ Accelerate training and inference of 🤗 Transformers with easy to use hardware optimization tools

Hugging Face Optimum 🤗 Optimum is an extension of 🤗 Transformers, providing a set of performance optimization tools enabling maximum efficiency to t

Hugging Face 842 Dec 30, 2022
Implementation of "Debiasing Item-to-Item Recommendations With Small Annotated Datasets" (RecSys '20)

Debiasing Item-to-Item Recommendations With Small Annotated Datasets This is the code for our RecSys '20 paper. Other materials can be found here: Ful

Microsoft 34 Aug 10, 2022