Skip to content

Module 14 of 16 · 📖 4 min read · ⏱ 45 min total

FUTO 14 Frigate NVR (EN)

Table of contents (6 sections)
  1. Concepts and Background
  2. Architecture Diagram
  3. Practical Steps
  4. Common Pitfalls
  5. Further Resources
  6. Knowledge Check

FUTO 14 Frigate NVR

Frigate is a powerful, open-source NVR (Network Video Recorder) system that enables modern surveillance solutions with AI-based object detection. In this module, you will learn how to set up, configure, and integrate Frigate as a central facility for your cameras, and how to incorporate it into your existing IT infrastructure. You will gain the knowledge to precisely control motion detection, send notifications via MQTT, and optimally utilize hardware acceleration with Coral TPU.

Concepts and Background

Frigate NVR
An open-source surveillance system that records cameras via RTSP streams, detects motion, and stores recordings. It provides a web interface for configuration and viewing.
RTSP (Real Time Streaming Protocol)
A network protocol for controlling media streams between server and client. Frigate uses RTSP to receive video feeds from IP cameras.
MQTT (Message Queuing Telemetry Transport)
A lightweight Publish/Subscribe protocol that Frigate uses for notifications about detected objects. Ideal for integration with home automation systems.
Object Detection
An AI process that identifies and classifies objects in video images. Frigate uses pre-trained models like YOLO for this purpose.
Coral TPU
A USB-based accelerator from Google that performs AI calculations for object detection locally and energy-efficiently.

Architecture Diagram

flowchart LR
  A[IP Cameras] -->|RTSP| B[Frigate NVR]
  B -->|MQTT| C[Home Assistant]
  B -->|HTTP| D[Web Browser]
  B -->|H.264/H.265| E[NAS/Storage]
  F[Coral TPU] -->|USB| B

Practical Steps

  1. Install Frigate as a Docker container using the official image. This allows for clean separation and easy management.
  2. docker run -d \
      --name frigate \
      --restart=unless-stopped \
      -v /path/to/config:/config \
      -v /path/to/storage:/media/frigate \
      -v /dev/bus/usb:/dev/bus/usb \
      -p 5000:5000 \
      blakeblackshear/frigate:stable
  3. Configure your cameras in frigate.yml. Define each camera stream with RTSP URL, width, and height.
  4. cameras:
      camera_front:
        ffmpeg:
          input: rtsp://username:[email protected]:554/stream
        width: 1920
        height: 1080
  5. Set up MQTT for notifications. Configure server URL, port, and authentication in the configuration file.
  6. mqtt:
      host: mqtt-server.local
      port: 1883
      user: frigate
      password: secure_password
  7. Install and configure the Coral TPU driver to utilize hardware acceleration. This significantly reduces CPU load.
  8. apt update
    apt install -y curl
    curl -sSL https://coral.ai/downloads/usb-npu-driver | bash
    reboot
  9. Adapt the object detection models to your needs. Download specialized models to improve accuracy for specific objects.
  10. cd /config/models
    wget https://github.com/open-mmlab/mmdetection/raw/master/configs/yolo/yolov3_d53_320_273e_coco.py
    wget https://download.openmmlab.com/mmdetection/v2.0/yolo/yolov3_d53_320_273e_coco/yolov3_d53_320_273e_coco_20200629_200804-2bdf8fc0.pth

Common Pitfalls

Further Resources

Knowledge Check

Four questions for self-assessment. Click on each question to see the correct answer and explanation.

1. Which protocol does Frigate primarily use to receive video feeds from IP cameras?
  • A) HTTP
  • B) RTSP
  • C) MQTT
  • D) TCP

Correct Answer: B. Frigate uses RTSP (Real Time Streaming Protocol) to receive video streams from IP cameras. HTTP is used for the web interface, MQTT for notifications, and TCP is a basic transport protocol, not specific to video streams.

2. Which component enables Frigate to perform AI calculations for object detection locally and energy-efficiently?
  • A) GPU
  • B) Coral TPU
  • C) CPU
  • D) FPGA

Correct Answer: B. Coral TPU (Tensor Processing Unit) is a USB-based accelerator from Google that is specifically optimized for AI calculations. While GPUs can also perform AI calculations, the Coral TPU is more energy-efficient and cost-effective for this purpose, and it is explicitly mentioned in the module description.

3. What is the primary use of the MQTT protocol in Frigate?
  • A) For recording video streams
  • B) For controlling cameras
  • C) For notifications about detected objects
  • D) For system configuration

Correct Answer: C. MQTT is used in Frigate for notifications about detected objects, ideal for integration with home automation systems. Recording is done via RTSP, configuration via YAML files, and camera control is also done via RTSP.

4. Which Docker volume mount is necessary to use a Coral TPU with Frigate?
  • A) -v /path/to/config:/config
  • B) -v /path/to/storage:/media/frigate
  • C) -v /dev/bus/usb:/dev/bus/usb
  • D) -v /etc/localtime:/etc/localtime

Correct Answer: C. The volume mount -v /dev/bus/usb:/dev/bus/usb is necessary to make the Coral TPU device accessible to the Frigate container. The other mounts are for configuration files, storage, and timezone settings, but not specifically for the Coral TPU.