Frigate Systemauslastung (mit Coral Stick)

Da mein Lüfter in meinem NAS sehr empfindlich auf CPU Last reagiert und sofort hochdreht sobald diese sich erhöht, habe ich hörbar mitbekommen, dass ich nach der Installation von frigate eine deutliche Mehrauslastung meiner CPU habe wie vorher. Ich nutze zusätzlich den Google Coral Stick.
Habe ich irgendwo etwas falsch eingerichtet oder ist die Mehrlast so normal?

Frigate gestoppt:


Frigate läuft:


Ich kann die Leistung des Nas nicht beurteilen - meine beelink Mini S12pro CPU ist mit drei frigate cams und coral aber auch bei 25%.

Dürfte also passen.
Frigate braucht trotz coral auch weiterhin die CPU

Moin,

welches?
Ist der Google Coral TPU Stick auch korrekt an frigate eingerichtet, auch da wie ist das alles eingerichtet, als

  • Docker?
  • VM?
  • in HA als Add-on, wie ist HA eingerichtet?

Wie ist die Last, wenn der Googel Coral Stick nicht eingesteckt ist, wenn sich da an der Auslastung nichts verändert, würde ich sagen, der Stick ist nicht korrekt eingerichtet, angebunden.

Also etwas mehr Information zu deinem System und der Konfiguration, wäre schön.

VG
Bernd

Also der Stick ist eingesteckt, als USB 3 Stick erkannt und auch so an die HA VM weitergeleitet, die Ihn auch richtig erkennt. Man sieht ja bei dem Screenshot des Statistik Fensters, dass er mit dem Stick arbeitet.

NAS: UGREEN DXP4800 Plus
OS: Unraid
HA als VM auf Basis von Home Assistent OS

Mal unabhängig von Deinem NAS: Ja ist sie. Der Coral ist bei Frigate in erste Linie für die Objekterkennung zuständig und wird dafür genutzt. Alles andere muss weiterhin die CPU von dem Host-System leisten. D.h. eine Verzweifachung, oder ggf. auch Verdreifachung der CPU-Last kann durchaus normal sein (Edit: Oder auch noch mehr, je nach Anzahl der genutzen Kameras). Ebenso der dann damit einhergehende höhere Stromverbrauch von dem Host-System.

VG Jim

Moin,

ja, aber man sieht halt nicht wie er in frigate konfiguriert ist und ob die Last durch Frigate kommt oder einfach nur Grundrauschen ist, was Dir Unraid anzeigt.

Auch diese Seite ist interessant

What does Frigate use the CPU for and what does it use a detector for? (ELI5 Version)

This is taken from a user question on reddit. Modified slightly for clarity.

CPU Usage: I am a CPU, Mendel is a Google Coral

My buddy Mendel and I have been tasked with keeping the neighbor’s red footed booby off my parent’s yard. Now I’m really bad at identifying birds. It takes me forever, but my buddy Mendel is incredible at it.

Mendel however, struggles at pretty much anything else. So we make an agreement. I wait till I see something that moves, and snap a picture of it for Mendel. I then show him the picture and he tells me what it is. Most of the time it isn’t anything. But eventually I see some movement and Mendel tells me it is the Booby. Score!

What happens when I increase the resolution of my camera?

However we realize that there is a problem. There is still booby poop all over the yard. How could we miss that! I’ve been watching all day! My parents check the window and realize its dirty and a bit small to see the entire yard so they clean it and put a bigger one in there. Now there is so much more to see! However I now have a much bigger area to scan for movement and have to work a lot harder! Even my buddy Mendel has to work harder, as now the pictures have a lot more detail in them that he has to look at to see if it is our sneaky booby.

Basically - When you increase the resolution and/or the frame rate of the stream there is now significantly more data for the CPU to parse. That takes additional computing power. The Google Coral is really good at doing object detection, but it doesn’t have time to look everywhere all the time (especially when there are many windows to check). To balance it, Frigate uses the CPU to look for movement, then sends those frames to the Coral to do object detection. This allows the Coral to be available to a large number of cameras and not overload it.

Do hwaccel args help if I am using a Coral?

YES! The Coral does not help with decoding video streams.

Decompressing video streams takes a significant amount of CPU power. Video compression uses key frames (also known as I-frames) to send a full frame in the video stream. The following frames only include the difference from the key frame, and the CPU has to compile each frame by merging the differences with the key frame. More detailed explanation. Higher resolutions and frame rates mean more processing power is needed to decode the video stream, so try and set them on the camera to avoid unnecessary decoding work.

