A custom NVR (Network Video Recorder) solution based on Frigate, featuring object detection, tracking, and recording capabilities. This project includes custom branding, Docker deployment, and optimized configuration for production use.
- Object Detection: YOLOv8-based detection with ONNX runtime
- Object Tracking: Multi-object tracking with configurable methods
- Video Recording: Automatic event-based recording with retention policies
- Web Interface: Modern React-based web UI with custom branding
- Docker Deployment: Easy deployment with Docker Compose
- Cross-Platform: Works on Windows, Linux, and macOS
- Real-time Processing: Live camera feeds and real-time detection
Prerequisites:
- Docker Desktop installed and running
- At least 4GB RAM available for Docker
1. Start Docker Desktop (if not already running)
2. Build the frontend:
cd web
npm install
npm run build:local
cd ..3. Start Fusion Nvr:
docker compose up -d4. Access the web interface:
- Open your browser and navigate to:
http://localhost:5001 - The web interface will show "Fusion Nvr" with custom branding
5. Stop Fusion Nvr:
docker compose downFor Python 3.11+ (Latest):
setup-python-env.batFor Python 3.10 (Compatible):
setup-python310-env.batRun Fusion Nvr:
# For Python 3.11+
.\run-frigate-python.bat
# For Python 3.10
run-frigate-python310.bat1. Create Virtual Environment:
python -m venv venv
venv\Scripts\activate.bat2. Install Dependencies:
# Install PyTorch (CPU version)
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
# Install DeepOCSORT and tracking packages
pip install git+https://github.com/GerardMaggiolino/Deep-OC-SORT.git
pip install torchreid lap cython-bbox
# Install Frigate requirements
pip install -r requirements-python.txt3. Run Frigate:
python -m frigatefrigate/
βββ frigate/ # Main application code
βββ web/ # React web interface (frontend)
β βββ src/ # React source code
β βββ dist/ # Built frontend (generated)
β βββ images/ # Custom logo and images
βββ config/ # Configuration files
β βββ config.yml # Main configuration file
βββ input/ # Video input files
βββ docker-compose.yml # Docker Compose configuration
βββ requirements-python.txt # Python dependencies
βββ setup-python-env.bat # Python 3.11+ setup script
βββ setup-python310-env.bat # Python 3.10 setup script
βββ run-frigate-python.bat # Run Fusion Nvr (Python 3.11+)
βββ run-frigate-python310.bat # Run Fusion Nvr (Python 3.10)
Edit config/config.yml to configure cameras, detection, and recording:
# MQTT (optional, disabled by default)
mqtt:
enabled: false
# Global model configuration
model:
model_type: yolo-generic
width: 640
height: 640
input_tensor: nchw
input_dtype: float
input_pixel_format: bgr
path: "/config/yolo8n.onnx" # Path to YOLOv8 ONNX model
# Detectors
detectors:
onnx:
type: onnx
device: AUTO # AUTO, CPU, or GPU (if available)
# Cameras
cameras:
test_camera:
ffmpeg:
inputs:
- path: input/test_video.mp4
roles:
- detect
- record
detect:
width: 1280
height: 720
fps: 5
record:
enabled: true
events:
retain:
default: 30
mode: motion
objects:
person: 30
live:
height: 720
quality: 8
# Object tracking
track:
enabled: true
max_disappeared: 30
max_distance: 50YOLOv8 Model:
- Export YOLOv8 to ONNX format:
from ultralytics import YOLO model = YOLO("yolov8n.pt") model.export(format="onnx", imgsz=[640, 640], opset=20, dynamic=True, dynamo=True)
- Place the exported
yolov8n.onnxfile in theconfig/directory - Update the
model.pathinconfig.ymlto point to the model file
The docker-compose.yml file includes:
- Volume mounts for config, recordings, and web interface
- Named volumes for database and model cache (avoids Windows filesystem issues)
- Port mappings for web UI (5001), API (5000), and RTSP (8554, 8555)
- Environment variables for timezone and RTSP password
- Docker Desktop: Latest version
- RAM: 4GB minimum, 8GB recommended for Docker
- Storage: 10GB free space
- OS: Windows 10/11, Linux, macOS
- Python: 3.10 or 3.11+ (3.11+ recommended)
- RAM: 4GB minimum, 8GB recommended
- Storage: 10GB free space
- OS: Windows 10/11, Linux, macOS
- PyTorch: 2.1.0+ (CPU version)
- OpenCV: 4.8.0+
- NumPy: 1.24.0+
- ONNX Runtime: 1.15.0+
- Frigate: Latest version
1. Docker Desktop not running:
- Ensure Docker Desktop is started before running
docker compose up -d - Check Docker Desktop status in system tray
2. Port already in use:
- Change ports in
docker-compose.ymlif 5000, 5001, or 8554 are in use - Check for other services using these ports
3. Web interface shows old images:
- Rebuild the frontend:
cd web && npm run build:local && cd .. - Restart Docker:
docker compose down && docker compose up -d - Clear browser cache (Ctrl+Shift+R)
4. Database I/O errors:
- The Docker setup uses named volumes to avoid Windows filesystem issues
- If issues persist, check Docker volume permissions
5. Model not found:
- Ensure
yolo8n.onnxis in theconfig/directory - Check the
model.pathinconfig.ymlmatches the file location
1. Missing packages:
pip install -r requirements-python.txt2. NumPy compatibility issues:
pip install "numpy<2.0"3. ONNX Runtime installation:
pip install onnxruntime>=1.15.04. PyTorch installation fails:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpuFor Python 3.10:
- Use
setup-python310-env.bat - May need older package versions
For Python 3.11+:
- Use
setup-python-env.bat - Full feature support
- Frigate: Official Documentation
- YOLOv8: Ultralytics Documentation
- Docker: Docker Documentation
- ONNX Runtime: ONNX Runtime Documentation
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Frigate Team: For the excellent NVR software foundation
- Ultralytics: For YOLOv8 object detection models
- ONNX Runtime Team: For the efficient inference engine
- React Community: For the web framework
- Docker Team: For containerization platform
If you encounter issues:
- Check the Troubleshooting section
- Search existing Issues
- Create a new issue with detailed information
- Join the community discussions
- Replace
web/images/logo.pngwith your custom logo (recommended: 512x512px PNG) - Rebuild the frontend:
cd web && npm run build:local && cd .. - Restart Docker:
docker compose down && docker compose up -d
- Update translation files in
web/public/locales/en/(replace "Fusion Nvr" with your name) - Update
web/site.webmanifestwith your application name - Rebuild the frontend and restart Docker
Happy Monitoring! π―