docker.recipes

Frigate NVR

intermediate

AI-powered network video recorder with real-time object detection using OpenCV and TensorFlow.

Overview

Frigate NVR is an open-source network video recorder built specifically for real-time object detection and intelligent video surveillance. Developed by Blake Blackshear, Frigate leverages OpenCV and TensorFlow Lite to analyze video streams from IP cameras, detecting people, vehicles, and other objects with remarkable accuracy. Unlike traditional NVR solutions that simply record footage, Frigate processes video feeds in real-time, creating smart alerts, maintaining object tracking histories, and reducing storage requirements through intelligent recording triggers. This Docker configuration establishes a complete AI-powered surveillance system that processes multiple camera feeds simultaneously while maintaining low system overhead. Frigate's architecture separates object detection processing from video recording, using a sophisticated caching system with tmpfs for high-performance frame analysis. The system supports hardware acceleration through Google Coral TPU devices, Intel QuickSync, and GPU processing, dramatically improving detection speed and reducing CPU usage compared to software-only solutions. Home automation enthusiasts, small business owners, and privacy-conscious users who want professional-grade surveillance without cloud dependencies will find this stack invaluable. Frigate integrates natively with Home Assistant, supports MQTT messaging for automation triggers, and provides comprehensive APIs for custom integrations. The combination of local processing, intelligent detection algorithms, and extensive customization options makes this an ideal solution for users who need more than basic motion detection but want to maintain complete control over their surveillance data.

Key Features

  • Real-time object detection using TensorFlow Lite models with support for person, vehicle, and custom object recognition
  • Hardware acceleration support for Google Coral TPU, Intel QuickSync, and NVIDIA/AMD GPU processing
  • Intelligent recording system that saves clips based on object detection events rather than continuous recording
  • Live RTSP stream rebroadcasting with configurable quality settings and multiple concurrent viewer support
  • Advanced motion mask configuration with pixel-level precision for eliminating false positive detection zones
  • Native Home Assistant integration with automatic device discovery and entity creation
  • Comprehensive REST API and MQTT messaging for custom automation and third-party integrations
  • Multi-camera management with individual detection zones, recording settings, and alert configurations

Common Use Cases

  • 1Home security monitoring with intelligent person and vehicle detection to reduce false alarms from wildlife or weather
  • 2Small business surveillance systems requiring 24/7 monitoring with automated incident detection and recording
  • 3Home Assistant automation triggers based on specific object detection events like package deliveries or visitor arrivals
  • 4Privacy-focused surveillance installations where footage must remain on-premises without cloud storage dependencies
  • 5Multi-property monitoring for landlords or property managers needing centralized camera management
  • 6Agricultural monitoring for livestock tracking and perimeter security with customizable detection zones
  • 7Integration with existing IP camera infrastructure to add AI capabilities without replacing hardware

Prerequisites

  • Minimum 4GB RAM with additional 2GB recommended for each concurrent camera stream being processed
  • IP cameras supporting RTSP streams with H.264 encoding (H.265/HEVC supported with hardware acceleration)
  • Port 5000 available for web interface access and ports 8554-8555 for RTSP and WebRTC streaming
  • Basic understanding of YAML configuration for camera setup and detection zone definitions
  • Docker host with privileged container support for hardware device access and optimal performance
  • Optional: Google Coral TPU device or compatible GPU for hardware-accelerated object detection processing

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 frigate:
3 image: ghcr.io/blakeblackshear/frigate:stable
4 container_name: frigate
5 restart: unless-stopped
6 privileged: true
7 shm_size: 256mb
8 devices:
9 - /dev/bus/usb:/dev/bus/usb # USB Coral TPU (optional)
10 # - /dev/apex_0:/dev/apex_0 # PCIe Coral TPU (optional)
11 # - /dev/dri/renderD128:/dev/dri/renderD128 # Intel GPU (optional)
12 volumes:
13 - ./config:/config
14 - ./media:/media/frigate
15 - type: tmpfs
16 target: /tmp/cache
17 tmpfs:
18 size: 1000000000
19 ports:
20 - "5000:5000" # Web UI
21 - "8554:8554" # RTSP feeds
22 - "8555:8555/tcp" # WebRTC over TCP
23 - "8555:8555/udp" # WebRTC over UDP
24 environment:
25 - FRIGATE_RTSP_PASSWORD=${RTSP_PASSWORD:-changeme}
26
27volumes:
28 frigate_config:
29 frigate_media:

.env Template

.env
1# Frigate Configuration
2RTSP_PASSWORD=changeme
3
4# Create config/config.yml with your camera settings:
5# mqtt:
6# enabled: false
7# cameras:
8# front_door:
9# ffmpeg:
10# inputs:
11# - path: rtsp://user:pass@camera-ip:554/stream
12# roles:
13# - detect
14# - record
15# detect:
16# width: 1280
17# height: 720
18# fps: 5

Usage Notes

  1. 1Access web UI at http://localhost:5000
  2. 2Create config/config.yml with your camera configuration
  3. 3Optional: Add Coral TPU for faster AI detection
  4. 4RTSP streams available at rtsp://localhost:8554/camera_name
  5. 5Supports hardware acceleration with Intel/AMD/NVIDIA GPUs

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 frigate:
5 image: ghcr.io/blakeblackshear/frigate:stable
6 container_name: frigate
7 restart: unless-stopped
8 privileged: true
9 shm_size: 256mb
10 devices:
11 - /dev/bus/usb:/dev/bus/usb # USB Coral TPU (optional)
12 # - /dev/apex_0:/dev/apex_0 # PCIe Coral TPU (optional)
13 # - /dev/dri/renderD128:/dev/dri/renderD128 # Intel GPU (optional)
14 volumes:
15 - ./config:/config
16 - ./media:/media/frigate
17 - type: tmpfs
18 target: /tmp/cache
19 tmpfs:
20 size: 1000000000
21 ports:
22 - "5000:5000" # Web UI
23 - "8554:8554" # RTSP feeds
24 - "8555:8555/tcp" # WebRTC over TCP
25 - "8555:8555/udp" # WebRTC over UDP
26 environment:
27 - FRIGATE_RTSP_PASSWORD=${RTSP_PASSWORD:-changeme}
28
29volumes:
30 frigate_config:
31 frigate_media:
32EOF
33
34# 2. Create the .env file
35cat > .env << 'EOF'
36# Frigate Configuration
37RTSP_PASSWORD=changeme
38
39# Create config/config.yml with your camera settings:
40# mqtt:
41# enabled: false
42# cameras:
43# front_door:
44# ffmpeg:
45# inputs:
46# - path: rtsp://user:pass@camera-ip:554/stream
47# roles:
48# - detect
49# - record
50# detect:
51# width: 1280
52# height: 720
53# fps: 5
54EOF
55
56# 3. Start the services
57docker compose up -d
58
59# 4. View logs
60docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/frigate-nvr/run | bash

Troubleshooting

  • Camera stream shows 'No frames received' error: Verify RTSP URL format and camera authentication credentials in config.yml
  • High CPU usage during detection: Enable hardware acceleration with Coral TPU or configure GPU support in the devices section
  • Web interface returns 500 errors: Check config.yml syntax using YAML validator and ensure all required camera parameters are defined
  • Object detection not triggering recordings: Adjust detection sensitivity thresholds and verify motion mask configurations aren't blocking detection zones
  • RTSP restreaming fails with connection refused: Ensure camera streams are accessible from Docker container network and firewall allows port 8554
  • Coral TPU not detected after container restart: Verify USB device permissions and check that /dev/bus/usb is properly mounted in the container

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space