Frigate

Iš Žinynas.
22:03, 8 birželio 2024 versija, sukurta \dev\null (Aptarimas | indėlis) (Naujas puslapis: == Proxmox + HassOS (Home Assistant) + Frigate (Intel NUC6CAYH) == Pigiausias (low budget) setupas, nors cpu apkrovos jaučiasi, bet puikiai veikia su 4-6 kameromis. Diegim...)
(skirt) ← Ankstesnė versija | Dabartinė versija (skirt) | Vėlesnė versija → (skirt)
Jump to navigation Jump to search

Proxmox + HassOS (Home Assistant) + Frigate (Intel NUC6CAYH)

Pigiausias (low budget) setupas, nors cpu apkrovos jaučiasi, bet puikiai veikia su 4-6 kameromis. Diegime tuo pačiu ir Home Assistant, kuris naudojamas išmaniųjų namų automatikoje. Frigate diegiamas kaip plugin (papildinys) Home Assistant'ui

Reikalinga:

Sudiegiame proxmox

FIXME

Įgaliname Intel iGPU Passthrough

Įdiegiame mqtt brokerį kaip LXC konteinerį

Įdiegiame Home Assistant OS

Įdiegiame Home Assistant Frigate pluginą

Ubuntu 22.04.4 LTS + Frigate Docker (ThinkCentre M920q)

Reikalinga:

docker-compose.yml

version: "3.9"
services:
  frigate:
    container_name: frigate
    image: ghcr.io/blakeblackshear/frigate:stable
    restart: always
    privileged: true
    shm_size: "256mb"
    ports:
      - "1935:1935"
      - "5000:5000"
    devices:
      - /dev/bus/usb:/dev/bus/usb
      - /dev/dri:/dev/dri
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /srv/dockers/frigate/conf/config.yml:/config/config.yml:ro
      - /srv/dockers/frigate/data:/media/frigate
      - /srv/dockers/frigate/db:/db
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
#    ports:
#      - '5000:5000'
    environment:
      - FRIGATE_RTSP_PASSWORD=123456
    networks:
      - traefik
    restart: unless-stopped
    labels:
      - traefik.enable=true
      - traefik.docker.network=traefik
      - "traefik.http.routers.frigate.rule=Host(`frigate.domenas.lt`)"
      - "traefik.http.services.frigate.loadbalancer.server.port=5000"
    # resources limit
    mem_limit: 6G
    cpus: 3.0
    cap_add:
      - CAP_PERFMON
networks:
  traefik:
    external: true

frigate.yml

detectors:
#  cpu1:
#    type: cpu
#  cpu2:
#    type: cpu
  coral:
    type: edgetpu
    device: usb
    num_threads: 3
database:
  path: /db/frigate.db
ffmpeg:
  hwaccel_args: preset-vaapi
  output_args:
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
logger:
  # Optional: default log level (default: shown below)
  default: info
  # Optional: module by module log level configuration
  logs:
    frigate.mqtt: warning
    frigate.ffmpeg: debug
mqtt:
  host: 192.168.1.1
  topic_prefix: frigate
  client_id: frigate
  stats_interval: 60
rtmp:
  enabled: false

birdseye:
  enabled: false

detect:
  enabled: True
  max_disappeared: 50
  width: 640
  height: 360
  fps: 5

record:
  enabled: True
  retain:
    days: 14
    mode: motion
  events:
    pre_capture: 10
    post_capture: 5
    objects:
       - person
       - car
       - bicycle
       - motorcycle
       - bus
       - dog
       - truck
    required_zones: []
    retain:
      default: 3650
      mode: active_objects

snapshots:
  enabled: True
  timestamp: True
  bounding_box: True
  crop: False
  height: 1000
  retain:
    default: 3650

objects:
  track:
    - person
    - car
    - cat
    - dog
    - bicycle
    - truck
    - motorcycle
    - bus
    - horse
    - sheep
    - cow
    - bear
    - umbrella
    - handbag
    - suitcase
    - bottle
    - apple
    - cell phone

  filters:
    person:
      min_score: 0.5
      threshold: 0.7
    car:
      threshold: 0.70
    truck:
      threshold: 0.70

cameras:
  Cam1:
    ffmpeg:
       hwaccel_args: preset-intel-qsv-h264
       input_args: -avoid_negative_ts auto -fflags nobuffer+genpts+discardcorrupt -flags low_delay -rtsp_transport tcp -use_wallclock_as_timestamps 1 -timeout 2000000
       inputs:
         - path: rtsp://admin:admin@192.168.1.10/0/av1 # h264 MPEG-4 AVC (h264) 640x352
           roles:
             - detect
         - path: rtsp://admin:admin@192.168.1.10/0/av0 # h264 MPEG-4 AVC (h264 1920x1080
           roles:
             - record
    detect:
      width: 640
      height: 352
      fps: 5
    objects:
      track:
        - person
        - cat
        - dog
        - truck
    mqtt:
      height: 1080
      crop: False
    timestamp_style:
      position: "bl"
      format: "%H:%M:%S"
      color:
        red: 255
        green: 255
        blue: 255
      thickness: 5
      effect: "shadow"