Frigate NVR with GPU Object Detection
Purpose
Frigate NVR is a local, private video surveillance system with real-time AI object detection. It ingests camera streams, runs machine learning models to detect people, vehicles, and animals, and records only what matters. Everything stays local with no cloud dependency or external account required. There’s no subscription fee behind it either.
Deployment
Frigate runs as a single Docker container on the GPU Docker host alongside other compute-heavy services.
| Item | Value |
|---|---|
| Host | GPU Docker host (NVIDIA GPU) |
| Image | ghcr.io/blakeblackshear/frigate:stable-tensorrt |
| Deployment | Docker Compose, managed locally |
| Logs | Vector → Graylog, same path as other Docker hosts |
The stable-tensorrt variant enables TensorRT-based object detection on the NVIDIA GPU — the detector and decoder both run on hardware acceleration.
flowchart LR
C[PoE Cameras] -->|RTSP| go2rtc[go2rtc restreamer]
go2rtc -->|stream| decode[GPU Decoder NVDEC]
decode --> detect[TensorRT Detector]
detect -->|"detected objects"| recording[Recording Engine]
recording --> snapshots[Snapshots and Clips]
recording --> events[Events]
events -->|MQTT| mqtt[(Mosquitto)]
mqtt -->|"triggers"| ha[Home Assistant]
ha --> notify[Notifications]
Camera streams arrive via RTSP through the built-in go2rtc restreamer, which handles protocol conversion and reconnections. Each frame passes through the GPU-accelerated video decoder (NVDEC), then into the TensorRT detector configured with a large YOLO model for detection accuracy.
Detection
The TensorRT detector runs on the NVIDIA GPU using compiled inference models. A large YOLO model is configured — it trades some framerate for better accuracy and small-object detection compared to tiny or small variants. The GPU handles both decoding and inference, minimizing CPU overhead for what would otherwise be a compute-bound workload.
Frigate detects people, vehicles, animals, and other categories depending on the model and configuration. Detected objects trigger events that feed into recording retention and downstream automations.
Recording
Recording is event-only — the system does not write continuous video streams. When the detector identifies something worth keeping, Frigate saves a clip with configurable pre- and post-event padding. This approach keeps storage manageable while preserving useful footage: you get the thing that happened without hours of empty hallway.
Retention runs at approximately 30 days. Clips older than that are pruned automatically, so disk usage stays bounded without manual intervention.
Home Assistant Integration
Frigate is integrated with Home Assistant via MQTT events published to Mosquitto. When Frigate detects an object — a person entering a frame, a vehicle in the driveway — it publishes the event as an MQTT message. Home Assistant’s built-in Frigate integration subscribes to those events and exposes them as triggers for automations.
A typical flow: detector sees a person → Frigate publishes MQTT event → Home Assistant automation fires → notification on phone with snapshot attached. The same pipeline drives state changes and conditional logic without exposing cameras or credentials beyond the homelab network.
See Home Assistant and Mosquitto MQTT for details on those pieces.
Notes
Frigate works best when decoder and detector share the same GPU — separating them introduces PCIe bus latency that eats into available FPS. The TensorRT image includes everything needed; no sidecar or companion container is required for detection or hardware decode.
The Docker Compose configuration mounts a dedicated directory for recordings and snapshots. That path should live on fast storage since write speed during a detection event determines whether you keep the clip or lose it to a full buffer.