initial checkin

This commit is contained in:
Radar231 2024-01-08 08:33:03 -05:00
commit 24c43c535e
5 changed files with 318 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
frigate.env

259
config/config.yml Normal file
View File

@ -0,0 +1,259 @@
---
#######################################
mqtt:
enabled: True
host: 192.168.20.81
port: 1883
topic_prefix: frigate
client_id: frigate
user: "{FRIGATE_MQTT_USER}"
password: "{FRIGATE_MQTT_PW}"
#######################################
timestamp_style:
position: "tl"
format: "%Y-%m-%d %H:%M:%S"
color:
red: 255
green: 255
blue: 255
thickness: 2
effect: shadow
#######################################
go2rtc:
streams:
driveway:
- rtsp://{FRIGATE_CAM2_USER}:{FRIGATE_CAM2_PW}@192.168.30.177:554/1/1
driveway_sub:
- rtsp://{FRIGATE_CAM2_USER}:{FRIGATE_CAM2_PW}@192.168.30.177:554/1/2
front:
- rtsp://{FRIGATE_CAM1_USER}:{FRIGATE_CAM1_PW}@192.168.30.211:554/1/1
front_sub:
- rtsp://{FRIGATE_CAM1_USER}:{FRIGATE_CAM1_PW}@192.168.30.211:554/1/2
back:
- rtsp://{FRIGATE_CAM3_USER}:{FRIGATE_CAM3_PW}@192.168.30.183:554/1/1
back_sub:
- rtsp://{FRIGATE_CAM3_USER}:{FRIGATE_CAM3_PW}@192.168.30.183:554/1/2
garage:
- rtsp://{FRIGATE_CAM4_USER}:{FRIGATE_CAM4_PW}@192.168.30.150/live
webrtc:
candidates:
- 192.168.20.33:8555
- stun:8555
#######################################
detectors:
cpu1:
type: cpu
num_threads: 2
cpu2:
type: cpu
num_threads: 2
cpu3:
type: cpu
num_threads: 2
#######################################
birdseye:
enabled: True
mode: continuous
width: 960
height: 540
restream: True
#######################################
live:
height: 1080
quality: 1
#stream_name: driveway
##############################################################################
cameras:
#####################################
driveway:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/driveway_sub
roles:
- detect
- path: rtsp://127.0.0.1:8554/driveway
roles:
- record
detect:
enabled: True # <---- disable detection until you have a working camera feed
width: 640 # <---- update for your camera's resolution
height: 360 # <---- update for your camera's resolution
objects:
track:
- person
- car
snapshots:
enabled: True
timestamp: True
bounding_box: True
required_zones:
- road_zone
- driveway_zone
record:
enabled: True
retain:
days: 3
events:
required_zones:
- road_zone
- driveway_zone
zones:
driveway_zone:
coordinates: 440,215,553,248,590,201,516,188
objects:
- person
- car
road_zone:
coordinates: 618,206,619,177,300,134,283,151
objects:
- person
- car
motion:
mask:
- 278,0,281,168,237,166,217,117,193,110,161,103,0,112,0,0
- 375,191,366,144,326,141,326,183
- 325,139,640,172,603,115,559,32,287,60,286,125
#####################################
front:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/front_sub
roles:
- detect
- path: rtsp://127.0.0.1:8554/front
roles:
- record
detect:
enabled: True # <---- disable detection until you have a working camera feed
width: 640 # <---- update for your camera's resolution
height: 360 # <---- update for your camera's resolution
objects:
track:
- person
- car
snapshots:
enabled: True
timestamp: True
bounding_box: True
required_zones:
- front-door_zone
- sidewalk_zone
- driveway_zone
record:
enabled: True
retain:
days: 3
events:
required_zones:
- front-door_zone
- sidewalk_zone
- driveway_zone
zones:
front-door_zone:
coordinates: 47,195,66,337,320,336,311,33,182,37
objects:
- person
sidewalk_zone:
coordinates: 371,244,459,214,457,163,394,117,353,116
objects:
- person
front_driveway_zone:
coordinates: 523,126,524,107,347,79,354,105
objects:
- person
- car
motion:
mask:
- 576,23,511,0,520,141,570,144
- 347,79,452,99,455,63,347,0
- 345,360,406,360,399,211,348,193
#####################################
garage:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/garage
roles:
- detect
- record
detect:
enabled: False # <---- disable detection until you have a working camera feed
width: 1920 # <---- update for your camera's resolution
height: 1080 # <---- update for your camera's resolution
objects:
track:
- person
- dog
snapshots:
enabled: True
timestamp: True
required_zones:
- yard_zone
record:
enabled: True
events:
required_zones:
- yard_zone
retain:
days: 3
zones:
yard_zone:
coordinates: 648,361,758,730,1028,712,993,445,1218,357,1211,325,1331,254,703,286,631,294
objects:
- person
- dog
motion:
mask:
- 1920,0,1920,249,1388,223,1345,250,1249,249,1046,282,636,282,520,270,502,0
#####################################
back:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/back
roles:
- detect
- record
detect:
enabled: False # <---- disable detection until you have a working camera feed
width: 1920 # <---- update for your camera's resolution
height: 1080 # <---- update for your camera's resolution
objects:
track:
- person
- dog
snapshots:
enabled: True
timestamp: True
required_zones:
- yard_zone
record:
enabled: True
events:
required_zones:
- yard_zone
retain:
days: 3
zones:
yard_zone:
coordinates: 648,361,758,730,1028,712,993,445,1218,357,1211,325,1331,254,703,286,631,294
objects:
- person
- dog
motion:
mask:
- 1920,0,1920,249,1388,223,1345,250,1249,249,1046,282,636,282,520,270,502,0
# EOF

