A multi-camera CCTV surveillance system based on Raspberry Pi. Designed with a client-server architecture, it enables multiple RPi clients to capture video footage and transmit it to a central server for management and storage.
- Build a cost-effective CCTV system
- Manage distributed camera nodes
- Centralized video storage and management
- Client (Raspberry Pi)
- Captures video using the Raspberry Pi Camera
- Records video in 2-minute segments
- temporarily stores videos locally use RAM disk to minimize SD card wear
- Server (Ubuntu)
- Collects video files from multiple RPi clients via SSH and rsync
- Uses multithreading to handle multiple clients concurrently
- Uses a SSH config file for easy host management
- Organizes videos by host and date
- Provides a foundation for future video management features
rpi-cctv/
├── README.md # Project documentation
├── Client/ # Raspberry Pi client
│ ├── setup.sh # Client setup script
│ ├── record.sh # Video recording script
│ └── rpi-cctv-client.service # systemd service file
└── Server/ # Central server
├── setup.sh # Server setup script
├── config.yaml # Configuration file with host aliases
├── collect_cctv.py # Main video collection script
├── rpi-cctv-server.service # systemd service file
└── rpi-cctv-server.timer # systemd timer for scheduled collection
- Hardware: Raspberry Pi 4B
- RAM: 2GB
- Storage: 16GB microSD card
- Camera: Raspberry Pi Camera v2
- OS: Raspberry Pi OS (Bookworm)
- OS: Ubuntu 24.04.3 LTS
- CPU: Intel(R) Celeron(R) J4005 CPU @ 2.00GHz
- RAM: 4GB
sudo ./Client/setup.shThis system uses Host Alias instead of IP addresses. You need to configure the ~/.ssh/config file.
also, edit the Server/config.yaml file to add your host aliases. this file generated automatically when you run the setup script.
sudo ./Server/setup.sh-
Client Side
sudo systemctl status rpi-cctv-client
sudo journalctl -u rpi-cctv-client -f
sudo systemctl restart rpi-cctv-client
-
Server Side
sudo systemctl status rpi-cctv-server.service
sudo journalctl -u rpi-cctv-server.service -f
sudo systemctl restart rpi-cctv-server.service
sudo systemctl status rpi-cctv-server.timer
MIT License