services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
stop_grace_period: 30s # allow enough time to shut down the various services
image: ghcr.io/blakeblackshear/frigate:stable
#shm_size: "512mb" # update for your cameras based on calculation above
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://github.com/jnicolson/gasket-builder
#-# /dev/video11:/dev/video11 # For Raspberry Pi 4B
- /dev/dri/renderD128:/dev/dri/renderD128 # For intel hwaccel, needs to be updated for your hardware
volumes:
- /etc/localtime:/etc/localtime:ro
- ./config:/config
- ./storage:/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: "password"
next create a config for camera
version: 0.16-0
mqtt:
enabled: false
detectors:
cpu1:
type: cpu
num_threads: 3
detect:
enabled: true
fps: 5
max_disappeared: 25
cameras:
ranger2c_h3:
enabled: true
# width: 2560
# height: 1440
ffmpeg:
hwaccel_args: preset-vaapi
inputs:
- path: rtsp://admin:PASS@CAMERA_IP:554/cam/realmonitor?channel=1&subtype=1
roles: [detect]
- path: rtsp://admin:PASS@CAMERA_IP:554/cam/realmonitor?channel=1&subtype=0
roles: [record]
motion:
threshold: 30
contour_area: 30
record:
enabled: true
retain:
days: 3
mode: motion
# events:
# retain:
# default: 10
# mode: active_objects
snapshots:
enabled: true
timestamp: true
bounding_box: true
crop: true
quality: 90
retain:
default: 7
objects:
track:
- person
filters:
person:
min_score: 0.6
threshold: 0.75
min_area: 5000
save a restart