{"id":13585415,"url":"https://github.com/scottbarnesg/smart-sec-cam","last_synced_at":"2025-04-07T09:34:45.242Z","repository":{"id":36984004,"uuid":"472137305","full_name":"scottbarnesg/smart-sec-cam","owner":"scottbarnesg","description":"A privacy-focused, intelligent security camera system.","archived":false,"fork":false,"pushed_at":"2023-08-09T18:44:57.000Z","size":5732,"stargazers_count":216,"open_issues_count":13,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-08-02T16:00:24.006Z","etag":null,"topics":["camera","ip-camera","motion-detection","opencv","python","raspberry-pi","security-camera","self-hosted","video","webcam"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scottbarnesg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-21T00:25:18.000Z","updated_at":"2024-07-26T19:11:02.000Z","dependencies_parsed_at":"2023-01-17T11:15:38.863Z","dependency_job_id":null,"html_url":"https://github.com/scottbarnesg/smart-sec-cam","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottbarnesg%2Fsmart-sec-cam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottbarnesg%2Fsmart-sec-cam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottbarnesg%2Fsmart-sec-cam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottbarnesg%2Fsmart-sec-cam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottbarnesg","download_url":"https://codeload.github.com/scottbarnesg/smart-sec-cam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223277864,"owners_count":17118661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["camera","ip-camera","motion-detection","opencv","python","raspberry-pi","security-camera","self-hosted","video","webcam"],"created_at":"2024-08-01T15:04:55.826Z","updated_at":"2024-11-06T03:31:07.747Z","avatar_url":"https://github.com/scottbarnesg.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Self-Hosted Home Security Camera System\n\nA privacy-focused, intelligent security camera system.\n\n## Features:\n- Multi-camera support w/ minimal configuration. Supports USB cameras and the Raspberry Pi camera module.\n- Motion detection that automatically saves videos and lets you view them in the web app.\n- Encrypted in transit, both from the cameras to the server and the server to your browser.\n- Integrated authentication \n- Self-Hosted\n- Free and Open Source ([GPLv3](LICENSE))\n\n## Example screenshots\n\n#### Multiple live video feeds on a single UI:\n![](docs/Live_Video_Example.png)\n\n#### Replay of recorded videos triggered by motion detection:\n![](docs/Replay_Example.png)\n\n## Setup\n\nSec-cam-server is designed to be deployed flexibly. There are 2 core components:\n#### Camera: \nA device capable of capturing video and streaming to the server. Requirements:\n- Must be able to run Python\n- Must have a device capable of capturing video (e.g. a USB camera, webcam, or raspberry pi camera module)\n- Must be able to communicate to the server over a network. During setup, you will point the camera at the server's\nhostname or IP address.\n\n#### Server: \nThe server components aggregates feeds from the cameras, performs motion detection, and makes video available in a web\nUI via an API. The server can be a standalone host, or can run on one of your cameras (e.g. a Raspberry Pi). Requirements:\n- Must be able to run Docker.\n- Must be accessible to your camera(s) over a network.\n\n#### Example deployment configurations:\n\nExample 1: A standalone server, with the hostname `sec-cam-server.local`, and 2 cameras, with hostnames `camera1.local` and \n`camera2.local`.\n1. On `sec-cam-server.local`, follow the instructions in \"Setting up the server\". Replace `\u003cserver-hostname:server-port\u003e` with \n`sec-cam-server.local:8443`.\n2. On each camera, follow the instructions in \"Adding a camera\". In Step 3, `run.sh` should be updated to contain \n`--server_url sec-cam-server.local`.\n3. The web UI with camera feeds will be available at `https://sec-cam-server.local:8443`\n\nExample 2: 2 cameras  with hostnames `camera1.local` and `camera2.local`, with the \"server\" running `camera1.local`\n1. On `camera1.local`, follow the steps to install the server.\n2. On `camera1.local`, follow the steps to install the in \"Adding a camera\". In Step 3, `run.sh` should be updated to contain \n`--server_url localhost`.\n3. On `camera2.local`, follow the steps to install the in \"Adding a camera\". In Step 3, `run.sh` should be updated to contain \n`--server_url camera1.local`.\n4. The web UI with camera feeds will be available at `https://camera1.local:8443`\n\n### Setting up the server\n\n#### Docker:\n1. Install Docker following [the instructions on their website](https://docs.docker.com/engine/install/ubuntu/).\n2. Clone this repository\n3. Generate SSL certificates: `./create-certs.sh`. Alternatively, you may place your own certs in the `certs` dir\n4. Pull and run the docker containers: \n    ```bash\n    docker-compose pull\n    API_URL=\u003cserver-hostname:server-port\u003e docker-compose up -d\n    ```\nFor example, if the server was running on the host `sec-cam-server` and port `8443` (the default), you should use \n`API_URL=sec-cam-server:8443`.\n5. You should now be able to view the UI at `https://\u003cserver-hostname\u003e:8443`.\n6. Until a user is created, you will be automatically redirected to\n\n\n#### Configuration:\n\n##### Adding multiple users:\n\nBy default, user registration will be disabled once an initial user is created. To enable registration to add\nadditional users, update the environment variable `ENABLE_REGISTRATION` under the `server` service:\n\n```\n- ENABLE_REGISTRATION=1\n```\n\nWhen you're done adding users, you should re-set this value to `0` and restart the server.\n\n### Adding a camera\n\n#### Installation:\n\nNOTE: These instructions assume you are deploying to a Debian-based OS.\n\n1. Install the `python3-opencv` package and dependencies: `sudo apt-get install python3-opencv libatlas-base-dev`\n2. Clone this repository\n3. Install the package: `cd backend \u0026\u0026 python3 -m pip install .[streamer]`. If you are using the Raspberry Pi camera\nmodule, run `cd backend \u0026\u0026 python3 -m pip install .[streamer,picam]`.\n4. Update `--server_url` in `run.sh` to point at the host you deployed the server to.\n5. You can install the camera software as a systemd service or run it manually. Either:\n   1. Run the script to create the camera systemd service: `cd scripts \u0026\u0026 ./create-streamer-service.sh`\n   2. Run the camera manually: `./run.sh`.\n6. In the Web UI, you should see live video from that camera.\n\n## Contributors\n\n- @khlam for his help with Github Actions and building docker images\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottbarnesg%2Fsmart-sec-cam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottbarnesg%2Fsmart-sec-cam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottbarnesg%2Fsmart-sec-cam/lists"}