Skip to content

frigate

Frigate

A complete and local NVR designed for Home Assistant with AI object detection. Uses OpenCV and Tensorflow to perform realtime object detection locally for IP cameras.

Am not currently running the optimized setup for this, but testing things out.

# frigate - https://docs.frigate.video/frigate/installation/
---
version: "3.9"
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: ghcr.io/blakeblackshear/frigate:stable
    shm_size: "64mb" # update for your cameras based on calculation above
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /app/frigate/config:/config
      - /mnt/store/app/frigate:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD: "password"

requires to set a config.yml in the /config volume.

My current config

mqtt:
  enabled: false
cameras:
  front:
    birdseye:
      order: 1
    ffmpeg:
      inputs:
        - path: rtsp://USERNAME:PASSWORD@IPADDR:554/path_to_stream
          roles:
            - detect
            - record
    objects:
      track:
        - person
    detect:
      width: 1920
      height: 1080

    record:
      sync_recordings: True
      enabled: True
      retain:
        days: 7
        mode: motion
      events:
        # Optional: Number of seconds before the event to include (default: shown below)
        pre_capture: 5
        # Optional: Number of seconds after the event to include (default: shown below)
        post_capture: 5

detectors:
    cpu1:
      type: cpu
      num_threads: 3

# Include all cameras by default in Birdseye view
birdseye:
  enabled: True
  mode: continuous
  width: 1280
  height: 720
  quality: 8
  inactivity_threshold: 30

For nginx proxy - add this to advanced options for proxy host

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;
proxy_request_buffering off;