VG
Bernd

P.S.: bin dann aber auch hier raus, da ich Frigate und TPU nicht nutze.

Ich gehe mal ganz stark davon aus das @Laire das

detectors:
  coral:
    type: edgetpu
    device: usb

in den Frigate-Konfig. mit aufgenommen hat, denn das ist nun wirklich Basiswissen wenn man einen Coral mit Frigate nutzen will. :slightly_smiling_face:

VG Jim

Moin,

ja, das tue ich auch, aber liebere nachfragen und die Konfiguration sehen, als zu spekulieren, was, wer, wie, gemacht hat.

Hier stand noch mehr, aber ich will den Thread nicht missbrauchen.

VG
Bernd

# Für MQTT nutze ich das Mosquitto Add-On
# Benutzer anlegen nicht vergessen!
mqtt:
  enabled: true
  host: core-mosquitto
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: frigate
  password: ***
  stats_interval: 30

database:
  path: /config/frigate.db

detectors:
  coral:
    type: edgetpu
    device: usb

birdseye:
  enabled: true
  restream: true
  mode: continuous

objects:
  track:
    - car
    - person
  filters:
    person:
      min_score: 0.6
      min_area: 20000
    car:
      min_score: 0.6
      min_area: 30000

# Kann auf Kamera-Level überschrieben werden
detect:
  width: 640
  height: 480
  # 5 FPS ist der optimale Wert - am besten direkt im Stream festlegen
  fps: 10

# Kann auf Kamera-Level überschrieben werden
record:
  enabled: true
  alerts:
    retain:
      days: 7
    pre_capture: 5
    post_capture: 5
  detections:
    retain:
      days: 7
    pre_capture: 5
    post_capture: 5
snapshots:
  enabled: true
  clean_copy: true
  timestamp: false
  bounding_box: true
  retain:
    default: 14
    objects:
      person: 28

go2rtc:
  streams:
    einfahrt:
      - rtsp://Laire:***@192.168.3.200/Preview_01_main
    einfahrt_sub:
      - rtsp://Laire:***@192.168.3.200/Preview_01_sub
    huehner:
      - rtsp://Laire:***@192.168.3.201/h264Preview_01_main
    huehner_sub:
      - rtsp://Laire:***@192.168.3.201/h264Preview_01_sub
    tuer:
      - rtsp://admin:***@192.168.3.202/Preview_01_main
    tuer_sub:
      - rtsp://admin:***@192.168.3.202/Preview_01_sub

cameras:
  cam_einfahrt:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/einfahrt
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/einfahrt_sub
          roles:
            - detect
    detect:
      enabled: true
    birdseye:
      order: 0
    motion:
      mask: 0.805,0.999,0.998,0.996,0.999,0.803,0.901,0.903
  cam_huehner:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/huehner
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/huehner_sub
          roles:
            - detect
    objects:
      track:
        - person
        - bird
    detect:
      enabled: true
      width: 640
      height: 360
    birdseye:
      order: 1
    motion:
      mask: 0.279,0.129,1,0.843,1,0,0.274,0
  cam_tuer:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/tuer
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/tuer_sub
          roles:
            - detect
    detect:
      enabled: true
    birdseye:
      order: 2

ui:
  timezone: Europe/Berlin
  time_format: 24hour
  strftime_fmt: '%d.%m.%Y- %H:%M'
version: 0.15-1

Das wahr bar mir auch so bis ich alle Kameras optimiert hatte.
Bezüglich fps und bitrate der Kameras von main und sub stream .
Also in den Einstellungen der Kameras !

Grundsätzlich erhöht sich die CPU last auch.
Ich liege jetzt bei 6 Kameras bei ca. 20 bis 35 % Auslastung bei Coral und CPU.
HA als VM Proxmox mit Addon Frigate

Aufzeichnen nur bei motion.

Weil es gerade passt: Ein Bild sagt manchmal bekanntlich mehr als tausend Worte. :slightly_smiling_face:

Am 02.05. habe ich bei mir unter HA eine Dual Lense Kamera und somit 4 weitere Live-Streams hinzugefügt. Für beide Objektive nutze ich dann die folgenden, identischen Einstellungen:

Dadurch hat sich die CPU-Last unter HA bei mir um ca. 10 % erhöht.

Anm.: Ich nutze kein Frigate und auch keinen Coral. Aber ein Coral hätte daran auch nichts geändert. Alle meine Kameras sind per HA Onvif Integration eingebunden.

VG Jim