Frigate Substream mit Kamera für Detect

Hallo,

vielleicht kann mir jemand helfen? (Tapo Kamera, mit google coral)

Eigentlich geht alles, nur will ich meinen Server ein bissl schonen und will deshalb in Frigate den detect auf den Substream leiten

Meind code für die Camera ist:

go2rtc:
  streams:
    Kamera-EG-Eingang:
      - rtsp://xxx@icloud.com:xxxxx-xxxxx-peQtoh@192.168.xxx.xxx:554/stream1
      - ffmpeg:Kamera-EG-Eingang#audio=aac
    Kamera-EG-Eingang-Sub:
      - rtsp://xxx@icloud.com:xxxxx-xxxxx-peQtoh@192.168.xxx.xxx:554/stream2

und später in der config…

cameras:
  Kamera-EG-Eingang:
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/Kamera-EG-Eingang
          input_args: preset-rtsp-restream
          roles:
            - detect
            - record
    detect:
      enabled: true
....

soweit so gut… wenn ich jetzt den 2. stream ins Spiel bringe geht alles nichtmehr… Also:

cameras:
  Kamera-EG-Eingang:
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/Kamera-EG-Eingang
          input_args: preset-rtsp-restream
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/Kamera-EG-Eingang-Sub
          input_args: preset-rtsp-restream
          roles:
            - detect
    detect:
      enabled: true
....

Wenn ich jetzt neu starte geht nix mehr… hat jemand eine Idee?

Servus!

Kann dir nur meine config bereitstellen als Muster, und auch die Frames für die Cam zur bewegungserkennung runterdrehen :wink:

Ansonsten frag nur ich helfe dir soweit ich es kannm bzw. ich damit schon erfahrung habe-

ffmpeg:
  hwaccel_args: preset-vaapi

detectors:
  coral:
    type: edgetpu
    device: usb

snapshots:
  enabled: true
  retain:
    default: 7

cameras:
  garten:
    detect:
      width: 640
      height: 480
      fps: 5
    ffmpeg:
      inputs:
      - path: rtsp://dein stream   # <----- The stream you want to use for detection
        roles:
        - detect
      - path:rtsp://dein stream   # <----- The stream you want to use for record
        roles:
        - record
    motion:
      contour_area: 15
      threshold: 20
      mask:
      - 640,0,640,237,122,277,113,480,0,480,0,0
    record:
      enabled: true
      retain:
        days: 3
        mode: motion
      events:
        pre_capture: 5
        post_capture: 5
        retain:
          default: 7
          mode: motion

hm sorry hilft leider auch nicht, selbst wenn ich nur einen stream drin habe und die auflösung ändere bekomme ich frigate nicht mehr gebootet…

Wird der record Stream nur dann abgespeichert wenn im Detect was erkannt wird?

???

Verstehe die Frage nicht. Ich denke, ich definiere zwei Streams, der eine ist nur dafür da zu detektieren und der andere zum aufnehmen

Ja, einer detektiert, einer zeichnet auf.
Aber wann zeichnet der auf? Wenn was detektiert wird? Oder immer?
Also muss ich Platz für 24/7 einplanen oder nur für die Schnipsel wo auch wirklich was passiert?

Ich habe frigate schon im Einsatz, hatte mich bisher um sowas nicht gekümmert.

Aufgezeichnet wir mit der rolle record immer, nur ein clip wird bei detect abgelegt.

deshalb sollte man detect mit einem substream machen, da die rechenleistung runter geht…

Frigate’s detect pipeline can be configured to run on a substream instead of the full camera stream. This approach offers several advantages:

  1. Resource efficiency: Running object detection on a substream reduces the computational load and memory requirements, as only a smaller portion of the video feed needs to be processed.
  2. Improved performance: By limiting the pipeline to a substream, Frigate can focus its resources on a specific area of interest, leading to better detection accuracy and faster processing times.
  3. Customizable detection area: The substream allows you to define a specific region of the camera’s field of view (FOV) for object detection, enabling you to target specific areas or objects.

In meinem fall wird nur bei bewegung aufgezeichnet, egal was sich da bewegt. Die Maske dient dazu die Bäume/Sträucher auszulassen.

Ist jedenfalls immer Feintuning erforderlich :wink:

Kannst du die Streams über VLC aufrufen?

Hast du dir die LOGS von Frigate schon angesehen?

