From ac41b6e18167b0fc8b093e6fa3a618bb5ab76a3a Mon Sep 17 00:00:00 2001 From: Miguel Valenzuela Date: Thu, 19 Oct 2023 15:14:56 -0700 Subject: [PATCH 01/58] Update Output Args Presets AAC (#8161) * Update Output Args Presets AAC Upon researching the nuances of preset-record-generic-audio-copy & preset-record-generic-audio-aac https://github.com/blakeblackshear/frigate/blob/4c7ea01137d5046879355e35fe9e260d1624d031/frigate/ffmpeg_presets.py#L341 https://ffmpeg.org/ffmpeg.html#Main-options https://stackoverflow.com/questions/70148683/will-ffmpeg-try-to-transcode-to-same-encoding I'd suggest to disambiguate what these two do * fix: lowercase --- docs/docs/configuration/ffmpeg_presets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/configuration/ffmpeg_presets.md b/docs/docs/configuration/ffmpeg_presets.md index 66747350e..f346c92a0 100644 --- a/docs/docs/configuration/ffmpeg_presets.md +++ b/docs/docs/configuration/ffmpeg_presets.md @@ -72,8 +72,8 @@ Output args presets help make the config more readable and handle use cases for | Preset | Usage | Other Notes | | -------------------------------- | --------------------------------- | --------------------------------------------- | | preset-record-generic | Record WITHOUT audio | This is the default when nothing is specified | -| preset-record-generic-audio-aac | Record WITH aac audio | Use this to enable audio in recordings | | preset-record-generic-audio-copy | Record WITH original audio | Use this to enable audio in recordings | +| preset-record-generic-audio-aac | Record WITH transcoded aac audio | Use this to transcode to aac audio. If your source is already aac, use preset-record-generic-audio-copy instead to avoid re-encoding | | preset-record-mjpeg | Record an mjpeg stream | Recommend restreaming mjpeg stream instead | | preset-record-jpeg | Record live jpeg | Recommend restreaming live jpeg instead | | preset-record-ubiquiti | Record ubiquiti stream with audio | Recordings with ubiquiti non-standard audio | From 37b82c0d605d2530a15809ab078356fc35764600 Mon Sep 17 00:00:00 2001 From: wbradmoore Date: Thu, 2 Nov 2023 07:20:19 -0400 Subject: [PATCH 02/58] Update getting_started.md (#8420) fix configuring_go2rtc link --- docs/docs/guides/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/guides/getting_started.md b/docs/docs/guides/getting_started.md index adbddb9c2..04110cd1d 100644 --- a/docs/docs/guides/getting_started.md +++ b/docs/docs/guides/getting_started.md @@ -170,5 +170,5 @@ By default, Frigate will retain snapshots of all events for 10 days. The full se Now that you have a working install, you can use the following guides for additional features: -1. [Configuring go2rtc](configuring_go2rtc) - Additional live view options and RTSP relay +1. [Configuring go2rtc](configuring_go2rtc.md) - Additional live view options and RTSP relay 2. [Home Assistant Integration](../integrations/home-assistant.md) - Integrate with Home Assistant From a4f5ad3a94fd6326e2f321e9a7d8c31af696e2f4 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 7 Dec 2023 19:08:35 -0600 Subject: [PATCH 03/58] Proxy websockets in devcontainers (#8886) * proxy websockets * remove whitespace --- web/vite.config.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/web/vite.config.ts b/web/vite.config.ts index 930c0f36e..ee33d491a 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -19,7 +19,16 @@ export default defineConfig({ }, '/exports': { target: 'http://localhost:5000' - } + }, + '/ws': { + target: 'ws://localhost:5000', + ws: true, + }, + '/live': { + target: 'ws://localhost:5000', + changeOrigin: true, + ws: true, + }, } }, plugins: [ @@ -43,4 +52,4 @@ export default defineConfig({ restoreMocks: true, globals: true, }, -}); +}); \ No newline at end of file From e51240676455f28e767318d8571f8182edb14c60 Mon Sep 17 00:00:00 2001 From: Matti Hiljanen <170205+qvr@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:30:22 +0200 Subject: [PATCH 04/58] Fix inertia calculation check (#8890) --- frigate/object_processing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frigate/object_processing.py b/frigate/object_processing.py index b0e5b9a52..f7888441d 100644 --- a/frigate/object_processing.py +++ b/frigate/object_processing.py @@ -195,7 +195,7 @@ class TrackedObject: self.zone_presence[name] = zone_score + 1 # an object is only considered present in a zone if it has a zone inertia of 3+ - if zone_score >= zone.inertia: + if self.zone_presence[name] >= zone.inertia: current_zones.append(name) if name not in self.entered_zones: From ee7eaff96534e0da51462a2c55f2e75ac980b3c3 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 12 Dec 2023 03:47:40 -0700 Subject: [PATCH 05/58] Don't fail if NaN is returned for segment duration (#8923) --- frigate/util/services.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frigate/util/services.py b/frigate/util/services.py index 94946434b..28421cef3 100644 --- a/frigate/util/services.py +++ b/frigate/util/services.py @@ -371,7 +371,7 @@ def vainfo_hwaccel(device_name: Optional[str] = None) -> sp.CompletedProcess: return sp.run(ffprobe_cmd, capture_output=True) -async def get_video_properties(url, get_duration=False): +async def get_video_properties(url, get_duration=False) -> dict[str, any]: async def calculate_duration(video: Optional[any]) -> float: duration = None @@ -405,7 +405,10 @@ async def get_video_properties(url, get_duration=False): result = None if result: - duration = float(result.strip()) + try: + duration = float(result.strip()) + except ValueError: + duration = -1 else: duration = -1 From ca4e0dbc7525516a7db5b6dec2a23dd900d82631 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 12 Dec 2023 03:48:09 -0700 Subject: [PATCH 06/58] Fix ffmpeg input arg parsing (#8924) --- frigate/events/audio.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frigate/events/audio.py b/frigate/events/audio.py index 3bc80c920..ed457adf1 100644 --- a/frigate/events/audio.py +++ b/frigate/events/audio.py @@ -43,9 +43,9 @@ def get_ffmpeg_command(ffmpeg: FfmpegConfig) -> list[str]: ffmpeg_input: CameraInput = [i for i in ffmpeg.inputs if "audio" in i.roles][0] input_args = get_ffmpeg_arg_list(ffmpeg.global_args) + ( parse_preset_input(ffmpeg_input.input_args, 1) - or ffmpeg_input.input_args + or get_ffmpeg_arg_list(ffmpeg_input.input_args) or parse_preset_input(ffmpeg.input_args, 1) - or ffmpeg.input_args + or get_ffmpeg_arg_list(ffmpeg.input_args) ) return ( ["ffmpeg", "-vn"] From 64bee7a64fd24faca4b4bb3e099e224e9e2cc9f3 Mon Sep 17 00:00:00 2001 From: FinnakaLite <51403094+FinnakaLite@users.noreply.github.com> Date: Tue, 12 Dec 2023 11:48:42 +0100 Subject: [PATCH 07/58] Included caution about Snapcraft docker issues. (#8925) * Included caution about Snapcraft docker issues. * Accepted format suggestion from NickM-27 Co-authored-by: Nicolas Mowen --------- Co-authored-by: Nicolas Mowen --- docs/docs/frigate/installation.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/docs/frigate/installation.md b/docs/docs/frigate/installation.md index 93b2cfe9c..fcdaa68ba 100644 --- a/docs/docs/frigate/installation.md +++ b/docs/docs/frigate/installation.md @@ -47,6 +47,12 @@ services: ... ``` +:::caution + +Users of the Snapcraft build of Docker cannot use storage locations outside your $HOME folder. + +::: + ### Calculating required shm-size Frigate utilizes shared memory to store frames during processing. The default `shm-size` provided by Docker is **64MB**. From e390533760704e5204299053d55b197b7a163807 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 12 Dec 2023 16:21:06 -0700 Subject: [PATCH 08/58] Make recording docs more clear about 24/7 recording (#8931) * Make recording docs more clear about 24/7 recording * Add note about partial days * remove `X` --- docs/docs/configuration/record.md | 39 ++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/docs/docs/configuration/record.md b/docs/docs/configuration/record.md index 5a505c6d1..a14135c9e 100644 --- a/docs/docs/configuration/record.md +++ b/docs/docs/configuration/record.md @@ -13,7 +13,30 @@ H265 recordings can be viewed in Chrome 108+, Edge and Safari only. All other br As of Frigate 0.12 if there is less than an hour left of storage, the oldest 2 hours of recordings will be deleted. -## What if I don't want 24/7 recordings? +## Configuring Recording Retention + +Frigate supports both 24/7 and event based recordings with separate retention modes and retention periods. + +:::tip + +Retention configs support decimals meaning they can be configured to retain `0.5` days, for example. + +::: + +### 24/7 Recording + +The number of days to retain 24/7 recordings can be set via the following config where X is a number, by default 24/7 recording is disabled. + +```yaml +record: + enabled: True + retain: + days: 1 # <- number of days to keep 24/7 recordings +``` + +24/7 recording supports different retention modes [which are described below](#what-do-the-different-retain-modes-mean) + +### Event Recording If you only used clips in previous versions with recordings disabled, you can use the following config to get the same behavior. This is also the default behavior when recordings are enabled. @@ -22,17 +45,11 @@ record: enabled: True events: retain: - default: 10 + default: 10 # <- number of days to keep event recordings ``` This configuration will retain recording segments that overlap with events and have active tracked objects for 10 days. Because multiple events can reference the same recording segments, this avoids storing duplicate footage for overlapping events and reduces overall storage needs. -When `retain -> days` is set to `0`, segments will be deleted from the cache if no events are in progress. - -## Can I have "24/7" recordings, but only at certain times? - -Using Frigate UI, HomeAssistant, or MQTT, cameras can be automated to only record in certain situations or at certain times. - **WARNING**: Recordings still must be enabled in the config. If a camera has recordings disabled in the config, enabling via the methods listed above will have no effect. ## What do the different retain modes mean? @@ -81,9 +98,13 @@ record: car: 7 ``` +## Can I have "24/7" recordings, but only at certain times? + +Using Frigate UI, HomeAssistant, or MQTT, cameras can be automated to only record in certain situations or at certain times. + ## How do I export recordings? -The export page in the Frigate WebUI allows for exporting real time clips with a designated start and stop time as well as exporting a timelapse for a designated start and stop time. These exports can take a while so it is important to leave the file until it is no longer in progress. +The export page in the Frigate WebUI allows for exporting real time clips with a designated start and stop time as well as exporting a time-lapse for a designated start and stop time. These exports can take a while so it is important to leave the file until it is no longer in progress. ## Syncing Recordings With Disk From c35c7da82a23520478ca56dd469fc28dcf1e1e5a Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 15 Dec 2023 16:25:21 -0700 Subject: [PATCH 09/58] Don't fail if deepstack detector times out (#8979) --- frigate/detectors/plugins/deepstack.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/frigate/detectors/plugins/deepstack.py b/frigate/detectors/plugins/deepstack.py index fd79e27d0..311972393 100644 --- a/frigate/detectors/plugins/deepstack.py +++ b/frigate/detectors/plugins/deepstack.py @@ -49,12 +49,18 @@ class DeepStack(DetectionApi): image.save(output, format="JPEG") image_bytes = output.getvalue() data = {"api_key": self.api_key} - response = requests.post( - self.api_url, - data=data, - files={"image": image_bytes}, - timeout=self.api_timeout, - ) + + try: + response = requests.post( + self.api_url, + data=data, + files={"image": image_bytes}, + timeout=self.api_timeout, + ) + except requests.exceptions.RequestException: + logger.error("Error calling deepstack API") + return np.zeros((20, 6), np.float32) + response_json = response.json() detections = np.zeros((20, 6), np.float32) if response_json.get("predictions") is None: From 7b71c21c12c9ccb1d92580145fde92ec76a71d93 Mon Sep 17 00:00:00 2001 From: kaydee123 Date: Mon, 25 Dec 2023 01:25:07 +0530 Subject: [PATCH 10/58] Update reverse_proxy.md (#9070) Spelling mistake --- docs/docs/guides/reverse_proxy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/guides/reverse_proxy.md b/docs/docs/guides/reverse_proxy.md index 165b4d517..479df53e8 100644 --- a/docs/docs/guides/reverse_proxy.md +++ b/docs/docs/guides/reverse_proxy.md @@ -125,7 +125,7 @@ This section points to your SSL files, the example below shows locations to a de ### Setup reverse proxy settings -Thhe settings below enabled connection upgrade, sets up logging (optional) and proxies everything from the `/` context to the docker host and port specified earlier in the configuration +The settings below enabled connection upgrade, sets up logging (optional) and proxies everything from the `/` context to the docker host and port specified earlier in the configuration ``` proxy_set_header Upgrade $http_upgrade; From 49814b34d38730078e8412c924959c8fa06b6ac4 Mon Sep 17 00:00:00 2001 From: Nicholas Page Date: Sun, 31 Dec 2023 05:38:29 -0800 Subject: [PATCH 11/58] Update Jetson ffmpeg patch for Jetpack 5.1.2 compatibility (#8914) --- docker/tensorrt/build_jetson_ffmpeg.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/tensorrt/build_jetson_ffmpeg.sh b/docker/tensorrt/build_jetson_ffmpeg.sh index 8c532ebc3..f4e55c2bb 100755 --- a/docker/tensorrt/build_jetson_ffmpeg.sh +++ b/docker/tensorrt/build_jetson_ffmpeg.sh @@ -23,8 +23,8 @@ else fi tar xaf jetson_multimedia_api.tbz2 -C / && rm jetson_multimedia_api.tbz2 -wget -q https://github.com/madsciencetist/jetson-ffmpeg/archive/refs/heads/master.zip -unzip master.zip && rm master.zip && cd jetson-ffmpeg-master +wget -q https://github.com/AndBobsYourUncle/jetson-ffmpeg/archive/9c17b09.zip -O jetson-ffmpeg.zip +unzip jetson-ffmpeg.zip && rm jetson-ffmpeg.zip && mv jetson-ffmpeg-* jetson-ffmpeg && cd jetson-ffmpeg LD_LIBRARY_PATH=$(pwd)/stubs:$LD_LIBRARY_PATH # tegra multimedia libs aren't available in image, so use stubs for ffmpeg build mkdir build cd build @@ -42,7 +42,7 @@ cd ../ && rm -rf nv-codec-headers-master # Build ffmpeg with nvmpi patch wget -q https://ffmpeg.org/releases/ffmpeg-6.0.tar.xz tar xaf ffmpeg-*.tar.xz && rm ffmpeg-*.tar.xz && cd ffmpeg-* -patch -p1 < ../jetson-ffmpeg-master/ffmpeg_patches/ffmpeg6.0_nvmpi.patch +patch -p1 < ../jetson-ffmpeg/ffmpeg_patches/ffmpeg6.0_nvmpi.patch export PKG_CONFIG_PATH=$INSTALL_PREFIX/lib/pkgconfig # enable Jetson codecs but disable dGPU codecs ./configure --cc='ccache gcc' --cxx='ccache g++' \ From 8e419132eae4e841a365544e43b1f67dbcdea52f Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 3 Jan 2024 07:30:25 -0600 Subject: [PATCH 12/58] Clean user / pass from stats command line (#9189) --- frigate/util/services.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frigate/util/services.py b/frigate/util/services.py index 28421cef3..ef92b3153 100644 --- a/frigate/util/services.py +++ b/frigate/util/services.py @@ -14,7 +14,7 @@ import cv2 import psutil import py3nvml.py3nvml as nvml -from frigate.util.builtin import escape_special_characters +from frigate.util.builtin import clean_camera_user_pass, escape_special_characters logger = logging.getLogger(__name__) @@ -134,7 +134,7 @@ def get_cpu_stats() -> dict[str, dict]: "cpu": str(cpu_percent), "cpu_average": str(round(cpu_average_usage, 2)), "mem": f"{mem_pct}", - "cmdline": " ".join(cmdline), + "cmdline": clean_camera_user_pass(" ".join(cmdline)), } except Exception: continue From 86cd97609d691418d15163f90246e6b7f0b1080c Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 3 Jan 2024 17:39:30 -0600 Subject: [PATCH 13/58] Remove mention of restream role from docs (#9176) --- docs/docs/configuration/restream.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/configuration/restream.md b/docs/docs/configuration/restream.md index 23c09b2d9..15fddb45c 100644 --- a/docs/docs/configuration/restream.md +++ b/docs/docs/configuration/restream.md @@ -40,7 +40,7 @@ go2rtc: ## RTMP (Deprecated) -In previous Frigate versions RTMP was used for re-streaming. RTMP has disadvantages however including being incompatible with H.265, high bitrates, and certain audio codecs. RTMP is deprecated and it is recommended to move to the new restream role. +In previous Frigate versions RTMP was used for re-streaming. RTMP has disadvantages however including being incompatible with H.265, high bitrates, and certain audio codecs. RTMP is deprecated and it is recommended use the built in go2rtc config for restreaming. ## Reduce Connections To Camera From 4c1d34f0e9c41692b7cce737ba8f4bfe4145a53b Mon Sep 17 00:00:00 2001 From: Hydromel Victor Doledji Date: Wed, 3 Jan 2024 23:39:51 +0000 Subject: [PATCH 14/58] update docs to clarify variable substitution in go2rtc (#9181) * update docs to clarify variable substitution in go2rtc * update to complet * cleanup spacing --------- Co-authored-by: Nicolas Mowen --- docs/docs/configuration/index.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/docs/configuration/index.md b/docs/docs/configuration/index.md index 86f5174ae..6fc7873f2 100644 --- a/docs/docs/configuration/index.md +++ b/docs/docs/configuration/index.md @@ -47,6 +47,13 @@ onvif: password: "{FRIGATE_RTSP_PASSWORD}" ``` +```yaml +go2rtc: + rtsp: + username: "{FRIGATE_GO2RTC_RTSP_USERNAME}" + password: "{FRIGATE_GO2RTC_RTSP_PASSWORD}" +``` + ### Full configuration reference: :::caution From 66701b9cf9bd75fa2d33bdb77052d0fb12115656 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 3 Jan 2024 17:40:43 -0600 Subject: [PATCH 15/58] note that only 5MP reolink cameras support the recommended config (#9190) * Make note that only 5MP and lower reolink cameras support the recommended config * clarify --- docs/docs/configuration/camera_specific.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/docs/configuration/camera_specific.md b/docs/docs/configuration/camera_specific.md index b9b2fefb9..7c1fe4f84 100644 --- a/docs/docs/configuration/camera_specific.md +++ b/docs/docs/configuration/camera_specific.md @@ -105,6 +105,12 @@ If available, recommended settings are: According to [this discussion](https://github.com/blakeblackshear/frigate/issues/3235#issuecomment-1135876973), the http video streams seem to be the most reliable for Reolink. +:::caution + +The below configuration only works for reolink cameras with stream resolution of 5MP or lower, 8MP+ cameras need to use RTSP as http-flv is not supported in this case. + +::: + ```yaml go2rtc: streams: From c5ccc0fb08cdcfd35d2dae534724103bfb7c82a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Lindh=C3=A9?= Date: Thu, 4 Jan 2024 00:58:40 +0100 Subject: [PATCH 16/58] Fix typo: an environment variables (#9157) --- docs/docs/configuration/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/configuration/index.md b/docs/docs/configuration/index.md index 6fc7873f2..8d7547b72 100644 --- a/docs/docs/configuration/index.md +++ b/docs/docs/configuration/index.md @@ -77,11 +77,11 @@ mqtt: # NOTE: must be unique if you are running multiple instances client_id: frigate # Optional: user - # NOTE: MQTT user can be specified with an environment variables or docker secrets that must begin with 'FRIGATE_'. + # NOTE: MQTT user can be specified with an environment variable or docker secrets that must begin with 'FRIGATE_'. # e.g. user: '{FRIGATE_MQTT_USER}' user: mqtt_user # Optional: password - # NOTE: MQTT password can be specified with an environment variables or docker secrets that must begin with 'FRIGATE_'. + # NOTE: MQTT password can be specified with an environment variable or docker secrets that must begin with 'FRIGATE_'. # e.g. password: '{FRIGATE_MQTT_PASSWORD}' password: password # Optional: tls_ca_certs for enabling TLS using self-signed certs (default: None) From 487c626e00fde9211d3dfcbad6143132d0e3878a Mon Sep 17 00:00:00 2001 From: danielszilagyi <76160997+danielszilagyi@users.noreply.github.com> Date: Mon, 22 Jan 2024 06:07:38 +0100 Subject: [PATCH 17/58] Mention NVR setup (#9404) --- docs/docs/configuration/camera_specific.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/docs/configuration/camera_specific.md b/docs/docs/configuration/camera_specific.md index 7c1fe4f84..96299c7c4 100644 --- a/docs/docs/configuration/camera_specific.md +++ b/docs/docs/configuration/camera_specific.md @@ -105,6 +105,9 @@ If available, recommended settings are: According to [this discussion](https://github.com/blakeblackshear/frigate/issues/3235#issuecomment-1135876973), the http video streams seem to be the most reliable for Reolink. +Cameras connected via a Reolink NVR can be connected with the http stream, use `channel[0..15]` in the stream url for the additional channels. +The setup of main stream can be also done via RTSP, but isn't always reliable on all hardware versions. The example configuration is working with the oldest HW version RLN16-410 device with multiple types of cameras. + :::caution The below configuration only works for reolink cameras with stream resolution of 5MP or lower, 8MP+ cameras need to use RTSP as http-flv is not supported in this case. @@ -118,6 +121,11 @@ go2rtc: - "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=username&password=password#video=copy#audio=copy#audio=opus" your_reolink_camera_sub: - "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=username&password=password" + your_reolink_camera_via_nvr: + - "ffmpeg:http://reolink_nvr_ip/flv?port=1935&app=bcs&stream=channel3_main.bcs&user=username&password=password" # channel numbers are 0-15 + - "ffmpeg:your_reolink_camera_via_nvr#audio=aac" + your_reolink_camera_via_nvr_sub: + - "ffmpeg:http://reolink_nvr_ip/flv?port=1935&app=bcs&stream=channel3_ext.bcs&user=username&password=password" cameras: your_reolink_camera: @@ -131,6 +139,17 @@ cameras: input_args: preset-rtsp-restream roles: - detect + reolink_via_nvr: + ffmpeg: + inputs: + - path: rtsp://127.0.0.1:8554/your_reolink_camera_via_nvr?video=copy&audio=aac + input_args: preset-rtsp-restream + roles: + - record + - path: rtsp://127.0.0.1:8554/your_reolink_camera_via_nvr_sub?video=copy + input_args: preset-rtsp-restream + roles: + - detect ``` #### Reolink Doorbell From 346524c6602abee5ab00ee007f44389a8452fd60 Mon Sep 17 00:00:00 2001 From: Alex Errant <109672176+AlexErrant@users.noreply.github.com> Date: Sun, 21 Jan 2024 23:08:31 -0600 Subject: [PATCH 18/58] Add `ghcr.io/blakeblackshear/frigate:stable-tensorrt` example (#9383) --- docs/docs/configuration/detectors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/configuration/detectors.md b/docs/docs/configuration/detectors.md index 83291605f..fa2fde345 100644 --- a/docs/docs/configuration/detectors.md +++ b/docs/docs/configuration/detectors.md @@ -168,7 +168,7 @@ volumes: ## NVidia TensorRT Detector -NVidia GPUs may be used for object detection using the TensorRT libraries. Due to the size of the additional libraries, this detector is only provided in images with the `-tensorrt` tag suffix. This detector is designed to work with Yolo models for object detection. +NVidia GPUs may be used for object detection using the TensorRT libraries. Due to the size of the additional libraries, this detector is only provided in images with the `-tensorrt` tag suffix, e.g. `ghcr.io/blakeblackshear/frigate:stable-tensorrt`. This detector is designed to work with Yolo models for object detection. ### Minimum Hardware Support From 700c0fb41092dfeb40c8ba6b45dbfad8120da67f Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 26 Jan 2024 05:13:39 -0700 Subject: [PATCH 19/58] Create glossary for commonly used frigate terms (#9356) * Add glossary with commonly used terms for frigate * Link back to full docs pages * Add glossary to sidebar * Clarifications and grammar fixes Co-authored-by: Blake Blackshear --------- Co-authored-by: Blake Blackshear --- docs/docs/frigate/glossary.md | 58 +++++++++++++++++++++++++++++++++++ docs/sidebars.js | 3 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 docs/docs/frigate/glossary.md diff --git a/docs/docs/frigate/glossary.md b/docs/docs/frigate/glossary.md new file mode 100644 index 000000000..5e31f4485 --- /dev/null +++ b/docs/docs/frigate/glossary.md @@ -0,0 +1,58 @@ +--- +id: glossary +title: Glossary +--- + +The glossary explains terms commonly used in Frigate's documentation. + +## Bounding Box + +A box returned from the object detection model that outlines an object in the frame. These have multiple colors depending on object type in the debug live view. + +## Event + +The time period starting when a tracked object entered the frame and ending when it left the frame, including any time that the object remained still. Events are saved when it is considered a [true positive](#threshold) and meets the requirements for a snapshot or recording to be saved. + +## False Positive + +An incorrect detection of an object type. For example a dog being detected as a person, a chair being detected as a dog, etc. A person being detected in an area you want to ignore is not a false positive. + +## Mask + +There are two types of masks in Frigate. [See the mask docs for more info](/configuration/masks) + +### Motion Mask + +Motion masks prevent detection of [motion](#motion) in masked areas from triggering Frigate to run object detection, but do not prevent objects from being detected if object detection runs due to motion in nearby areas. For example: camera timestamps, skies, the tops of trees, etc. + +### Object Mask + +Object filter masks drop any bounding boxes where the bottom center (overlap doesn't matter) is in the masked area. It forces them to be considered a [false positive](#false_positive) so that they are ignored. + +## Min Score + +The lowest score that an object can be detected with during tracking, any detection with a lower score will be assumed to be a false positive + +## Motion + +When pixels in the current camera frame are different than previous frames. When many nearby pixels are different in the current frame they grouped together and indicated with a red motion box in the live debug view. [See the motion detection docs for more info](/configuration/motion_detection) + +## Region + +A portion of the camera frame that is sent to object detection, regions can be sent due to motion, active objects, or occasionally for stationary objects. These are represented by green boxes in the debug live view. + +## Snapshot Score + +The score shown in a snapshot is the score of that object at that specific moment in time. + +## Threshold + +The threshold is the median score that an object must reach in order to be considered a true positive. + +## Top Score + +The top score for an object is the highest median score for an object. + +## Zone + +Zones are areas of interest, zones can be used for notifications and for limiting the areas where Frigate will create an [event](#event). [See the zone docs for more info](/configuration/zones) \ No newline at end of file diff --git a/docs/sidebars.js b/docs/sidebars.js index 5a71ebfab..af79fea47 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -6,6 +6,7 @@ module.exports = { "frigate/installation", "frigate/camera_setup", "frigate/video_pipeline", + "frigate/glossary", ], Guides: [ "guides/getting_started", @@ -61,7 +62,7 @@ module.exports = { ], "Frigate+": ["plus/index"], Troubleshooting: [ - "troubleshooting/faqs", + "troubleshooting/faqs", "troubleshooting/recordings", "troubleshooting/edgetpu", ], From 393f44aac68f46a18ce447bb5645bc43768b7cf3 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 26 Jan 2024 05:47:02 -0700 Subject: [PATCH 20/58] Use continuous instead of 24/7 (#9329) --- docs/docs/configuration/record.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/docs/configuration/record.md b/docs/docs/configuration/record.md index a14135c9e..f8027369e 100644 --- a/docs/docs/configuration/record.md +++ b/docs/docs/configuration/record.md @@ -15,7 +15,7 @@ As of Frigate 0.12 if there is less than an hour left of storage, the oldest 2 h ## Configuring Recording Retention -Frigate supports both 24/7 and event based recordings with separate retention modes and retention periods. +Frigate supports both continuous and event based recordings with separate retention modes and retention periods. :::tip @@ -23,18 +23,18 @@ Retention configs support decimals meaning they can be configured to retain `0.5 ::: -### 24/7 Recording +### Continuous Recording -The number of days to retain 24/7 recordings can be set via the following config where X is a number, by default 24/7 recording is disabled. +The number of days to retain continuous recordings can be set via the following config where X is a number, by default continuous recording is disabled. ```yaml record: enabled: True retain: - days: 1 # <- number of days to keep 24/7 recordings + days: 1 # <- number of days to keep continuous recordings ``` -24/7 recording supports different retention modes [which are described below](#what-do-the-different-retain-modes-mean) +Continuous recording supports different retention modes [which are described below](#what-do-the-different-retain-modes-mean) ### Event Recording @@ -54,9 +54,9 @@ This configuration will retain recording segments that overlap with events and h ## What do the different retain modes mean? -Frigate saves from the stream with the `record` role in 10 second segments. These options determine which recording segments are kept for 24/7 recording (but can also affect events). +Frigate saves from the stream with the `record` role in 10 second segments. These options determine which recording segments are kept for continuous recording (but can also affect events). -Let's say you have Frigate configured so that your doorbell camera would retain the last **2** days of 24/7 recording. +Let's say you have Frigate configured so that your doorbell camera would retain the last **2** days of continuous recording. - With the `all` option all 48 hours of those two days would be kept and viewable. - With the `motion` option the only parts of those 48 hours would be segments that Frigate detected motion. This is the middle ground option that won't keep all 48 hours, but will likely keep all segments of interest along with the potential for some extra segments. - With the `active_objects` option the only segments that would be kept are those where there was a true positive object that was not considered stationary. @@ -98,7 +98,7 @@ record: car: 7 ``` -## Can I have "24/7" recordings, but only at certain times? +## Can I have "continuous" recordings, but only at certain times? Using Frigate UI, HomeAssistant, or MQTT, cameras can be automated to only record in certain situations or at certain times. From 65c47531f65ba589d932b42d0835dd6967e4864e Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 26 Jan 2024 06:02:26 -0700 Subject: [PATCH 21/58] Update record docs to mention UTC (#9248) * Update record docs to mention UTC * Update docs/docs/configuration/record.md --------- Co-authored-by: Blake Blackshear --- docs/docs/configuration/record.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/configuration/record.md b/docs/docs/configuration/record.md index f8027369e..9ad68d610 100644 --- a/docs/docs/configuration/record.md +++ b/docs/docs/configuration/record.md @@ -3,7 +3,7 @@ id: record title: Recording --- -Recordings can be enabled and are stored at `/media/frigate/recordings`. The folder structure for the recordings is `YYYY-MM-DD/HH//MM.SS.mp4`. These recordings are written directly from your camera stream without re-encoding. Each camera supports a configurable retention policy in the config. Frigate chooses the largest matching retention value between the recording retention and the event retention when determining if a recording should be removed. +Recordings can be enabled and are stored at `/media/frigate/recordings`. The folder structure for the recordings is `YYYY-MM-DD/HH//MM.SS.mp4` in **UTC time**. These recordings are written directly from your camera stream without re-encoding. Each camera supports a configurable retention policy in the config. Frigate chooses the largest matching retention value between the recording retention and the event retention when determining if a recording should be removed. New recording segments are written from the camera stream to cache, they are only moved to disk if they match the setup recording retention policy. From b1a034fbd4eac5bc6613734b1ceb8ce7955f5678 Mon Sep 17 00:00:00 2001 From: Kevin David Date: Fri, 26 Jan 2024 08:17:50 -0500 Subject: [PATCH 22/58] false_positives.md: expand definition of ratios (#9332) I found this thread pretty helpful: https://github.com/blakeblackshear/frigate/issues/8350#issuecomment-1782863838 I figured it'd be worth including in the docs themselves. Co-authored-by: Blake Blackshear --- docs/docs/guides/false_positives.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/docs/guides/false_positives.md b/docs/docs/guides/false_positives.md index a77e9e9f3..bd095c9eb 100644 --- a/docs/docs/guides/false_positives.md +++ b/docs/docs/guides/false_positives.md @@ -36,7 +36,13 @@ False positives can also be reduced by filtering a detection based on its shape. ### Object Proportions -`min_ratio` and `max_ratio` filter on the ratio of width / height of an objects bounding box and can be used to reduce false positives. For example if a false positive is detected as very tall for a dog which is often wider, a `min_ratio` filter can be used to filter out these false positives. +`min_ratio` and `max_ratio` values are compared against a given detected object's width/height ratio (in pixels). If the ratio is outside this range, the object will be ignored as a false positive. This allows objects that are proportionally too short-and-wide (higher ratio) or too tall-and-narrow (smaller ratio) to be ignored. + +:::info + +Conceptually, a ratio of 1 is a square, 0.5 is a "tall skinny" box, and 2 is a "wide flat" box. If `min_ratio` is 1.0, any object that is taller than it is wide will be ignored. Similarly, if `max_ratio` is 1.0, then any object that is wider than it is tall will be ignored. + +::: ## Other Tools From 64a91f552f26ee134461e24c590350fd75328053 Mon Sep 17 00:00:00 2001 From: leccelecce <24962424+leccelecce@users.noreply.github.com> Date: Fri, 26 Jan 2024 13:18:29 +0000 Subject: [PATCH 23/58] Add info logging at startup if vacuuming database (#9432) --- frigate/app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/frigate/app.py b/frigate/app.py index 1535eeaf6..4a3cf48d6 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -271,6 +271,7 @@ class FrigateApp: def init_database(self) -> None: def vacuum_db(db: SqliteExtDatabase) -> None: + logger.info("Running database vacuum") db.execute_sql("VACUUM;") try: From d15ab0922b1f155908b439c0155b8a9ae5710df2 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Tue, 30 Jan 2024 06:14:16 -0600 Subject: [PATCH 24/58] Docs updates (#9476) * revamp plus docs * consolidate label guidance * add some common complete config examples * clarify zone presence * bottom center example of mask * update recommended hardware * update nav * update getting started * add openvino example * explain why we track stationary objects * move false positive guide to config folder * fix link * update record and parked car guide * tweaks --- docs/docs/configuration/index.md | 764 ++++-------------- docs/docs/configuration/masks.md | 14 +- .../object_filters.md} | 10 +- docs/docs/configuration/objects.mdx | 9 +- docs/docs/configuration/record.md | 55 ++ docs/docs/configuration/reference.md | 633 +++++++++++++++ docs/docs/configuration/stationary_objects.md | 32 +- docs/docs/configuration/zones.md | 3 + docs/docs/frigate/hardware.md | 12 +- docs/docs/guides/getting_started.md | 10 +- docs/docs/guides/ha_network_storage.md | 5 +- docs/docs/guides/parked_cars.md | 71 ++ docs/docs/guides/stationary_objects.md | 43 - docs/docs/integrations/plus.md | 8 +- docs/docs/plus/faq.md | 28 + docs/docs/plus/first_model.md | 63 ++ docs/docs/plus/improving_model.md | 33 + docs/docs/plus/index.md | 104 +-- docs/sidebars.js | 14 +- docs/static/img/bottom-center-mask.jpg | Bin 0 -> 59385 bytes docs/static/img/bottom-center.jpg | Bin 0 -> 118010 bytes .../img/plus/false-positive-overlap.jpg | Bin 0 -> 22661 bytes docs/static/img/plus/false-positive.jpg | Bin 0 -> 46080 bytes docs/static/img/plus/model-ready-email.jpg | Bin 0 -> 33994 bytes docs/static/img/plus/plus-models.jpg | Bin 0 -> 72853 bytes docs/static/img/plus/send-to-plus.jpg | Bin 0 -> 58675 bytes docs/static/img/plus/submit-to-plus.jpg | Bin 0 -> 64958 bytes docs/static/img/send-to-plus.png | Bin 39870 -> 0 bytes 28 files changed, 1142 insertions(+), 769 deletions(-) rename docs/docs/{guides/false_positives.md => configuration/object_filters.md} (95%) create mode 100644 docs/docs/configuration/reference.md create mode 100644 docs/docs/guides/parked_cars.md delete mode 100644 docs/docs/guides/stationary_objects.md create mode 100644 docs/docs/plus/faq.md create mode 100644 docs/docs/plus/first_model.md create mode 100644 docs/docs/plus/improving_model.md create mode 100644 docs/static/img/bottom-center-mask.jpg create mode 100644 docs/static/img/bottom-center.jpg create mode 100644 docs/static/img/plus/false-positive-overlap.jpg create mode 100644 docs/static/img/plus/false-positive.jpg create mode 100644 docs/static/img/plus/model-ready-email.jpg create mode 100644 docs/static/img/plus/plus-models.jpg create mode 100644 docs/static/img/plus/send-to-plus.jpg create mode 100644 docs/static/img/plus/submit-to-plus.jpg delete mode 100644 docs/static/img/send-to-plus.png diff --git a/docs/docs/configuration/index.md b/docs/docs/configuration/index.md index 8d7547b72..53993af67 100644 --- a/docs/docs/configuration/index.md +++ b/docs/docs/configuration/index.md @@ -1,33 +1,35 @@ --- id: index -title: Frigate Configuration Reference +title: Frigate Configuration --- For Home Assistant Addon installations, the config file needs to be in the root of your Home Assistant config directory (same location as `configuration.yaml`). It can be named `frigate.yaml` or `frigate.yml`, but if both files exist `frigate.yaml` will be preferred and `frigate.yml` will be ignored. For all other installation types, the config file should be mapped to `/config/config.yml` inside the container. -It is recommended to start with a minimal configuration and add to it as described in [this guide](../guides/getting_started.md): +It is recommended to start with a minimal configuration and add to it as described in [this guide](../guides/getting_started.md) and use the built in configuration editor in Frigate's UI which supports validation. ```yaml mqtt: - host: mqtt.server.com + enabled: False + cameras: - back: + dummy_camera: # <--- this will be changed to your actual camera later + enabled: False ffmpeg: inputs: - - path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2 + - path: rtsp://127.0.0.1:554/rtsp roles: - detect ``` -### VSCode Configuration Schema +## VSCode Configuration Schema VSCode (and VSCode addon) supports the JSON schemas which will automatically validate the config. This can be added by adding `# yaml-language-server: $schema=http://frigate_host:5000/api/config/schema.json` to the top of the config file. `frigate_host` being the IP address of Frigate or `ccab4aaf-frigate` if running in the addon. -### Environment Variable Substitution +## Environment Variable Substitution -Frigate supports the use of environment variables starting with `FRIGATE_` **only** where specifically indicated in the configuration reference below. For example, the following values can be replaced at runtime by using environment variables: +Frigate supports the use of environment variables starting with `FRIGATE_` **only** where specifically indicated in the [reference config](./reference.md). For example, the following values can be replaced at runtime by using environment variables: ```yaml mqtt: @@ -54,631 +56,181 @@ go2rtc: password: "{FRIGATE_GO2RTC_RTSP_PASSWORD}" ``` -### Full configuration reference: +## Common configuration examples -:::caution +Here are some common starter configuration examples. Refer to the [reference config](./reference.md) for detailed information about all the config values. -It is not recommended to copy this full configuration file. Only specify values that are different from the defaults. Configuration options and default values may change in future versions. +### Raspberry Pi Home Assistant Addon with USB Coral -::: +- Single camera with 720p, 5fps stream for detect +- MQTT connected to home assistant mosquitto addon +- Hardware acceleration for decoding video +- USB Coral detector +- Save all video with any detectable motion for 7 days regardless of whether any objects were detected or not +- Continue to keep all video if it was during any event for 30 days +- Save snapshots for 30 days +- Motion mask for the camera timestamp ```yaml mqtt: - # Optional: Enable mqtt server (default: shown below) - enabled: True - # Required: host name - host: mqtt.server.com - # Optional: port (default: shown below) - port: 1883 - # Optional: topic prefix (default: shown below) - # NOTE: must be unique if you are running multiple instances - topic_prefix: frigate - # Optional: client id (default: shown below) - # NOTE: must be unique if you are running multiple instances - client_id: frigate - # Optional: user - # NOTE: MQTT user can be specified with an environment variable or docker secrets that must begin with 'FRIGATE_'. - # e.g. user: '{FRIGATE_MQTT_USER}' - user: mqtt_user - # Optional: password - # NOTE: MQTT password can be specified with an environment variable or docker secrets that must begin with 'FRIGATE_'. - # e.g. password: '{FRIGATE_MQTT_PASSWORD}' - password: password - # Optional: tls_ca_certs for enabling TLS using self-signed certs (default: None) - tls_ca_certs: /path/to/ca.crt - # Optional: tls_client_cert and tls_client key in order to use self-signed client - # certificates (default: None) - # NOTE: certificate must not be password-protected - # do not set user and password when using a client certificate - tls_client_cert: /path/to/client.crt - tls_client_key: /path/to/client.key - # Optional: tls_insecure (true/false) for enabling TLS verification of - # the server hostname in the server certificate (default: None) - tls_insecure: false - # Optional: interval in seconds for publishing stats (default: shown below) - stats_interval: 60 + host: core-mosquitto + user: mqtt-user + password: xxxxxxxxxx -# Optional: Detectors configuration. Defaults to a single CPU detector -detectors: - # Required: name of the detector - detector_name: - # Required: type of the detector - # Frigate provided types include 'cpu', 'edgetpu', 'openvino' and 'tensorrt' (default: shown below) - # Additional detector types can also be plugged in. - # Detectors may require additional configuration. - # Refer to the Detectors configuration page for more information. - type: cpu - -# Optional: Database configuration -database: - # The path to store the SQLite DB (default: shown below) - path: /config/frigate.db - -# Optional: model modifications -model: - # Optional: path to the model (default: automatic based on detector) - path: /edgetpu_model.tflite - # Optional: path to the labelmap (default: shown below) - labelmap_path: /labelmap.txt - # Required: Object detection model input width (default: shown below) - width: 320 - # Required: Object detection model input height (default: shown below) - height: 320 - # Optional: Object detection model input colorspace - # Valid values are rgb, bgr, or yuv. (default: shown below) - input_pixel_format: rgb - # Optional: Object detection model input tensor format - # Valid values are nhwc or nchw (default: shown below) - input_tensor: nhwc - # Optional: Object detection model type, currently only used with the OpenVINO detector - # Valid values are ssd, yolox, yolov5, or yolov8 (default: shown below) - model_type: ssd - # Optional: Label name modifications. These are merged into the standard labelmap. - labelmap: - 2: vehicle - -# Optional: Audio Events Configuration -# NOTE: Can be overridden at the camera level -audio: - # Optional: Enable audio events (default: shown below) - enabled: False - # Optional: Configure the amount of seconds without detected audio to end the event (default: shown below) - max_not_heard: 30 - # Optional: Configure the min rms volume required to run audio detection (default: shown below) - # As a rule of thumb: - # - 200 - high sensitivity - # - 500 - medium sensitivity - # - 1000 - low sensitivity - min_volume: 500 - # Optional: Types of audio to listen for (default: shown below) - listen: - - bark - - fire_alarm - - scream - - speech - - yell - # Optional: Filters to configure detection. - filters: - # Label that matches label in listen config. - speech: - # Minimum score that triggers an audio event (default: shown below) - threshold: 0.8 - -# Optional: logger verbosity settings -logger: - # Optional: Default log verbosity (default: shown below) - default: info - # Optional: Component specific logger overrides - logs: - frigate.event: debug - -# Optional: set environment variables -environment_vars: - EXAMPLE_VAR: value - -# Optional: birdseye configuration -# NOTE: Can (enabled, mode) be overridden at the camera level -birdseye: - # Optional: Enable birdseye view (default: shown below) - enabled: True - # Optional: Restream birdseye via RTSP (default: shown below) - # NOTE: Enabling this will set birdseye to run 24/7 which may increase CPU usage somewhat. - restream: False - # Optional: Width of the output resolution (default: shown below) - width: 1280 - # Optional: Height of the output resolution (default: shown below) - height: 720 - # Optional: Encoding quality of the mpeg1 feed (default: shown below) - # 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources. - quality: 8 - # Optional: Mode of the view. Available options are: objects, motion, and continuous - # objects - cameras are included if they have had a tracked object within the last 30 seconds - # motion - cameras are included if motion was detected in the last 30 seconds - # continuous - all cameras are included always - mode: objects - -# Optional: ffmpeg configuration -# More information about presets at https://docs.frigate.video/configuration/ffmpeg_presets ffmpeg: - # Optional: global ffmpeg args (default: shown below) - global_args: -hide_banner -loglevel warning -threads 2 - # Optional: global hwaccel args (default: shown below) - # NOTE: See hardware acceleration docs for your specific device - hwaccel_args: [] - # Optional: global input args (default: shown below) - input_args: preset-rtsp-generic - # Optional: global output args - output_args: - # Optional: output args for detect streams (default: shown below) - detect: -threads 2 -f rawvideo -pix_fmt yuv420p - # Optional: output args for record streams (default: shown below) - record: preset-record-generic - # Optional: output args for rtmp streams (default: shown below) - rtmp: preset-rtmp-generic - # Optional: Time in seconds to wait before ffmpeg retries connecting to the camera. (default: shown below) - # If set too low, frigate will retry a connection to the camera's stream too frequently, using up the limited streams some cameras can allow at once - # If set too high, then if a ffmpeg crash or camera stream timeout occurs, you could potentially lose up to a maximum of retry_interval second(s) of footage - # NOTE: this can be a useful setting for Wireless / Battery cameras to reduce how much footage is potentially lost during a connection timeout. - retry_interval: 10 + hwaccel_args: preset-rpi-64-h264 -# Optional: Detect configuration -# NOTE: Can be overridden at the camera level -detect: - # Optional: width of the frame for the input with the detect role (default: use native stream resolution) - width: 1280 - # Optional: height of the frame for the input with the detect role (default: use native stream resolution) - height: 720 - # Optional: desired fps for your camera for the input with the detect role (default: shown below) - # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera. - fps: 5 - # Optional: enables detection for the camera (default: True) - enabled: True - # Optional: Number of consecutive detection hits required for an object to be initialized in the tracker. (default: 1/2 the frame rate) - min_initialized: 2 - # Optional: Number of frames without a detection before Frigate considers an object to be gone. (default: 5x the frame rate) - max_disappeared: 25 - # Optional: Configuration for stationary object tracking - stationary: - # Optional: Frequency for confirming stationary objects (default: same as threshold) - # When set to 1, object detection will run to confirm the object still exists on every frame. - # If set to 10, object detection will run to confirm the object still exists on every 10th frame. - interval: 50 - # Optional: Number of frames without a position change for an object to be considered stationary (default: 10x the frame rate or 10s) - threshold: 50 - # Optional: Define a maximum number of frames for tracking a stationary object (default: not set, track forever) - # This can help with false positives for objects that should only be stationary for a limited amount of time. - # It can also be used to disable stationary object tracking. For example, you may want to set a value for person, but leave - # car at the default. - # WARNING: Setting these values overrides default behavior and disables stationary object tracking. - # There are very few situations where you would want it disabled. It is NOT recommended to - # copy these values from the example config into your config unless you know they are needed. - max_frames: - # Optional: Default for all object types (default: not set, track forever) - default: 3000 - # Optional: Object specific values - objects: - person: 1000 - # Optional: Milliseconds to offset detect annotations by (default: shown below). - # There can often be latency between a recording and the detect process, - # especially when using separate streams for detect and record. - # Use this setting to make the timeline bounding boxes more closely align - # with the recording. The value can be positive or negative. - # TIP: Imagine there is an event clip with a person walking from left to right. - # If the event timeline bounding box is consistently to the left of the person - # then the value should be decreased. Similarly, if a person is walking from - # left to right and the bounding box is consistently ahead of the person - # then the value should be increased. - # TIP: This offset is dynamic so you can change the value and it will update existing - # events, this makes it easy to tune. - # WARNING: Fast moving objects will likely not have the bounding box align. - annotation_offset: 0 +detectors: + coral: + type: edgetpu + device: usb -# Optional: Object configuration -# NOTE: Can be overridden at the camera level -objects: - # Optional: list of objects to track from labelmap.txt (default: shown below) - track: - - person - # Optional: mask to prevent all object types from being detected in certain areas (default: no mask) - # Checks based on the bottom center of the bounding box of the object. - # NOTE: This mask is COMBINED with the object type specific mask below - mask: 0,0,1000,0,1000,200,0,200 - # Optional: filters to reduce false positives for specific object types - filters: - person: - # Optional: minimum width*height of the bounding box for the detected object (default: 0) - min_area: 5000 - # Optional: maximum width*height of the bounding box for the detected object (default: 24000000) - max_area: 100000 - # Optional: minimum width/height of the bounding box for the detected object (default: 0) - min_ratio: 0.5 - # Optional: maximum width/height of the bounding box for the detected object (default: 24000000) - max_ratio: 2.0 - # Optional: minimum score for the object to initiate tracking (default: shown below) - min_score: 0.5 - # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below) - threshold: 0.7 - # Optional: mask to prevent this object type from being detected in certain areas (default: no mask) - # Checks based on the bottom center of the bounding box of the object - mask: 0,0,1000,0,1000,200,0,200 - -# Optional: Motion configuration -# NOTE: Can be overridden at the camera level -motion: - # Optional: The threshold passed to cv2.threshold to determine if a pixel is different enough to be counted as motion. (default: shown below) - # Increasing this value will make motion detection less sensitive and decreasing it will make motion detection more sensitive. - # The value should be between 1 and 255. - threshold: 30 - # Optional: The percentage of the image used to detect lightning or other substantial changes where motion detection - # needs to recalibrate. (default: shown below) - # Increasing this value will make motion detection more likely to consider lightning or ir mode changes as valid motion. - # Decreasing this value will make motion detection more likely to ignore large amounts of motion such as a person approaching - # a doorbell camera. - lightning_threshold: 0.8 - # Optional: Minimum size in pixels in the resized motion image that counts as motion (default: shown below) - # Increasing this value will prevent smaller areas of motion from being detected. Decreasing will - # make motion detection more sensitive to smaller moving objects. - # As a rule of thumb: - # - 10 - high sensitivity - # - 30 - medium sensitivity - # - 50 - low sensitivity - contour_area: 10 - # Optional: Alpha value passed to cv2.accumulateWeighted when averaging frames to determine the background (default: shown below) - # Higher values mean the current frame impacts the average a lot, and a new object will be averaged into the background faster. - # Low values will cause things like moving shadows to be detected as motion for longer. - # https://www.geeksforgeeks.org/background-subtraction-in-an-image-using-concept-of-running-average/ - frame_alpha: 0.01 - # Optional: Height of the resized motion frame (default: 100) - # Higher values will result in more granular motion detection at the expense of higher CPU usage. - # Lower values result in less CPU, but small changes may not register as motion. - frame_height: 100 - # Optional: motion mask - # NOTE: see docs for more detailed info on creating masks - mask: 0,900,1080,900,1080,1920,0,1920 - # Optional: improve contrast (default: shown below) - # Enables dynamic contrast improvement. This should help improve night detections at the cost of making motion detection more sensitive - # for daytime. - improve_contrast: True - # Optional: Delay when updating camera motion through MQTT from ON -> OFF (default: shown below). - mqtt_off_delay: 30 - -# Optional: Record configuration -# NOTE: Can be overridden at the camera level record: - # Optional: Enable recording (default: shown below) - # WARNING: If recording is disabled in the config, turning it on via - # the UI or MQTT later will have no effect. - enabled: False - # Optional: Number of minutes to wait between cleanup runs (default: shown below) - # This can be used to reduce the frequency of deleting recording segments from disk if you want to minimize i/o - expire_interval: 60 - # Optional: Sync recordings with disk on startup and once a day (default: shown below). - sync_recordings: False - # Optional: Retention settings for recording + enabled: True retain: - # Optional: Number of days to retain recordings regardless of events (default: shown below) - # NOTE: This should be set to 0 and retention should be defined in events section below - # if you only want to retain recordings of events. - days: 0 - # Optional: Mode for retention. Available options are: all, motion, and active_objects - # all - save all recording segments regardless of activity - # motion - save all recordings segments with any detected motion - # active_objects - save all recording segments with active/moving objects - # NOTE: this mode only applies when the days setting above is greater than 0 - mode: all - # Optional: Recording Export Settings - export: - # Optional: Timelapse Output Args (default: shown below). - # NOTE: The default args are set to fit 24 hours of recording into 1 hour playback. - # See https://stackoverflow.com/a/58268695 for more info on how these args work. - # As an example: if you wanted to go from 24 hours to 30 minutes that would be going - # from 86400 seconds to 1800 seconds which would be 1800 / 86400 = 0.02. - # The -r (framerate) dictates how smooth the output video is. - # So the args would be -vf setpts=0.02*PTS -r 30 in that case. - timelapse_args: "-vf setpts=0.04*PTS -r 30" - # Optional: Event recording settings + days: 7 + mode: motion events: - # Optional: Number of seconds before the event to include (default: shown below) - pre_capture: 5 - # Optional: Number of seconds after the event to include (default: shown below) - post_capture: 5 - # Optional: Objects to save recordings for. (default: all tracked objects) - objects: - - person - # Optional: Restrict recordings to objects that entered any of the listed zones (default: no required zones) - required_zones: [] - # Optional: Retention settings for recordings of events retain: - # Required: Default retention days (default: shown below) - default: 10 - # Optional: Mode for retention. (default: shown below) - # all - save all recording segments for events regardless of activity - # motion - save all recordings segments for events with any detected motion - # active_objects - save all recording segments for event with active/moving objects - # - # NOTE: If the retain mode for the camera is more restrictive than the mode configured - # here, the segments will already be gone by the time this mode is applied. - # For example, if the camera retain mode is "motion", the segments without motion are - # never stored, so setting the mode to "all" here won't bring them back. + default: 30 mode: motion - # Optional: Per object retention days - objects: - person: 15 -# Optional: Configuration for the jpg snapshots written to the clips directory for each event -# NOTE: Can be overridden at the camera level snapshots: - # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below) - enabled: False - # Optional: save a clean PNG copy of the snapshot image (default: shown below) - clean_copy: True - # Optional: print a timestamp on the snapshots (default: shown below) - timestamp: False - # Optional: draw bounding box on the snapshots (default: shown below) - bounding_box: True - # Optional: crop the snapshot (default: shown below) - crop: False - # Optional: height to resize the snapshot to (default: original size) - height: 175 - # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones) - required_zones: [] - # Optional: Camera override for retention settings (default: global values) + enabled: True retain: - # Required: Default retention days (default: shown below) - default: 10 - # Optional: Per object retention days - objects: - person: 15 - # Optional: quality of the encoded jpeg, 0-100 (default: shown below) - quality: 70 + default: 30 -# Optional: RTMP configuration -# NOTE: RTMP is deprecated in favor of restream -# NOTE: Can be overridden at the camera level -rtmp: - # Optional: Enable the RTMP stream (default: False) +cameras: + name_of_your_camera: + detect: + width: 1280 + height: 720 + fps: 5 + ffmpeg: + inputs: + - path: rtsp://10.0.10.10:554/rtsp + roles: + - detect + motion: + mask: + - 0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432 +``` + +### Standalone Intel Mini PC with USB Coral + +- Single camera with 720p, 5fps stream for detect +- MQTT disabled (not integrated with home assistant) +- VAAPI hardware acceleration for decoding video +- USB Coral detector +- Save all video with any detectable motion for 7 days regardless of whether any objects were detected or not +- Continue to keep all video if it was during any event for 30 days +- Save snapshots for 30 days +- Motion mask for the camera timestamp + +```yaml +mqtt: enabled: False -# Optional: Restream configuration -# Uses https://github.com/AlexxIT/go2rtc (v1.8.3) -go2rtc: +ffmpeg: + hwaccel_args: preset-vaapi -# Optional: jsmpeg stream configuration for WebUI -live: - # Optional: Set the name of the stream that should be used for live view - # in frigate WebUI. (default: name of camera) - stream_name: camera_name - # Optional: Set the height of the jsmpeg stream. (default: 720) - # This must be less than or equal to the height of the detect stream. Lower resolutions - # reduce bandwidth required for viewing the jsmpeg stream. Width is computed to match known aspect ratio. - height: 720 - # Optional: Set the encode quality of the jsmpeg stream (default: shown below) - # 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources. - quality: 8 +detectors: + coral: + type: edgetpu + device: usb -# Optional: in-feed timestamp style configuration -# NOTE: Can be overridden at the camera level -timestamp_style: - # Optional: Position of the timestamp (default: shown below) - # "tl" (top left), "tr" (top right), "bl" (bottom left), "br" (bottom right) - position: "tl" - # Optional: Format specifier conform to the Python package "datetime" (default: shown below) - # Additional Examples: - # german: "%d.%m.%Y %H:%M:%S" - format: "%m/%d/%Y %H:%M:%S" - # Optional: Color of font - color: - # All Required when color is specified (default: shown below) - red: 255 - green: 255 - blue: 255 - # Optional: Line thickness of font (default: shown below) - thickness: 2 - # Optional: Effect of lettering (default: shown below) - # None (No effect), - # "solid" (solid background in inverse color of font) - # "shadow" (shadow for font) - effect: None +record: + enabled: True + retain: + days: 7 + mode: motion + events: + retain: + default: 30 + mode: motion + +snapshots: + enabled: True + retain: + default: 30 -# Required cameras: - # Required: name of the camera - back: - # 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 + name_of_your_camera: + detect: + width: 1280 + height: 720 + fps: 5 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 or docker secrets, which must begin with 'FRIGATE_' and be referenced in {} - - path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2 - # Required: list of roles for this stream. valid values are: audio,detect,record,rtmp - # NOTICE: In addition to assigning the audio, record, and rtmp roles, - # they must also be enabled in the camera config. + - path: rtsp://10.0.10.10:554/rtsp roles: - - audio - detect - - record - - rtmp - # Optional: stream specific global args (default: inherit) - # global_args: - # Optional: stream specific hwaccel args (default: inherit) - # hwaccel_args: - # Optional: stream specific input args (default: inherit) - # input_args: - # Optional: camera specific global args (default: inherit) - # global_args: - # Optional: camera specific hwaccel args (default: inherit) - # hwaccel_args: - # Optional: camera specific input args (default: inherit) - # input_args: - # Optional: camera specific output args (default: inherit) - # output_args: - - # Optional: timeout for highest scoring image before allowing it - # to be replaced by a newer image. (default: shown below) - best_image_timeout: 60 - - # Optional: URL to visit the camera web UI directly from the system page. Might not be available on every camera. - webui_url: "" - - # Optional: zones for this camera - zones: - # Required: name of the zone - # NOTE: This must be different than any camera names, but can match with another zone on another - # camera. - front_steps: - # Required: List of x,y coordinates to define the polygon of the zone. - # NOTE: Presence in a zone is evaluated only based on the bottom center of the objects bounding box. - coordinates: 545,1077,747,939,788,805 - # Optional: Number of consecutive frames required for object to be considered present in the zone (default: shown below). - inertia: 3 - # Optional: List of objects that can trigger this zone (default: all tracked objects) - objects: - - person - # Optional: Zone level object filters. - # NOTE: The global and camera filters are applied upstream. - filters: - person: - min_area: 5000 - max_area: 100000 - threshold: 0.7 - - # Optional: Configuration for the jpg snapshots published via MQTT - mqtt: - # Optional: Enable publishing snapshot via mqtt for camera (default: shown below) - # NOTE: Only applies to publishing image data to MQTT via 'frigate///snapshot'. - # All other messages will still be published. - enabled: True - # Optional: print a timestamp on the snapshots (default: shown below) - timestamp: True - # Optional: draw bounding box on the snapshots (default: shown below) - bounding_box: True - # Optional: crop the snapshot (default: shown below) - crop: True - # Optional: height to resize the snapshot to (default: shown below) - height: 270 - # Optional: jpeg encode quality (default: shown below) - quality: 70 - # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones) - required_zones: [] - - # Optional: Configuration for how camera is handled in the GUI. - ui: - # Optional: Adjust sort order of cameras in the UI. Larger numbers come later (default: shown below) - # By default the cameras are sorted alphabetically. - order: 0 - # Optional: Whether or not to show the camera in the Frigate UI (default: shown below) - dashboard: True - - # Optional: connect to ONVIF camera - # to enable PTZ controls. - onvif: - # Required: host of the camera being connected to. - host: 0.0.0.0 - # Optional: ONVIF port for device (default: shown below). - port: 8000 - # Optional: username for login. - # NOTE: Some devices require admin to access ONVIF. - user: admin - # Optional: password for login. - password: admin - # Optional: PTZ camera object autotracking. Keeps a moving object in - # the center of the frame by automatically moving the PTZ camera. - autotracking: - # Optional: enable/disable object autotracking. (default: shown below) - enabled: False - # Optional: calibrate the camera on startup (default: shown below) - # A calibration will move the PTZ in increments and measure the time it takes to move. - # The results are used to help estimate the position of tracked objects after a camera move. - # Frigate will update your config file automatically after a calibration with - # a "movement_weights" entry for the camera. You should then set calibrate_on_startup to False. - calibrate_on_startup: False - # Optional: the mode to use for zooming in/out on objects during autotracking. (default: shown below) - # Available options are: disabled, absolute, and relative - # disabled - don't zoom in/out on autotracked objects, use pan/tilt only - # absolute - use absolute zooming (supported by most PTZ capable cameras) - # relative - use relative zooming (not supported on all PTZs, but makes concurrent pan/tilt/zoom movements) - zooming: disabled - # Optional: A value to change the behavior of zooming on autotracked objects. (default: shown below) - # A lower value will keep more of the scene in view around a tracked object. - # A higher value will zoom in more on a tracked object, but Frigate may lose tracking more quickly. - # The value should be between 0.1 and 0.75 - zoom_factor: 0.3 - # Optional: list of objects to track from labelmap.txt (default: shown below) - track: - - person - # Required: Begin automatically tracking an object when it enters any of the listed zones. - required_zones: - - zone_name - # Required: Name of ONVIF preset in camera's firmware to return to when tracking is over. (default: shown below) - return_preset: home - # Optional: Seconds to delay before returning to preset. (default: shown below) - timeout: 10 - # Optional: Values generated automatically by a camera calibration. Do not modify these manually. (default: shown below) - movement_weights: [] - - # Optional: Configuration for how to sort the cameras in the Birdseye view. - birdseye: - # Optional: Adjust sort order of cameras in the Birdseye view. Larger numbers come later (default: shown below) - # By default the cameras are sorted alphabetically. - order: 0 - -# Optional -ui: - # Optional: Set the default live mode for cameras in the UI (default: shown below) - live_mode: mse - # Optional: Set a timezone to use in the UI (default: use browser local time) - # timezone: America/Denver - # Optional: Use an experimental recordings / camera view UI (default: shown below) - use_experimental: False - # Optional: Set the time format used. - # Options are browser, 12hour, or 24hour (default: shown below) - time_format: browser - # Optional: Set the date style for a specified length. - # Options are: full, long, medium, short - # Examples: - # short: 2/11/23 - # medium: Feb 11, 2023 - # full: Saturday, February 11, 2023 - # (default: shown below). - date_style: short - # Optional: Set the time style for a specified length. - # Options are: full, long, medium, short - # Examples: - # short: 8:14 PM - # medium: 8:15:22 PM - # full: 8:15:22 PM Mountain Standard Time - # (default: shown below). - time_style: medium - # Optional: Ability to manually override the date / time styling to use strftime format - # https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html - # possible values are shown above (default: not set) - strftime_fmt: "%Y/%m/%d %H:%M" - -# Optional: Telemetry configuration -telemetry: - # Optional: Enabled network interfaces for bandwidth stats monitoring (default: empty list, let nethogs search all) - network_interfaces: - - eth - - enp - - eno - - ens - - wl - - lo - # Optional: Configure system stats - stats: - # Enable AMD GPU stats (default: shown below) - amd_gpu_stats: True - # Enable Intel GPU stats (default: shown below) - intel_gpu_stats: True - # Enable network bandwidth stats monitoring for camera ffmpeg processes, go2rtc, and object detectors. (default: shown below) - # NOTE: The container must either be privileged or have cap_net_admin, cap_net_raw capabilities enabled. - network_bandwidth: False - # Optional: Enable the latest version outbound check (default: shown below) - # NOTE: If you use the HomeAssistant integration, disabling this will prevent it from reporting new versions - version_check: True + motion: + mask: + - 0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432 +``` + +### Home Assistant integrated Intel Mini PC with OpenVino + +- Single camera with 720p, 5fps stream for detect +- MQTT connected to same mqtt server as home assistant +- VAAPI hardware acceleration for decoding video +- OpenVino detector +- Save all video with any detectable motion for 7 days regardless of whether any objects were detected or not +- Continue to keep all video if it was during any event for 30 days +- Save snapshots for 30 days +- Motion mask for the camera timestamp + +```yaml +mqtt: + host: 192.168.X.X # <---- same mqtt broker that home assistant uses + user: mqtt-user + password: xxxxxxxxxx + +ffmpeg: + hwaccel_args: preset-vaapi + +detectors: + ov: + type: openvino + device: AUTO + model: + path: /openvino-model/ssdlite_mobilenet_v2.xml + +model: + width: 300 + height: 300 + input_tensor: nhwc + input_pixel_format: bgr + labelmap_path: /openvino-model/coco_91cl_bkgr.txt + +record: + enabled: True + retain: + days: 7 + mode: motion + events: + retain: + default: 30 + mode: motion + +snapshots: + enabled: True + retain: + default: 30 + +cameras: + name_of_your_camera: + detect: + width: 1280 + height: 720 + fps: 5 + ffmpeg: + inputs: + - path: rtsp://10.0.10.10:554/rtsp + roles: + - detect + motion: + mask: + - 0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432 ``` diff --git a/docs/docs/configuration/masks.md b/docs/docs/configuration/masks.md index 321b909cb..ae64e7e5f 100644 --- a/docs/docs/configuration/masks.md +++ b/docs/docs/configuration/masks.md @@ -3,11 +3,19 @@ id: masks title: Masks --- -There are two types of masks available: +## Motion masks -**Motion masks**: Motion masks are used to prevent unwanted types of motion from triggering detection. Try watching the debug feed with `Motion Boxes` enabled to see what may be regularly detected as motion. For example, you want to mask out your timestamp, the sky, rooftops, etc. Keep in mind that this mask only prevents motion from being detected and does not prevent objects from being detected if object detection was started due to motion in unmasked areas. Motion is also used during object tracking to refine the object detection area in the next frame. Over masking will make it more difficult for objects to be tracked. To see this effect, create a mask, and then watch the video feed with `Motion Boxes` enabled again. +Motion masks are used to prevent unwanted types of motion from triggering detection. Try watching the debug feed with `Motion Boxes` enabled to see what may be regularly detected as motion. For example, you want to mask out your timestamp, the sky, rooftops, etc. Keep in mind that this mask only prevents motion from being detected and does not prevent objects from being detected if object detection was started due to motion in unmasked areas. Motion is also used during object tracking to refine the object detection area in the next frame. Over masking will make it more difficult for objects to be tracked. To see this effect, create a mask, and then watch the video feed with `Motion Boxes` enabled again. -**Object filter masks**: Object filter masks are used to filter out false positives for a given object type based on location. These should be used to filter any areas where it is not possible for an object of that type to be. The bottom center of the detected object's bounding box is evaluated against the mask. If it is in a masked area, it is assumed to be a false positive. For example, you may want to mask out rooftops, walls, the sky, treetops for people. For cars, masking locations other than the street or your driveway will tell Frigate that anything in your yard is a false positive. +## Object filter masks + +Object filter masks are used to filter out false positives for a given object type based on location. These should be used to filter any areas where it is not possible for an object of that type to be. The bottom center of the detected object's bounding box is evaluated against the mask. If it is in a masked area, it is assumed to be a false positive. For example, you may want to mask out rooftops, walls, the sky, treetops for people. For cars, masking locations other than the street or your driveway will tell Frigate that anything in your yard is a false positive. + +Object filter masks can be used to filter out stubborn false positives in fixed locations. For example, the base of this tree may be frequently detected as a person. The following image shows an example of an object filter mask (shaded red area) over the location where the bottom center is typically located to filter out person detections in a precise location. + +![object mask](/img/bottom-center-mask.jpg) + +## Using the mask creator To create a poly mask: diff --git a/docs/docs/guides/false_positives.md b/docs/docs/configuration/object_filters.md similarity index 95% rename from docs/docs/guides/false_positives.md rename to docs/docs/configuration/object_filters.md index bd095c9eb..5ffb205d0 100644 --- a/docs/docs/guides/false_positives.md +++ b/docs/docs/configuration/object_filters.md @@ -1,8 +1,10 @@ --- -id: false_positives -title: Reducing false positives +id: object_filters +title: Filters --- +There are several types of object filters that can be used to reduce false positive rates. + ## Object Scores For object filters in your configuration, any single detection below `min_score` will be ignored as a false positive. `threshold` is based on the median of the history of scores (padded to 3 values) for a tracked object. Consider the following frames when `min_score` is set to 0.6 and threshold is set to 0.85: @@ -18,6 +20,8 @@ For object filters in your configuration, any single detection below `min_score` In frame 2, the score is below the `min_score` value, so Frigate ignores it and it becomes a 0.0. The computed score is the median of the score history (padding to at least 3 values), and only when that computed score crosses the `threshold` is the object marked as a true positive. That happens in frame 4 in the example. +show image of snapshot vs event with differing scores + ### Minimum Score Any detection below `min_score` will be immediately thrown out and never tracked because it is considered a false positive. If `min_score` is too low then false positives may be detected and tracked which can confuse the object tracker and may lead to wasted resources. If `min_score` is too high then lower scoring true positives like objects that are further away or partially occluded may be thrown out which can also confuse the tracker and cause valid events to be lost or disjointed. @@ -36,7 +40,7 @@ False positives can also be reduced by filtering a detection based on its shape. ### Object Proportions -`min_ratio` and `max_ratio` values are compared against a given detected object's width/height ratio (in pixels). If the ratio is outside this range, the object will be ignored as a false positive. This allows objects that are proportionally too short-and-wide (higher ratio) or too tall-and-narrow (smaller ratio) to be ignored. +`min_ratio` and `max_ratio` values are compared against a given detected object's width/height ratio (in pixels). If the ratio is outside this range, the object will be ignored as a false positive. This allows objects that are proportionally too short-and-wide (higher ratio) or too tall-and-narrow (smaller ratio) to be ignored. :::info diff --git a/docs/docs/configuration/objects.mdx b/docs/docs/configuration/objects.mdx index c15907339..81e74e2fe 100644 --- a/docs/docs/configuration/objects.mdx +++ b/docs/docs/configuration/objects.mdx @@ -1,15 +1,16 @@ --- id: objects -title: Objects +title: Available Objects --- import labels from "../../../labelmap.txt"; Frigate includes the object models listed below from the Google Coral test data. -Please note: - - `car` is listed twice because `truck` has been renamed to `car` by default. These object types are frequently confused. - - `person` is the only tracked object by default. See the [full configuration reference](index.md#full-configuration-reference) for an example of expanding the list of tracked objects. +Please note: + +- `car` is listed twice because `truck` has been renamed to `car` by default. These object types are frequently confused. +- `person` is the only tracked object by default. See the [full configuration reference](index.md#full-configuration-reference) for an example of expanding the list of tracked objects.