logger:
  logs:
    frigate.record.maintainer: debug
    # Für Tests optional:
    # frigate.motion: debug

mqtt:
  host: 192.168.150.150
  user: captica
  password: password
  topic_prefix: cctv
  stats_interval: 60

ffmpeg:
  # Intel iGPU (12th Gen) HW-Accel
  hwaccel_args: preset-vaapi

detectors:
  coral:
    type: edgetpu
    device: usb

detect:
  enabled: true


# --- Aufnahme / Speicherung ---
record:
  enabled: true
  retain:
    mode: all
    days: 7
  alerts:
    retain:
      days: 28
  detections:
    retain:
      days: 28

snapshots:
  enabled: true
  bounding_box: true
  timestamp: true
  crop: true             # auf Objekt zentrieren
  retain:
    default: 28

birdseye:
  enabled: true
  mode: continuous
  restream: true
  width: 1920
  height: 1080
  quality: 8

motion:
  # Optional: enables detection for the camera (default: True)
  # NOTE: Motion detection is required for object detection,
  #       setting this to False and leaving detect enabled
  #       will result in an error on startup.
  enabled: True
  # Optional: The threshold passed to cv2.threshold to determine if a pixel is different enough to be counted as motion. (default: shown below)
  # Increasing this value will make motion detection less sensitive and decreasing it will make motion detection more sensitive.
  # The value should be between 1 and 255.
  threshold: 30
  # Optional: The percentage of the image used to detect lightning or other substantial changes where motion detection
  #           needs to recalibrate. (default: shown below)
  # Increasing this value will make motion detection more likely to consider lightning or ir mode changes as valid motion.
  # Decreasing this value will make motion detection more likely to ignore large amounts of motion such as a person approaching
  # a doorbell camera.
  lightning_threshold: 0.8
  # Optional: Minimum size in pixels in the resized motion image that counts as motion (default: shown below)
  # Increasing this value will prevent smaller areas of motion from being detected. Decreasing will
  # make motion detection more sensitive to smaller moving objects.
  # As a rule of thumb:
  #  - 10 - high sensitivity
  #  - 30 - medium sensitivity
  #  - 50 - low sensitivity
  contour_area: 10

# --- Objekt-Tracking global ---
objects:
  track:
    - person
    - bicycle
    - car
    - motorcycle
    - cat
    - dog

go2rtc:
  rtsp:
    username: captica
    password: captica123!
  streams:
    facade_north:
      - rtsp://captica:{PASSWORD}@192.168.140.231:554/cam/realmonitor?channel=1&subtype=0#backchannel=0
      - ffmpeg:facade_north#video=h264#audio=acc
    facade_north_detect:
      - rtsp://captica:{PASSWORD}@192.168.140.231:554/cam/realmonitor?channel=1&subtype=2#backchannel=0
      #- ffmpeg:facade_north_detect#video=h264
    facade_garden:
      - rtsp://captica:{PASSWORD}@192.168.140.230:554/cam/realmonitor?channel=1&subtype=0#backchannel=0
      - ffmpeg:facade_garden#video=h264#audio=acc
    facade_garden_detect:
      - rtsp://captica:{PASSWORD}@192.168.140.230:554/cam/realmonitor?channel=1&subtype=2#backchannel=0
      #- ffmpeg:facade_garden_detect#video=h264
    facade_east:
      - rtsp://captica:{PASSWORD}@192.168.140.243:554/cam/realmonitor?channel=1&subtype=0#backchannel=0
      - ffmpeg:facade_east#video=h264#audio=acc
    facade_east_detect:
      - rtsp://captica:{PASSWORD}@192.168.140.243:554/cam/realmonitor?channel=1&subtype=2#backchannel=0
      #- ffmpeg:facade_east_detect#video=h264
    facade_south:
      - rtsp://captica:{PASSWORD}@192.168.140.232:554/cam/realmonitor?channel=1&subtype=0#backchannel=0
      #- ffmpeg:facade_south#video=h264#audio=acc
    facade_south_detect:
      - rtsp://captica:{PASSWORD}@192.168.140.232:554/cam/realmonitor?channel=1&subtype=2#backchannel=0
      #- ffmpeg:facade_south_detect#video=h264
    facade_west_2:
      - rtsp://captica:{PASSWORD}@192.168.140.233:554/cam/realmonitor?channel=1&subtype=0#backchannel=0
      - ffmpeg:facade_west_2#video=h264#audio=acc
    facade_west_2_detect:
      - rtsp://captica:{PASSWORD}@192.168.140.233:554/cam/realmonitor?channel=1&subtype=2#backchannel=0
      #- ffmpeg:facade_south_west_2_detect#video=h264
    facade_west:
      - rtsp://captica:{PASSWORD}@192.168.140.234:554/cam/realmonitor?channel=1&subtype=0#backchannel=0
      - ffmpeg:facade_west#video=h264#audio=acc
    facade_west_detect:
      - rtsp://captica:{PASSWORD}@192.168.140.234:554/cam/realmonitor?channel=1&subtype=2#backchannel=0
      #- ffmpeg:facade_west_detect#video=h264
    #facade_door:
    #  - rtsp://ghsvwl0002:capticaTest123@192.168.178.101:554/mpeg/720p/media.amp
    #  - ffmpeg:facade_door#video=h264  
    #bird:
    #  - rtsp://camadmin:1234nm,.@192.168.140.68:554/stream1#backchannel=0
    #  - ffmpeg:bird#audio=opus#video=h264
    #bird_detect:
    #  - rtsp://camadmin:1234nm,.@192.168.140.68:554/stream1#backchannel=0
    #  - ffmpeg:bird_detect#video=h264