Ja der stream über vlc geht und die Logs bringen keinen Fehler wenn ich hochfahre mit dem 2. stream dann crasht alles

kannst du mal deine frigate config zur verfügung stellen?

Klar kann ich… das ist die funktionierende… habe insgesamt 8 gleiche Tapo C310 das Problem besteht bei allen …

mqtt:
  host: XXX.XXX.XXX.210
  port: 1883
  user: user
  password: pass
  topic_prefix: frigate

detectors:
  coral1:
    type: edgetpu
    device: usb:0
  coral2:
    type: edgetpu
    device: usb:1

birdseye:
  enabled: false
  mode: continuous

snapshots:
  enabled: true
  retain:
    default: 20

record:
  enabled: true
  retain:
    days: 14
    mode: all
  events:
    pre_capture: 1
    post_capture: 10
    objects:
      - person
      - dog
      - cat

objects:
  track:
    - person
    - dog
    - cat
    - car
  filters:
    person:
      min_score: 0.72

go2rtc:
  streams:
    Kamera-EG-Eingang:
      - rtsp://XXX@icloud.com:XXX@XXX.XXX.XXX243:554/stream1
      - ffmpeg:Kamera-EG-Eingang#audio=aac
    Kamera-EG-Eingang-Sub:
      - rtsp://XXX@icloud.com:XXX@XXX.XXX.XXX243:554/stream2
      - ffmpeg:Kamera-EG-Eingang-Sub#audio=aac

cameras:
  Kamera-EG-Eingang:
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/Kamera-EG-Eingang
          input_args: preset-rtsp-restream
          roles:
            - detect
            - record
    detect:
      enabled: true
      width: 1920
      height: 1080
    motion:
      mask:
        - 275,1080,0,1080,0,657,308,369,492,528
        - 762,37,779,181,1113,170,1920,192,1920,0,245,0
        - 1605,334,1920,1080,1391,1080,651,1080,639,1080,769,455
    objects:
      filters:
        car: {}
      mask: 0.401,0.007,0.416,0.191,0.995,0.171,1,0.006
    zones: {}

und bei der config geht nix mehr nach einem reboot

mqtt:
  host: XXX.XXX.XXX.210
  port: 1883
  user: user
  password: pass
  topic_prefix: frigate

detectors:
  coral1:
    type: edgetpu
    device: usb:0
  coral2:
    type: edgetpu
    device: usb:1

birdseye:
  enabled: false
  mode: continuous

snapshots:
  enabled: true
  retain:
    default: 20

record:
  enabled: true
  retain:
    days: 14
    mode: all
  events:
    pre_capture: 1
    post_capture: 10
    objects:
      - person
      - dog
      - cat

objects:
  track:
    - person
    - dog
    - cat
    - car
  filters:
    person:
      min_score: 0.72

go2rtc:
  streams:
    Kamera-EG-Eingang:
      - rtsp://XXX@icloud.com:XXX@XXX.XXX.XXX243:554/stream1
      - ffmpeg:Kamera-EG-Eingang#audio=aac
    Kamera-EG-Eingang-Sub:
      - rtsp://XXX@icloud.com:XXX@XXX.XXX.XXX243:554/stream2
      - ffmpeg:Kamera-EG-Eingang-Sub#audio=aac

cameras:
  Kamera-EG-Eingang:
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/Kamera-EG-Eingang
          input_args: preset-rtsp-restream
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/Kamera-EG-Eingang-Sub
          input_args: preset-rtsp-restream
          roles:
            - detect
    detect:
      enabled: true
      width: 1920
      height: 1080
    motion:
      mask:
        - 275,1080,0,1080,0,657,308,369,492,528
        - 762,37,779,181,1113,170,1920,192,1920,0,245,0
        - 1605,334,1920,1080,1391,1080,651,1080,639,1080,769,455
    objects:
      filters:
        car: {}
      mask: 0.401,0.007,0.416,0.191,0.995,0.171,1,0.006
    zones: {}

Danke, ich schau mir mal das ganze an, und melde mich sobald ich etwas gefunden habe, wird aber eher gegen morgen später abend sein :confounded: :+1:

Guten Morgen,
mal als Denkanstoß…
Wenn ich es richtig verstehe, deklarierst du doch mit go2rtc 2 streams.
Bei der funktinierenden yaml nutzt du dann einen der beiden als detect und record.
Müsste in der “neuen” yaml nicht ein anderer Aufbau her ?
zb:

