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