Skip to main content

frigate

··289 words·2 mins·
Michael
Author
Michael
some dude that works on datacenters, plays guitar, streams, has a lot of side projects and unhealthy addiction to ow

What is Frigate?
#

Frigate is a complete and local NVR designed for Home Assistant with AI object detection. Uses OpenCV and Tensorflow to perform realtime object detection locally for IP cameras.

# frigate -- https://docs.frigate.video/frigate/installation/
---
services:
    frigate:
        container_name: frigate
        #privileged: true # this may not be necessary for all setups
        stop_grace_period: 30s # allow enough time to shut down the various services
        restart: unless-stopped
        image: ghcr.io/blakeblackshear/frigate:stable
        shm_size: "512mb" # update for your cameras based on calculation above
        volumes:
            - /etc/localtime:/etc/localtime:ro
            - ${FRIGATE_DATA}/config:/config
            - ${FRIGATE_DATA}/media:/media/frigate
            - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
              target: /tmp/cache
              tmpfs:
                  size: 1000000000
        ports:
            - "8971:8971"
            - "5000:5000" # Internal unauthenticated access. Expose carefully.
            - "8554:8554" # RTSP feeds
            - "8555:8555/tcp" # WebRTC over tcp
            - "8555:8555/udp" # WebRTC over udp
        environment:
            FRIGATE_RTSP_PASSWORD: '${FRIGATE_RTSP_PASSWORD}'

requires to set a config.yml in the /config volume.

My old config
#

Am not currently running the optimized setup for this, but testing things out.

mqtt:
  enabled: false
cameras:
  front:
    birdseye:
      order: 1
    ffmpeg:
      inputs:
        - path: rtsp://USERNAME:PASSWORD@IPADDR:554/path_to_stream
          roles:
            - detect
            - record
    objects:
      track:
        - person
    detect:
      width: 1920
      height: 1080

    record:
      sync_recordings: True
      enabled: True
      retain:
        days: 7
        mode: motion
      events:
        # Optional: Number of seconds before the event to include (default: shown below)
        pre_capture: 5
        # Optional: Number of seconds after the event to include (default: shown below)
        post_capture: 5

detectors:
    cpu1:
      type: cpu
      num_threads: 3

## Include all cameras by default in Birdseye view
birdseye:
  enabled: True
  mode: continuous
  width: 1280
  height: 720
  quality: 8
  inactivity_threshold: 30

Proxy fixes
#

For nginx proxy - add this to advanced options for proxy host

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;
proxy_request_buffering off;