go2rtc:
  streams:
      kamera1....:
      kamera2...:
(jetzt hast du doch eigentlich 2 kameras deklariert ?)
deshalb:
cameras:
  kamera1...:
     ffmpeg:
       inputs..:
       roles: detect
 #    ...
  kamera2
    inputs..:
       roles: record
   ....

Gefühlt deklarierst du in der nicht funtionierenden 2 Kameras, nutzt danach aber nur eine der beiden.

Oder hab ich den totalen Denkfehler ?

Ich bin mit meiner Tapo/Frigate ganz am Anfang und nutze es bis jetzt ohne go2rtc…
hier ein Auszug aus der yaml:

cameras:
  hof:
    ffmpeg:
      hwaccel_args: preset-vaapi
      inputs:
        - path: rtsp://XXXX:XXXXXX@192.168.XXX.XXX/stream1
          #input_args: -re -stream_loop -1 -fflags +genpts
          roles:
            - record
        - path: rtsp://XXXX:XXXXXX@192.168.XXX.XXX/stream2
          #input_args: -re -stream_loop -1 -fflags +genpts
          roles:
            - detect
    detect:
      height: 1440
      width: 2560
      fps: 5
    onvif:
      host: 192.168.XXX.XXX
      port: 2020
      user: XXX
      password: XXXXXX

Hoffe, das verwirrt nicht total

Grüße
Rolo

Ich hatte ähnliche Probleme. Habe dann in der frigate.yml den ganzen Pfad zu go2rtc weggelassen und die rtsp: Adressierung direkt in den Pfad unter cameras geschrieben.

cameras:
  Hof:  # <------ Name the camera
    mqtt:
      timestamp: false
      bounding_box: false
      crop: true
      quality: 100
      height: 480
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://***_sub # <----- The stream you want to use for detection
          roles:
            - detect
	- path: rtsp://***_main # <----- The stream you want to use for recording
          roles:
            - record

    detect:
      width: 640
      height: 480
      fps: 10
1 „Gefällt mir“

Bei detect reichen 5fps :wink:

und wenn es mit den zuvor gezeigten config nicht geht, dann hat es im system etwas, hier meine volle config die läuft als muster

bitte auf eure umgebung anpassen, fragen die ich noch dazu beantworten kann und hilfe dazu gerne - kann halt nicht immer sofort antworten :wink:

ffmpeg:
  hwaccel_args: preset-vaapi

detectors:
  coral:
    type: edgetpu
    device: usb

snapshots:
  enabled: true
  retain:
    default: 7

cameras:
  garten:
    detect:
      width: 640
      height: 480
      fps: 5
    ffmpeg:
      inputs:
      - path: rtsp://eurecam   # <----- The stream you want to use for detection
        roles:
        - detect
      - path: rtsp://eurecam4   # <----- The stream you want to use for record
        roles:
        - record
    motion:
      contour_area: 15
      threshold: 20
    record:
      enabled: true
      retain:
        days: 3
        mode: motion
      events:
        pre_capture: 5
        post_capture: 5
        retain:
          default: 7
          mode: motion
  kamin:
    detect:
      width: 640
      height: 480
      fps: 5
    ffmpeg:
      inputs:
      - path: rtsp://eurecam   # <----- The stream you want to use for detection
        roles:
        - detect
      - path: rtsp://eurecam   # <----- The stream you want to use for revord
        roles:
        - record
    motion:
      contour_area: 15
      threshold: 20
    record:
      enabled: true
      retain:
        days: 3
        mode: motion
      events:
        pre_capture: 5
        post_capture: 5
        retain:
          default: 7
          mode: motion


ein MUSS für das ist ->> Full Reference Config | Frigate

Kann nur dazu sagen lesen, lesen lesen - geht nicht anders, aber wenn durch dann läuft es :+1:

2 „Gefällt mir“

hey danke ich werde es am Wochende mal testen…

1 „Gefällt mir“

gib bescheid, check das log von frigate - und wie gesagt, ich helfe wo geht bei frigate :innocent: :fu:

so wie es aussieht klappt es so… ich werde mal2 Tage laufen lassen und schauen ob alles klappt…

schonmal danke vorab…

1 „Gefällt mir“