Frigate integration!

Good evening @lmilcent and @guim31

Let’s start with a bit of context: I host Gladys and Frigate on a Rock64 (ROCK64 - PINE64), which is a rather basic CPU backed by 4GB of memory. For Gladys, it « does the job. » For Frigate, on the other hand, it seems rather compromised. Here is the load status when Frigate is in « detection » mode:

image

Additionally, Frigate doesn’t detect anything, and that’s where I wonder if my Frigate configuration is correct. The instructions for installing and configuring the integration are very precise (but I admit they are a bit complex for a beginner), however, I followed Claude’s basic instructions to configure a test camera…

I’ll start by trying to find a Coral USB, configure it, and reduce the CPU load before going any further…

Have a nice evening,

Jean

How many cameras do you have? What resolutions?

One thing is certain, the Coral will greatly relieve your CPU!!
It’s still important, especially since you already have Gladys on it, which suffers from this high load during Frigate detections

If it can help you, here is my Frigate config, on a server without a TPU.

The trick is to perform detection on a lower quality image and on a limited number of images per second. I didn’t invent anything, Claude did it for me.

The relevant extract:

    detect:
      enabled: true            # object detection enabled by default
      width: 1536
      height: 864
      fps: 5

Full config:

# Managed by Ansible — frigate role
# Documentation: https://docs.frigate.video/configuration/

mqtt:
  enabled: true
  host: IP_GLADYS_HERE
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: gladys
  password: REMOVED

# Hardware acceleration for my CPU which is an Intel UHD 770 iGPU (i5-13500T)
ffmpeg:
  hwaccel_args: preset-intel-qsv-h264
  output_args:
    record: preset-record-generic-audio-aac

# Object detector
# https://docs.frigate.video/configuration/object_detectors
detectors:
  ov:
    type: openvino
    device: GPU   # Intel iGPU via OpenVINO

# Detection model (required for OpenVINO) — SSDLite MobileNet v2 provided
# in the image at /openvino-model (fast, lightweight).
model:
  width: 300
  height: 300
  input_tensor: nhwc
  input_pixel_format: bgr
  path: /openvino-model/ssdlite_mobilenet_v2.xml
  labelmap_path: /openvino-model/coco_91cl_bkgr.txt

# Go2rtc — restream of camera streams (My cameras are Raspberry Pi)
go2rtc:
  streams:
    pi3-cam: rtsp://10.15.10.155:8554/cam

# Recording — Frigate 0.16+ scheme
# https://docs.frigate.video/configuration/record
record:
  enabled: true
  # Continuous recording (0 = disabled, only keeps motion/alerts)
  continuous:
    days: 0
  # Motion-triggered recording
  motion:
    days: 30
  # Retention of segments related to alerts/object detections
  alerts:
    retain:
      days: 30
      mode: motion
  detections:
    retain:
      days: 30
      mode: motion

# Global motion detection
motion:
  threshold: 30
  improve_contrast: true

# Globally tracked objects — limits detection and feeds MQTT state topics per object: frigate/<cam>/<object> (ON/OFF) + frigate/<cam>/<object>/snapshot
objects:
  track:
    - person


# Cameras
cameras:
  pi3-cam:
    ffmpeg:
      inputs:
        - path: rtsp://10.15.10.155:8554/cam
          roles: [detect, record]
    detect:
      enabled: true            # object detection enabled by default
      width: 1536
      height: 864
      fps: 5
    # Motion mask: excludes the OSD area (date/time/hostname engraved
    # on the side of MediaMTX) — otherwise the scrolling text triggers motion + detection.
    # Normalized coordinates 0-1, polygon "x1,y1,x2,y2,...".
    motion:
      mask:
        - 0,0,0.33,0,0.33,0.07,0,0.07
    record:
      enabled: true
    snapshots:
      enabled: true
      timestamp: true          # timestamp engraved on snapshots
      bounding_box: true
      retain:
        default: 30
  
version: 0.17-0

For a camera in front of the entrance with not too much movement: