/
/
/
Ansible role that deployes services on my runner machine
1# Frigate Configuration
2# Auto-generated by Ansible Runner Role
3
4mqtt:
5 enabled: true
6 host: {{ mqtt_host }}
7 port: {{ mqtt_port }}
8 user: {{ mqtt_username }}
9 password: {{ mqtt_password }}
10 topic_prefix: frigate
11
12database:
13 path: /data/frigate.db
14
15{% if frigate_hardware_acceleration == 'nvenc' %}
16detectors:
17 onnx_0:
18 type: onnx
19 onnx_1:
20 type: onnx
21
22model:
23 model_type: yolo-generic
24 path: /config/models/yolov7-tiny.onnx
25 labelmap_path: /config/models/coco_labels.txt
26 width: 640
27 height: 640
28 input_tensor: nchw
29 input_dtype: float
30
31ffmpeg:
32 hwaccel_args: preset-nvidia
33{% else %}
34detectors:
35 cpu_0:
36 type: cpu
37
38ffmpeg:
39 hwaccel_args: auto
40{% endif %}
41
42snapshots:
43 enabled: true
44 timestamp: false
45 bounding_box: true
46 crop: false
47 height: 175
48
49record:
50 enabled: true
51 expire_interval: 60
52 sync_recordings: false
53 retain:
54 days: 30
55 mode: all
56
57objects:
58 track:
59 - person
60 - car
61 - cat
62 filters:
63 person:
64 min_area: 2000
65 max_area: 200000
66 threshold: 0.7
67 car:
68 min_area: 1000
69 max_area: 5000
70 threshold: 0.9
71 cat:
72 min_area: 2000
73 max_area: 100000
74 threshold: 0.6
75review:
76 alerts:
77 labels: [person, cat]
78
79motion:
80 threshold: 25
81 contour_area: 30
82 delta_alpha: 0.2
83 frame_alpha: 0.2
84 frame_height: 144
85 improve_contrast: false
86
87cameras:
88{% for camera in frigate_cameras %}
89{% set has_detect = camera.detect_enabled | default(true) | bool %}
90 {{ camera.name }}:
91 enabled: {{ camera.enabled | bool | lower }}
92 ffmpeg:
93 inputs:
94{% if has_detect %}
95 - path: rtsp://127.0.0.1:8554/{{ camera.name }}-detect
96 roles: [detect]
97{% endif %}
98 - path: rtsp://127.0.0.1:8554/{{ camera.name }}
99 roles: [record]
100{% if has_detect %}
101 detect:
102 fps: 7
103 width: {{ camera.detect_width | default(640) }}
104 height: {{ camera.detect_height | default(640) }}
105{% endif %}
106{% if camera.name in frigate_cameras_record_disabled %}
107 record:
108 enabled: false
109{% endif %}
110{% set onvif_cam = frigate_onvif_cameras | default([]) | selectattr('name', 'equalto', camera.name) | list %}
111{% if onvif_cam | length > 0 %}
112{% set onvif = onvif_cam[0] %}
113 onvif:
114 host: {{ onvif.host }}
115 port: {{ onvif.port | default(2020) }}
116 user: {{ onvif.username }}
117 password: {{ onvif.password }}
118{% if frigate_onvif_autotracking %}
119 autotracking:
120 enabled: true
121{% endif %}
122{% endif %}
123{% endfor %}
124
125go2rtc:
126 streams:
127{% for camera in frigate_cameras %}
128{% set has_detect = camera.detect_enabled | default(true) | bool %}
129{% set cred = camera.username ~ ':' ~ camera.password ~ '@' if camera.username | default('') else '' %}
130{% set host_port = camera.host ~ (':' ~ camera.port if camera.port is defined else '') %}
131 {{ camera.name }}:
132 - rtsp://{{ cred }}{{ host_port }}{{ camera.path }}
133{% if has_detect %}
134 {{ camera.name }}-detect:
135 - "ffmpeg:rtsp://{{ cred }}{{ host_port }}{{ camera.path }}#video=h264#width=640#height=360#hardware"
136{% endif %}
137{% endfor %}
138
139ui:
140 timezone: {{ runner_timezone }}
141
142birdseye:
143 enabled: true
144 restream: false
145 width: 1280
146 height: 720
147 quality: 8
148 mode: objects
149
150logger:
151 default: debug
152 logs:
153 frigate.event: debug
154 frigate.detectors.plugins.onnx: debug
155 detector.onnx: debug
156
157version: 0.16-1
158
159auth:
160 enabled: false
161
162tls:
163 enabled: false
164detect:
165 enabled: true
166