mqtt:
  enabled: true
  host: 192.168.1.210
  port: 1890

detectors:
  #coral:
    #type: edgetpu
    #device: usb
  cpu1:
    type: cpu
    num_threads: 3
    #model:
      #path: "/custom_model.tflite"
  cpu2:
    type: cpu
    num_threads: 3
  cpu3:
    type: cpu
    num_threads: 3
  cpu4:
    type: cpu
    num_threads: 3

database:
  path: /config/frigate.db

audio:
  enabled: false
  max_not_heard: 30
  min_volume: 500
  listen:
    - bark
    - fire_alarm
    - scream
    - speech
    - yell
  filters:
    speech:
      threshold: 0.8

logger:
  default: warning
  logs:
    frigate.event: info
    #ffmpeg: critical
    detect: info

birdseye:
  enabled: true
  restream: false
  width: 2304
  height: 1296
  quality: 1
  mode: continuous
  inactivity_threshold: 15
  layout:
    scaling_factor: 1.0

ffmpeg:
  hwaccel_args: preset-vaapi
  input_args: preset-rtsp-restream
  output_args:
    record: preset-record-generic-audio-copy
  retry_interval: 20

detect:
  enabled: true
  width: 640
  height: 360
  fps: 10
  min_initialized: 2
  max_disappeared: 25
  stationary:
    interval: 50
    threshold: 50
  annotation_offset: 0

motion:
  threshold: 30
  lightning_threshold: 0.8
  contour_area: 10
  improve_contrast: true

record:
  enabled: true
  expire_interval: 60
  sync_recordings: true
  retain:
    days: 0.5
    mode: motion
  export:
    #timelapse_args: "-vf setpts=0.04*PTS -r 30"
    # DESC: Time-lapse speed set to x60 (for fitting 1 hour (x60) of recording into 1 minute of time-lapse) with 25 FPS
    timelapse_args: -vf setpts=PTS/60 -r 25
  events:
    pre_capture: 5
    post_capture: 10
    objects:
      - person
      - cat
      - dog
      - car
      - license_plate
      - dayplate
      - nightplate
    required_zones: []
    retain:
      default: 0.5
      mode: active_objects
      objects:
        person: 0.5
        car: 0.5
        license_plate: 1
        dayplate: 1
        nightplate: 1
#record:
  #enabled: true
  #expire_interval: 60
  #sync_recordings: true
  #retain:
    #days: 0.25
    #mode: all
  #export:
    #timelapse_args: "-vf setpts=0.04*PTS -r 30"
  #events:
    #pre_capture: 5
    #post_capture: 10
    #objects:
      #- person
    #required_zones: []
    #retain:
      #default: 1
      #mode: motion
      #objects:
        #person: 0.5
        #car: 0.5

snapshots:
  enabled: true
  clean_copy: true
  timestamp: true
  bounding_box: true
  crop: false
  height: 720
  retain:
    default: 0.25
    objects:
      person: 0.5
      car: 0.5
      license_plate: 7
      dayplate: 7
      nightplate: 7
  quality: 100

timestamp_style:
  position: tr
  format: '%d.%m.%Y %H:%M:%S'
  color:
    red: 255
    green: 255
    blue: 255
  thickness: 2
  effect: shadow

ui:
  live_mode: mse
  use_experimental: false
  time_format: browser
  date_style: short
  time_style: medium
  strftime_fmt: '%d/%m/%Y %H:%M'

