Ga naar inhoud

📹 Frigate NVR

Frigate is een open-source NVR met AI-gebaseerde object detectie via Google Coral.

Algemene Info

Item Waarde
Type LXC Container op Proxmox
IP Adres 192.168.1.15
VLAN 1 (Management)
Poort 5000
URL http://192.168.1.15:5000
RTSP Poort 8554
Status 🔧 Op te zetten

Hardware

Component Specificatie
AI Accelerator Google Coral USB TPU
Opslag 2TB externe HDD (via TP-Link UH720)
RAM 3GB toegewezen

Functies

  • ✅ AI Object Detectie - Personen, auto's, dieren herkennen
  • ✅ 24/7 Recording - Continue opname
  • ✅ Event Clips - Alleen beweging opslaan
  • ✅ RTSP Re-stream - Efficiënt stream delen
  • ✅ MQTT Events - Integratie met Home Assistant
  • ✅ Zones - Specifieke gebieden monitoren
  • ✅ Snapshots - Afbeeldingen bij detectie

Camera Configuratie

config.yml

mqtt:
  host: 192.168.20.11
  port: 1883
  user: mqtt_user
  password: mqtt_password

detectors:
  coral:
    type: edgetpu
    device: usb

database:
  path: /media/frigate/frigate.db

record:
  enabled: true
  retain:
    days: 7
    mode: all
  events:
    retain:
      default: 14
      mode: motion

snapshots:
  enabled: true
  retain:
    default: 14

cameras:
  voordeur:
    ffmpeg:
      inputs:
        - path: rtsp://user:pass@192.168.30.10:554/stream1
          roles:
            - detect
            - record
    detect:
      width: 1920
      height: 1080
      fps: 5
    objects:
      track:
        - person
        - car
        - dog
        - cat
    zones:
      voortuin:
        coordinates: 0,1080,400,1080,400,600,0,600

  achtertuin:
    ffmpeg:
      inputs:
        - path: rtsp://user:pass@192.168.30.11:554/stream1
          roles:
            - detect
            - record
    detect:
      width: 1920
      height: 1080
      fps: 5
    objects:
      track:
        - person
        - cat

  schuur:
    ffmpeg:
      inputs:
        - path: rtsp://user:pass@192.168.30.12:554/stream1
          roles:
            - detect
            - record
    detect:
      width: 1920
      height: 1080
      fps: 5

Zones Configureren

Zones beperken detectie tot specifieke gebieden om false positives te verminderen.

Zone Maken

  1. Open Frigate UI (http://192.168.1.15:5000)
  2. Klik op camera
  3. Klik op tandwiel → Zones
  4. Teken polygon op beeld
  5. Kopieer coördinaten naar config.yml

Zone Regels

zones:
  oprit:
    coordinates: 100,500,300,500,300,200,100,200
    objects:
      - car
    filters:
      car:
        min_area: 5000

Netwerk & Firewall

Vereiste Firewall Regel

Frigate (VLAN 1) moet bij camera's (VLAN 30):

Setting Waarde
Name Allow Frigate to Cameras
Source 192.168.1.15
Destination VLAN 30
Port 554 (RTSP), 80 (HTTP)
Action Allow

Speciale regel nodig voor deurbel in IoT VLAN:

Setting Waarde
Name Allow Frigate to Doorbell
Source 192.168.1.15
Destination Deurbel IP (VLAN 20)
Port 554
Action Allow

MQTT Events

Frigate publiceert events naar MQTT:

Topics

Topic Inhoud
frigate/events Alle detectie events
frigate/+/person Persoon per camera
frigate/+/car Auto per camera
frigate/available Online status

Event Voorbeeld

{
  "type": "new",
  "after": {
    "id": "1234567890.123456-abcdef",
    "camera": "voordeur",
    "label": "person",
    "score": 0.89,
    "box": [100, 200, 300, 400],
    "thumbnail": "/api/events/1234567890.123456-abcdef/thumbnail.jpg"
  }
}

Home Assistant Integratie

Via HACS

  1. Installeer HACS
  2. HACS → Integrations → Frigate
  3. Add Integration → Frigate
  4. URL: http://192.168.1.15:5000

Sensors & Entities

Na integratie beschikbaar: - camera.voordeur - Live stream - binary_sensor.voordeur_person - Persoon detectie - sensor.voordeur_person_count - Aantal personen - image.voordeur_person - Laatste snapshot

Opslag Beheer

Retentie Aanpassen

record:
  retain:
    days: 7      # Alle opnames
  events:
    retain:
      default: 14  # Events langer bewaren

Schijfruimte Monitoren

# In Frigate container
df -h /media/frigate

Handmatig Opruimen

# Oude recordings verwijderen
find /media/frigate/recordings -mtime +7 -delete

Troubleshooting

Camera niet bereikbaar

Symptomen

  • "Camera unavailable"
  • Zwart beeld

Oplossing:

  1. Test RTSP stream:

    ffprobe rtsp://user:pass@192.168.30.10:554/stream1
    

  2. Check firewall regel

  3. Ping camera:
    ping 192.168.30.10
    

Coral niet gedetecteerd

Symptomen

  • "EdgeTPU not found"
  • Detectie werkt niet

Oplossing:

  1. Check USB passthrough in LXC config:

    lxc.cgroup2.devices.allow: c 189:* rwm
    lxc.mount.entry: /dev/bus/usb dev/bus/usb none bind,optional,create=dir
    

  2. Herstart container

  3. Check Coral:
    lsusb | grep Google
    

Hoge CPU gebruik

Optimalisaties:

  1. Verlaag detect FPS:

    detect:
      fps: 3  # Was 5
    

  2. Verlaag resolutie:

    detect:
      width: 1280  # Was 1920
      height: 720  # Was 1080
    

  3. Gebruik hardware decoding (indien beschikbaar)

Recordings vullen schijf

  1. Check retentie settings
  2. Verminder aantal dagen
  3. Schakel continue recording uit, alleen events:
    record:
      retain:
        mode: motion  # In plaats van 'all'
    

Docker Command

docker run -d --name frigate \
  --restart unless-stopped \
  --privileged \
  -p 5000:5000 \
  -p 8554:8554 \
  -v /opt/frigate/config:/config \
  -v /media/frigate:/media/frigate \
  -v /dev/bus/usb:/dev/bus/usb \
  --shm-size=256m \
  ghcr.io/blakeblackshear/frigate:stable

Gerelateerd