Frigate NVR
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:stable4 container_name: frigate5 restart: unless-stopped6 privileged: true7 shm_size: 256mb8 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:/config14 - ./media:/media/frigate15 - type: tmpfs16 target: /tmp/cache17 tmpfs: 18 size: 100000000019 ports: 20 - "5000:5000" # Web UI21 - "8554:8554" # RTSP feeds22 - "8555:8555/tcp" # WebRTC over TCP23 - "8555:8555/udp" # WebRTC over UDP24 environment: 25 - FRIGATE_RTSP_PASSWORD=${RTSP_PASSWORD:-changeme}2627volumes: 28 frigate_config: 29 frigate_media: .env Template
.env
1# Frigate Configuration2RTSP_PASSWORD=changeme34# Create config/config.yml with your camera settings:5# mqtt:6# enabled: false7# cameras:8# front_door:9# ffmpeg:10# inputs:11# - path: rtsp://user:pass@camera-ip:554/stream12# roles:13# - detect14# - record15# detect:16# width: 128017# height: 72018# fps: 5Usage Notes
- 1Access web UI at http://localhost:5000
- 2Create config/config.yml with your camera configuration
- 3Optional: Add Coral TPU for faster AI detection
- 4RTSP streams available at rtsp://localhost:8554/camera_name
- 5Supports hardware acceleration with Intel/AMD/NVIDIA GPUs
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 frigate:5 image: ghcr.io/blakeblackshear/frigate:stable6 container_name: frigate7 restart: unless-stopped8 privileged: true9 shm_size: 256mb10 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:/config16 - ./media:/media/frigate17 - type: tmpfs18 target: /tmp/cache19 tmpfs:20 size: 100000000021 ports:22 - "5000:5000" # Web UI23 - "8554:8554" # RTSP feeds24 - "8555:8555/tcp" # WebRTC over TCP25 - "8555:8555/udp" # WebRTC over UDP26 environment:27 - FRIGATE_RTSP_PASSWORD=${RTSP_PASSWORD:-changeme}2829volumes:30 frigate_config:31 frigate_media:32EOF3334# 2. Create the .env file35cat > .env << 'EOF'36# Frigate Configuration37RTSP_PASSWORD=changeme3839# Create config/config.yml with your camera settings:40# mqtt:41# enabled: false42# cameras:43# front_door:44# ffmpeg:45# inputs:46# - path: rtsp://user:pass@camera-ip:554/stream47# roles:48# - detect49# - record50# detect:51# width: 128052# height: 72053# fps: 554EOF5556# 3. Start the services57docker compose up -d5859# 4. View logs60docker compose logs -fOne-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 | bashTroubleshooting
- 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
Components
frigate
Tags
#frigate#nvr#camera#ai#object-detection#surveillance
Category
Home Lab & Self-HostingAd Space
Shortcuts: C CopyF FavoriteD Download