# https://docs.frigate.video/configuration/ffmpeg_presets/
cameras:
  # --- Doorbird front door ---
  facade_door:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic
      inputs:
        - path: 
            rtsp://ghsvwl0002:capticaTest123@192.168.178.101:554/mpeg/720p/media.amp#backchannel=0
           #path: rtsp://127.0.0.1:8554/facade_door
           #path: rtsp://ghsvwl0002:capticaTest123@192.168.178.101:554/mpeg/720p/media.amp
          input_args: preset-rtsp-generic
          roles:
            - detect
            - record
    detect:
      width: 1280
      height: 720
      fps: 5

  # --- Front (Dahua IPC-4K Color) ---
  facade_north:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/facade_north
          input_args: preset-rtsp-restream
          roles: [record]
        - path: rtsp://127.0.0.1:8554/facade_north_detect
          input_args: preset-rtsp-restream
          roles: [detect]
    detect:
      width: 1280
      height: 720
      fps: 12

    # Personen „scharf“ zusätzlich pro Kamera (falls nötig, sonst global reicht)
    # objects:
    #   filters:
    #     person: {min_score: 0.42, threshold: 0.58}

  facade_garden:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/facade_garden
          input_args: preset-rtsp-restream
          roles: [record]
        - path: rtsp://127.0.0.1:8554/facade_garden_detect
          input_args: preset-rtsp-restream
          roles: [detect]
    objects:
      track: [person, cat, dog]
    detect:
      width: 1280
      height: 720
      fps: 12

  facade_east:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/facade_east
          input_args: preset-rtsp-restream
          roles: [record]
        - path: rtsp://127.0.0.1:8554/facade_east_detect
          input_args: preset-rtsp-restream
          roles: [detect]
    detect:
      width: 1280
      height: 720
      fps: 12

  facade_south:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/facade_south
          input_args: preset-rtsp-restream
          roles: [record]
        - path: rtsp://127.0.0.1:8554/facade_south_detect
          input_args: preset-rtsp-restream
          roles: [detect]
    detect:
      width: 1280
      height: 720
      fps: 12

  facade_west_2:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/facade_west_2
          input_args: preset-rtsp-restream
          roles: [record]
        - path: rtsp://127.0.0.1:8554/facade_west_2_detect
          input_args: preset-rtsp-restream
          roles: [detect]
    detect:
      width: 1280
      height: 720
      fps: 12

  facade_west:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/facade_west
          input_args: preset-rtsp-restream
          roles: [record]
        - path: rtsp://127.0.0.1:8554/facade_west_detect
          input_args: preset-rtsp-restream
          roles: [detect]
    detect:
      width: 1280
      height: 720
      fps: 12

version: 0.16-0

camera_groups:
  important:
    order: 2
    icon: LuSquare
    cameras: [facade_garden, facade_north, facade_west_2, facade_south, facade_west]
  door:
    order: 2
    icon: LuAlignHorizontalSpaceAround
    cameras: [facade_door]

semantic_search:
  enabled: false
  model_size: small

face_recognition:
  enabled: true
  model_size: large
  detection_threshold: 0.9

lpr:
  enabled: false

classification:
  bird:
    enabled: false