go2rtc:
  streams:
    go2rtc_Eingang:
      #- tapo://admin:7AA7D570BB74FB56E7B3BFD406B5146EDAFD62AB5E5708ADA0F3382514EDC344@192.168.1.48
      - rtsp://iobroker:ixijannik@192.168.1.48/stream1
      - "ffmpeg:go2rtc_Eingang#audio=opus"
      - "ffmpeg:go2rtc_Eingang#audio=aac"
      #go2rtc_Eingang_SUB:
      #- rtsp://iobroker:ixijannik@192.168.1.48/stream2
      #- "ffmpeg:go2rtc_EingangSUB#audio=acc"
    go2rtc_Sued-Ost:
      #- tapo://admin:7AA7D570BB74FB56E7B3BFD406B5146EDAFD62AB5E5708ADA0F3382514EDC344@192.168.1.85
      - rtsp://iobroker:ixijannik@192.168.1.85/stream1
      - "ffmpeg:go2rtc_Sued-Ost#audio=opus"
      - "ffmpeg:go2rtc_Sied-Ost#audio=aac"
    go2rtc_Katzen-Korb:
      #- tapo://admin:7AA7D570BB74FB56E7B3BFD406B5146EDAFD62AB5E5708ADA0F3382514EDC344@192.168.1.86
      - rtsp://iobroker:ixijannik@192.168.1.86/stream1
      - "ffmpeg:go2rtc_Katzen-Korb#audio=opus"
      - "ffmpeg:go2rtc_Katzen-Korb#audio=aac"
    go2rtc_Katzen-Schrank:
      #- tapo://admin:7AA7D570BB74FB56E7B3BFD406B5146EDAFD62AB5E5708ADA0F3382514EDC344@192.168.1.75
      - rtsp://iobroker:ixijannik@192.168.1.75/stream1 
      - "ffmpeg:go2rtc_Katzen-Schrank#audio=opus"
      - "ffmpeg:go2rtc_Katzen-Schrank#audio=aac"
  webrtc:
    candidates:
      - 192.168.1.12:8555
      - stun:8555

