cyb3rdoc/onenvr
OneNVR - One Network Video Recorder for All Your Cameras
167
This is a simple and lightweight Network Video Recorder (NVR) that is designed to run on cheap hardware, such as a Raspberry Pi with a hard drive. 24/7 video streams from network cameras are saved. Recorded files can be browsed through native web interface (http://onenvr_ip:port).
The project is deliberately bare-bones, configuration is done through config.yaml
file and deployed using docker containerization.
The camera video streams are saved in 5 minute files (to prevent long periods of video loss should a file become corrupted). At 02:00 UTC, the video files for the previous day are concatenated into a single 24 hour file, and the 5 minute video files are deleted. The concatenation is performed in a way to prevent disk I/O exhaustion and impact on ongoing recording. At 01:00 UTC, the video files older than 7 days are deleted. With local timezone environment variable, the concatenation and deletion tasks will be performed at local time 02:00 and 01:00 respectively. Period of retention, concatenation and deletion times can be configured with config.yaml
file.
ffmpeg
is used to connect to the camera streams and save the video feeds. Recording will restart automatically in case of unexpected interruption.
TZ=America/New_York
environment variable in docker run
command or docker-compose.yml
file to have filenames in local timezone of New York.interval: 300
to desired value in seconds (minimum 60) in config.yaml
file. (Optional)ffmpeg
can be used (E.g., libx264) instead of default (and recommended) codec: copy
however this will depend on hardware capabilities and increase processing strain for system.retention_days: 7
to your desired days in config.yaml
file. (Optional)concatenation: false
in config.yaml
file. (Optional)concatenation_time: "02:00"
to desired time. (Optional)deletion_time: "01:00"
to desired time. (Optional)rtsp://user:password@camera-ip/live/stream_01
docker logs onenvr
. For detailed logs, use docker environment variable DEBUG=true
in docker run
command or docker-compose.yml
file.Clone the repo to build your own image.
TIMESTAMP="$(date '+%Y%m%d-%H%M')"
docker build -t "${USER?}/onenvr:${TIMESTAMP}" .
Run onenvr docker container:
docker run -d --name onenvr -p 80:5000 -v /path/to/onenvr/config:/config -v /path/to/onenvr/storage:/storage your_username/onenvr:YYYYMMDD-HHMM
Mount following volumes to update camera settings and access or backup stored video files.
You can also use prebuilt image cyb3rdoc/onenvr:latest with docker-compose.yml.
services:
onenvr:
container_name: onenvr
hostname: onenvr
image: cyb3rdoc/onenvr:latest
ports:
- "80:5000"
environment:
- TZ=America/New_York
- DEBUG=false
volumes:
- /path/to/onenvr/config:/config
- /path/to/onenvr/storage:/storage
restart: unless-stopped
Logs can be accessed with docker logs onenvr
. For detailed logs, use docker environment variable DEBUG=true
in docker run
command or docker-compose.yml
file.
docker pull cyb3rdoc/onenvr