34
docker-compose.yml Normal file
View File

@ -0,0 +1,34 @@
---
version: "3.9"
services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
#network_mode: host
image: ghcr.io/blakeblackshear/frigate:stable
shm_size: "64mb" # 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://coral.ai/docs/m2/get-started/#2a-on-linux
# - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
volumes:
- /etc/localtime:/etc/localtime:ro
- ./config:/config
- /opt/storage:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
#- "1984:1984"
- "5000:5000"
- "8554:8554" # RTSP feeds
- "8555:8555/tcp" # WebRTC over tcp
- "8555:8555/udp" # WebRTC over udp
environment:
TZ: "America/Toronto"
env_file:
- frigate.env
# EOF

18
frigate.enc.env Normal file
View File

@ -0,0 +1,18 @@
$ANSIBLE_VAULT;1.1;AES256
30376536343566383433393836663131613434333338626264333737353735353666633538346337
6332366366363237393130666432343136643333363137340a383961616637313633623163303835
39346462633539393461626137656561373335333032333963323866643734316131363331386134
6638363233343165610a303434666232396631383836396339353065303461336133623934303236
66636666316563646238366165623162356131643236303766613839346138333466613434353336
36363834643066373230373831303966396263386266656537656166356266343065356263326366
61623230373864336536396338383236626166376436623434356639656365386438346535623938
38356461646165386266653737336631376535333663336135613862633564373231663365313430
39613665653832306464663635636430326138326261303863386331316236346639383661373164
64636465356235626166303832303662353565666263353032663535373961323666383633313234
33323966613637313939366239316162366631613463663439396433343332633432653964303933
65636636303335656231376139303233653166323461323865643138643535333638643231623039
65623438353234366437356461623764356366376465323435613963616132303331353662646334
65303139646339666465623061663836316565363733346434313362346336643865336363333334
66326337363330663936383739363063353230383237313535383761613130616438346431366538
62356665326464643337633736316565613932613234373030643639396537663130643263316664
34323161623466353534613661323634323331633462663636313163333837623039

6
mk_cliplist.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
touch /opt/docker/docker_frigate/clip_detect.lst
inotifywait -m -e create --timefmt '%Y%m%d-%H%M%S' --format '%T: %w%f' --include ".*\.jpg$" --outfile /opt/docker/docker_frigate/clip_detect.lst --daemon /opt/docker/docker_frigate/storage/clips