cameras:

  Eingang:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
      - path: rtsp://127.0.0.1:8554/go2rtc_Eingang
        input_args: preset-rtsp-restream
        roles:
          - audio
          - detect
          - record
      #- path: rtsp://127.0.0.1:8554/go2rtc_Eingang_SUB
      #  input_args: preset-rtsp-generic
      #  roles:
      #    - audio
      #    - detect
    record:
      enabled: true
    audio:
      enabled: false
    best_image_timeout: 60
    webui_url: "http://192.168.1.12:5000/api/Eingang?fps=30&h=1296&timestamp=1&zones=1&bbox=1&motion=1&regions=1"
    onvif:
      host: 192.168.1.48
      port: 2020
      user: iobroker
      password: ixijannik
      #autotracking:
        #enabled: false
        #calibrate_on_startup: false
        #zooming: disabled
        #zoom_factor: 0.3
        #track:
          #- person
        #required_zones:
          #- Zone_Eingang
          #- Zone_Hof-Einfahrt
        #return_preset: preset2
        #timeout: 5
    ui:
      dashboard: true
      order: 1
    live:
      stream_name: go2rtc_Eingang
      height: 1296
      quality: 1
    detect:
      enabled: true
      width: 640
      height: 360
      fps: 10
    birdseye:
      order: 1
    objects:
      track:
        - person
        - car
        - license_plate
        - dayplate
        - nightplate
        - plate
        - bicycle
        - motorcycle
        - dog
        - cat
        - bus
        - horse
      filters:
        person:
            # Optional: minimum width*height of the bounding box for the detected object (default: 0)
          min_area: 5000
            # Optional: maximum width*height of the bounding box for the detected object (default: 24000000)
          max_area: 100000
            # Optional: minimum width/height of the bounding box for the detected object (default: 0)
          min_ratio: 0.5
            # Optional: maximum width/height of the bounding box for the detected object (default: 24000000)
          max_ratio: 2.0
            # Optional: minimum score for the object to initiate tracking (default: shown below)
          min_score: 0.5
            # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
          threshold: 0.7
    motion:
      mask:
        - 0,310,164,254,314,205,437,164,578,128,574,100,465,83,342,70,250,56,245,0,0,0
        - 459,302,459,368,467,468,495,552,475,641,478,708,431,720,388,748,378,822,437,886,535,847,542,924,575,1006,625,977,698,942,689,872,698,803,689,753,686,692,672,639,659,595,658,545,643,486,631,448,621,404,631,344,606,305,593,264,551,231,501,221,472,254
        - 1110,632,1220,598,1260,541,1288,475,1294,394,1263,340,1215,285,1136,251,1070,250,994,254,910,275,867,312,846,354,832,422,857,494,894,564,977,622
    zones:
      Zone_Eingang:
        coordinates: 
          213,1296,1763,1296,2054,960,2091,970,2113,886,1933,663,1943,585,1859,556,1645,722,1536,797,1424,723,1427,555,1250,552,1171,622,1050,619,936,602,789,588,671,633,203,807,156,696,127,579,78,593,36,458,23,917
        objects:
          - person
          - car
          - license_plate
          - dayplate
          - nightplate
          - plate
        filters:
          person:
            min_area: 5000
            max_area: 100000
            threshold: 0.7
      Zone_Hof-Einfahrt:
        coordinates: 
          1862,268,1738,287,1638,305,1512,321,1437,337,1437,457,1837,592,1847,512,1879,482,1967,506,1949,646,2113,853,2194,899,2151,1004,2304,1070,2304,481,2210,368,2116,271,2013,253
        objects:
          - car
          - license_plate
          - dayplate
          - nightplate
          - plate
      Zone_KiGa-Gehweg:
        coordinates: 
          57,260,578,104,525,93,317,60,317,14,688,61,758,70,812,91,847,136,863,184,847,227,819,255,760,280,669,307,103,484,87,407
        inertia: 3
        objects:
          - person
          - bicycle
          - car
          - license_plate
          - dayplate
          - nightplate
          - plate
      Zone_Straße-Am-Oberen-Tor:
        coordinates:
          382,394,569,335,675,304,743,287,783,264,833,238,859,203,867,160,836,124,785,103,705,90,611,78,389,56,243,41,243,0,387,0,541,13,740,26,927,44,1180,77,1529,111,1703,124,1818,137,1943,167,2191,240,2184,290,2120,268,2016,247,1907,251,1802,265,1623,297,1469,328,1337,354,1287,360,1273,312,1221,298,1151,265,1100,251,1031,253,972,261,920,280,875,312,856,351,852,442,669,501,481,556,421,579,228,658,217,601,144,626,113,555,93,482
        inertia: 3
        objects:
          - car
          - license_plate
          - dayplate
          - nightplate
          - plate
          - person
          - bicycle
          - motorcycle

  Sued-Ost:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
      - path: rtsp://127.0.0.1:8554/go2rtc_Sued-Ost
        input_args: preset-rtsp-restream
        roles:
          - audio
          - detect
          - record
    record:
      enabled: false
    audio:
      enabled: false
    best_image_timeout: 60
    webui_url: "http://192.168.1.12:5000/api/Sued-Ost?fps=30&h=1296&timestamp=1&zones=1&bbox=1&motion=1&regions=1"
    ui:
      dashboard: true
      order: 2
    live:
      stream_name: go2rtc_Sued-Ost
      height: 1296
      quality: 1
    detect:
      enabled: false
      width: 640
      height: 360
      fps: 10
    birdseye:
      order: 2
    objects:
      track:
        - person
        - car
        - license_plate
        - dayplate
        - nightplate
        - plate
        - bicycle
        - motorcycle
        - dog
        - cat
        - bus
        - horse
    motion:
      mask:
        - 959,927,1047,913,1111,899,1151,886,1184,873,1211,859,1220,826,1191,806,1160,775,1157,729,1123,690,1087,666,1086,571,1084,0,591,0,0,0,0,496,29,516,31,458,161,464,163,498,34,502,0,506,0,689,93,732,217,766,213,681,344,659,341,690,405,692,412,742,362,778,369,825,602,886,748,917,847,930
        - 0,1296,649,1296,382,1161,322,1120,320,1070,195,994,127,949,74,907,54,805,43,688,0,643
        - 2304,0,2304,785,2304,341,2304,1296,2174,1296,1953,1296,1631,1039,1711,1027,1776,996,1812,973,1847,954,1916,972,1949,946,1982,929,1992,904,1990,886,1832,857,1666,827,1541,749,1541,709,1502,706,1457,703,1415,702,1360,698,1264,678,1183,658,1071,646,1067,0
    zones:
      Zone_Hof-Einfahrt:
        coordinates: 
          1882,1296,1278,1296,1451,1071,1498,1031,1589,1016,1721,1016,1675,1057,1606,1060,1783,1205
      Zone_Gehweg-Pusteblume:
        coordinates: 
          409,743,358,776,360,809,526,850,705,885,787,899,869,894,977,876,980,843,1003,793,1158,792,1164,766,1168,743,1217,780,1283,830,1294,859,1271,896,1203,927,1137,946,1059,960,967,972,865,973,749,966,561,927,418,889,315,860,137,797,51,756,49,698,224,718,340,683,414,686
      Zone_KiGa-Gehweg:
        coordinates: 78,942,271,1083,499,1225,505,1166,452,1070,360,1003,228,946,131,896,63,859
      Zone_Straße-Gesamt:
        coordinates: 
          127,790,312,859,683,949,869,970,1036,962,1170,944,1273,889,1301,847,1158,736,1161,668,1261,709,1532,725,1538,752,1461,763,1427,790,1498,827,1628,867,1896,943,1812,973,1702,1001,1594,1010,1514,1024,1275,1296,668,1296,508,1215,506,1143,414,1027,173,909,61,833,51,746
      Zone_Straße-Am-Oberen-Tor:
        coordinates: 
          127,790,240,839,418,893,612,943,722,966,877,982,1027,966,1170,944,1281,894,1300,860,1341,886,1400,912,1478,946,1574,977,1695,1014,1586,1020,1511,1033,1439,1083,1370,1176,1275,1296,668,1296,508,1215,506,1143,414,1027,203,927,71,856,51,746
      Zone_Straße-Haupt:
        coordinates: 
          1745,914,1916,963,1843,973,1756,986,1722,1009,1538,944,1417,896,1291,840,1163,740,1156,668,1281,725,1435,796,1505,832
      Zone_Straße-Am-Damm:
        coordinates: 1538,729,1538,749,1422,778,1253,705

  Katzen-Korb:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
      - path: rtsp://127.0.0.1:8554/go2rtc_Katzen-Korb
        input_args: preset-rtsp-restream
        roles:
          - audio
          - detect
          - record
    record:
      enabled: false
    best_image_timeout: 60
    webui_url: "http://192.168.1.12:5000/api/Katzen-Korb?fps=30&h=1296&timestamp=1&zones=1&bbox=1&motion=1&regions=1"
    ui:
      dashboard: true
      order: 3
    live:
      stream_name: go2rtc_Katzen-Korb
      height: 1296
      quality: 1
    detect:
      enabled: false
      width: 640
      height: 360
      fps: 10
    birdseye:
      order: 3
    objects:
      track:
        - person
        - cat

  Katzen-Schrank:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
      - path: rtsp://127.0.0.1:8554/go2rtc_Katzen-Schrank
        input_args: preset-rtsp-restream
        roles:
          - audio
          - detect
          - record
    record:
      enabled: false
    best_image_timeout: 60
    webui_url: "http://192.168.1.12:5000/api/Katzen-Schrank?fps=30&h=1296&timestamp=1&zones=1&bbox=1&motion=1&regions=1"
    ui:
      dashboard: true
      order: 4
    live:
      stream_name: go2rtc_Katzen-Schrank
      height: 1080
      quality: 1
    detect:
      enabled: false
      width: 640
      height: 360
      fps: 10
    birdseye:
      order: 4
    objects:
      track:
        - person
        - cat

telemetry:
  network_interfaces:
      - eth
      - enp
      - eno
      - ens
      - wl
      - lo
  stats:
    amd_gpu_stats: false
    intel_gpu_stats: true
    network_bandwidth: true
  version_check: true
