Frigate

Frigate is an open source NVR built around real-time AI object detection. All processing is performed locally on your own hardware, and your camera feeds never leave your home

Images

Config

https://github.com/christiantusset/boilerplates/blob/main/docker-compose/frigate/config/config.yml
mqtt:
  enabled: false
cameras:
  FrontCam:
    ffmpeg:
      inputs:
        - path: rtsp://user:pass@IP_HERE:554/h264Preview_01_main
          roles:
            - detect
            - record
    detect:
      width: 1280
      height: 720
      fps: 5
detectors:
  ov:
    type: openvino
    device: GPU
    model:
      path: /openvino-model/ssdlite_mobilenet_v2.xml
model:
  width: 300
  height: 300
  input_tensor: nhwc
  input_pixel_format: bgr
  labelmap_path: /openvino-model/coco_91cl_bkgr.txt
#Global Object Settings
rtmp:
  enabled: false
birdseye:
  enabled: True
  mode: continuous
objects:
  track:
    - person
  filters:
    person:
      threshold: 0.75
      min_area: 5000
      max_area: 100000
snapshots:
  enabled: True
  retain:
    default: 1
record:
  enabled: True
  expire_interval: 10
  retain:
    days: 3
    mode: motion
  events:
    retain:
      default: 5
ffmpeg:
  hwaccel_args: preset-vaapi

Docker

https://github.com/christiantusset/boilerplates/blob/main/docker-compose/frigate/docker-compose.yml
---
version: "3.9"
services:
  frigate:
    container_name: frigate
    image: ghcr.io/blakeblackshear/frigate:stable
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    shm_size: "64mb" # update for your cameras based on calculation above
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./config/config.yml:/config/config.yml
      - ./media:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      - FRIGATE_RTSP_PASSWORD:"adminadmin"
      - LIBVA_DRIVER_NAME=radeonsi #amd
      # - LIBVA_DRIVER_NAME=i965 #intel
#    devices:
#      - /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
#      - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
#      - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
#    deploy: # <------------- Add this section
#      resources:
#        reservations:
#          devices:
#            - driver: nvidia
#              device_ids: [ '0' ] # this is only needed when using multiple GPUs
#              count: 1 # number of GPUs
#              capabilities: [ gpu ]

#Guide: https://www.smarthomebeginner.com/frigate-docker-guide/
#Doc: https://docs.frigate.video/frigate/installation/

Last updated