diff --git a/docs/services/frigate.md b/docs/services/frigate.md new file mode 100644 index 00000000..3c2137ee --- /dev/null +++ b/docs/services/frigate.md @@ -0,0 +1,73 @@ +# Frigate + +[Frigate](https://frigate.video/) is an open source NVR built around real-time AI object detection. + +## Dependencies + +No other services are required to run Frigate in the default configuration, +but it is commonly deployed together with an MQTT broker such as: +* [mosquitto](mosquitto.md) +* [rumqttd](rumqttd.md) + +## Configuration + +To enable this service, add the following to your `vars.yml` and re-run the [installation](../installing.md). + +```yaml +######################################################################## +# # +# frigate # +# # +######################################################################## + +frigate_enabled: true + +# Required +# See https://docs.frigate.video/configuration/cameras +frigate_cameras: + # Required: name of the camera + MY_EXAMPLE_CAMERA_NAME: + # Optional: Enable/Disable the camera (default: shown below). + # If disabled: config is used but no live stream and no capture etc. + # Events/Recordings are still viewable. + enabled: True + # Required: ffmpeg settings for the camera + ffmpeg: + # Required: A list of input streams for the camera. See documentation for more information. + inputs: + # Required: the path to the stream + # NOTE: path may include environment variables, which must begin with 'FRIGATE_' and be referenced in {} + - path: rtsp://MY_EXAMPLE_CAMERA_URL + # Required: list of roles for this stream. valid values are: detect,record,rtmp + # NOTICE: In addition to assigning the record and rtmp roles, + # they must also be enabled in the camera config. + roles: + - detect + - record + - rtmp + +######################################################################## +# # +# /frigate # +# # +######################################################################## +``` + +## Enabling Video Hardware Acceleration + +The playbook supports configuring hardware acceleration in Frigate. + +For example, to enable Intel hardware acceleration with VA-API, add the +following lines to your `vars.yml`: + +```yaml +# Use VA-API to detect and use whatever hw accel is available on the system +frigate_ffmpeg_hwaccel_args: preset-vaapi + +# Give the frigate container access to the Intel device +frigate_devices: + - /dev/dri/renderD128 +``` + +Refer to the [Frigate documentation on hardare acceleration](https://docs.frigate.video/configuration/hardware_acceleration) +for more details and support for other hardware. diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 90d227b7..23bd16f4 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -101,6 +101,8 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': (focalboard_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'focalboard']}] if focalboard_enabled else []) + + ([{'name': (frigate_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'frigate']}] if frigate_enabled else []) + + ([{'name': (funkwhale_api_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'funkwhale']}] if funkwhale_enabled else []) + ([{'name': (funkwhale_frontend_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'funkwhale']}] if funkwhale_enabled else []) @@ -930,6 +932,28 @@ focalboard_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certRe +######################################################################## +# # +# frigate # +# # +######################################################################## + +frigate_enabled: false +frigate_identifier: "{{ mash_playbook_service_identifier_prefix }}frigate" +frigate_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}frigate" + +# Yes, unfortunately Frigate requires to run as root :\ +frigate_uid: "0" +frigate_gid: "0" + +######################################################################## +# # +# /frigate # +# # +######################################################################## + + + ######################################################################## # # # funkwhale # diff --git a/requirements.yml b/requirements.yml index 90613fd9..0f6afea6 100644 --- a/requirements.yml +++ b/requirements.yml @@ -63,6 +63,9 @@ - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-focalboard.git version: v7.9.3-2 name: focalboard +- src: git+https://github.com/cvwright/ansible-role-frigate.git + version: 401c3f582e1acd710186d82875496e37817ff521 + name: frigate - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-funkwhale.git version: v1.3.0-rc6-0 name: funkwhale diff --git a/setup.yml b/setup.yml index aaa6f950..222fa301 100644 --- a/setup.yml +++ b/setup.yml @@ -76,6 +76,8 @@ - role: galaxy/focalboard + - role: galaxy/frigate + - role: galaxy/funkwhale - role: galaxy/gitea