From 08f573aaa5ec0b9bf3d4b40388942254448b902a Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sun, 20 Feb 2022 08:17:43 -0600 Subject: [PATCH 1/9] Clarify max_frames setting --- docs/docs/configuration/index.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/docs/configuration/index.md b/docs/docs/configuration/index.md index 5d8638745..0863f3643 100644 --- a/docs/docs/configuration/index.md +++ b/docs/docs/configuration/index.md @@ -170,6 +170,9 @@ detect: # 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 From f4c3bb06179f6f179c7b1980791f31c999f579b5 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Tue, 1 Mar 2022 18:45:56 -0600 Subject: [PATCH 2/9] affiliate link updates --- docs/docs/hardware.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/docs/docs/hardware.md b/docs/docs/hardware.md index 71fe28dfd..74b289969 100644 --- a/docs/docs/hardware.md +++ b/docs/docs/hardware.md @@ -21,19 +21,17 @@ I may earn a small commission for my endorsement, recommendation, testimonial, o ## Server -My current favorite is the Odyssey X86 Blue J4125 because the Coral M.2 compatibility and dual NICs that allow you to setup a dedicated private network for your cameras where they can be blocked from accessing the internet. I may earn a small commission for my endorsement, recommendation, testimonial, or link to any products or services from this website. +My current favorite is the Minisforum GK41 because of the dual NICs that allow you to setup a dedicated private network for your cameras where they can be blocked from accessing the internet. There are many used workstation options on eBay that work very well. Anything with an Intel CPU and capable of running Debian should work fine. As a bonus, you may want to look for devices with a M.2 or PCIe express slot that is compatible with the Google Coral. I may earn a small commission for my endorsement, recommendation, testimonial, or link to any products or services from this website. -| Name | Inference Speed | Coral Compatibility | Notes | -| -------------------------------------------------------------------------------------------------------------------------------- | --------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| Odyssey X86 Blue J4125 (affiliate link) | 9-10ms | M.2 B+M | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. | -| Minisforum GK41 (affiliate link) | 9-10ms | USB | Great alternative to a NUC. Easily handles several 1080p cameras. | -| Minisforum GK50 (affiliate link) | 9-10ms | USB | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. | -| Intel NUC (affiliate link) | 8-10ms | USB | Overkill for most, but great performance. Can handle many cameras at 5fps depending on typical amounts of motion. | -| BMAX B2 Plus (affiliate link) | 10-12ms | USB | Good balance of performance and cost. Also capable of running many other services at the same time as frigate. | -| Atomic Pi (affiliate link) | 16ms | USB | Good option for a dedicated low power board with a small number of cameras. Can leverage Intel QuickSync for stream decoding. | -| Raspberry Pi 3B (32bit) (affiliate link) | 60ms | USB | Can handle a small number of cameras, but the detection speeds are slow due to USB 2.0. | -| Raspberry Pi 4 (32bit) (affiliate link) | 15-20ms | USB | Can handle a small number of cameras. The 2GB version runs fine. | -| Raspberry Pi 4 (64bit) (affiliate link) | 10-15ms | USB | Can handle a small number of cameras. The 2GB version runs fine. | +| Name | Inference Speed | Coral Compatibility | Notes | +| ------------------------------------------------------------------------------------------------------------------------------- | --------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| Odyssey X86 Blue J4125 (affiliate link) | 9-10ms | M.2 B+M | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. | +| Minisforum GK41 (affiliate link) | 9-10ms | USB | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. | +| Beelink GK55 (affiliate link) | 9-10ms | USB | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. | +| Intel NUC (affiliate link) | 8-10ms | USB | Overkill for most, but great performance. Can handle many cameras at 5fps depending on typical amounts of motion. Requires extra parts. | +| BMAX B2 Plus (affiliate link) | 10-12ms | USB | Good balance of performance and cost. Also capable of running many other services at the same time as frigate. | +| Atomic Pi (affiliate link) | 16ms | USB | Good option for a dedicated low power board with a small number of cameras. Can leverage Intel QuickSync for stream decoding. | +| Raspberry Pi 4 (64bit) (affiliate link) | 10-15ms | USB | Can handle a small number of cameras. | ## Google Coral TPU From e4afe50509eb7dda290b439e8599d7db7da00f96 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Thu, 10 Mar 2022 05:37:20 -0700 Subject: [PATCH 3/9] Docs: Update recording docs to include examples of retain modes. (#2914) * Update recording docs to include examples of retain modes. * Minor adjustment Co-authored-by: Blake Blackshear --- docs/docs/configuration/record.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/docs/configuration/record.md b/docs/docs/configuration/record.md index 927daecfe..2194fba0f 100644 --- a/docs/docs/configuration/record.md +++ b/docs/docs/configuration/record.md @@ -21,4 +21,18 @@ record: 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. +When `retain -> days` is set to `0`, segments will be deleted from the cache if no events are in progress. + +## 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). + +Let's say you have frigate configured so that your doorbell camera would retain the last **2** days of 24/7 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. + +The same options are available with events. Let's consider a scenario where you drive up and park in your driveway, go inside, then come back out 4 hours later. +- With the `all` option all segments for the duration of the event would be saved for the event. This event would have 4 hours of footage. +- With the `motion` option all segments for the duration of the event with motion would be saved. This means any segment where a car drove by in the street, person walked by, lighting changed, etc. would be saved. +- With the `active_objects` it would only keep segments where the object was active. In this case the only segments that would be saved would be the ones where the car was driving up, you going inside, you coming outside, and the car driving away. Essentially reducing the 4 hours to a minute or two of event footage. From 0dfba6e8d99643be45ee85680c69d199628a47ec Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Thu, 10 Mar 2022 07:43:58 -0600 Subject: [PATCH 4/9] bump version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 73729b225..4286c438d 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ default_target: amd64_frigate COMMIT_HASH := $(shell git log -1 --pretty=format:"%h"|tail -1) version: - echo "VERSION='0.10.0-$(COMMIT_HASH)'" > frigate/version.py + echo "VERSION='0.10.1-$(COMMIT_HASH)'" > frigate/version.py web: docker build --tag frigate-web --file docker/Dockerfile.web web/ From b1a2b0cda2c5860765aca80e9fd0e8b7ec99156b Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Thu, 10 Mar 2022 07:43:12 -0600 Subject: [PATCH 5/9] make dynamic contrast optional and disable by default --- docs/docs/configuration/index.md | 6 +++++- frigate/config.py | 1 + frigate/motion.py | 17 +++++++++-------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/docs/docs/configuration/index.md b/docs/docs/configuration/index.md index 0863f3643..4f1765192 100644 --- a/docs/docs/configuration/index.md +++ b/docs/docs/configuration/index.md @@ -171,7 +171,7 @@ detect: # 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 + # 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) @@ -236,6 +236,10 @@ motion: # 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: False # Optional: Record configuration # NOTE: Can be overridden at the camera level diff --git a/frigate/config.py b/frigate/config.py index c210713a2..e89b43003 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -122,6 +122,7 @@ class MotionConfig(FrigateBaseModel): ge=1, le=255, ) + improve_contrast: bool = Field(default=False, title="Improve Contrast") contour_area: Optional[int] = Field(default=30, title="Contour Area") delta_alpha: float = Field(default=0.2, title="Delta Alpha") frame_alpha: float = Field(default=0.2, title="Frame Alpha") diff --git a/frigate/motion.py b/frigate/motion.py index a3142b69b..9264191b2 100644 --- a/frigate/motion.py +++ b/frigate/motion.py @@ -38,14 +38,15 @@ class MotionDetector: ) # Improve contrast - minval = np.percentile(resized_frame, 4) - maxval = np.percentile(resized_frame, 96) - # don't adjust if the image is a single color - if minval < maxval: - resized_frame = np.clip(resized_frame, minval, maxval) - resized_frame = ( - ((resized_frame - minval) / (maxval - minval)) * 255 - ).astype(np.uint8) + if self.config.improve_contrast: + minval = np.percentile(resized_frame, 4) + maxval = np.percentile(resized_frame, 96) + # don't adjust if the image is a single color + if minval < maxval: + resized_frame = np.clip(resized_frame, minval, maxval) + resized_frame = ( + ((resized_frame - minval) / (maxval - minval)) * 255 + ).astype(np.uint8) # mask frame resized_frame[self.mask] = [255] From 83481afee143c85e8277e6b1829b8de597d0da9e Mon Sep 17 00:00:00 2001 From: 707Alex707 Date: Wed, 2 Mar 2022 01:05:05 -0500 Subject: [PATCH 6/9] remove print statement --- frigate/objects.py | 1 - 1 file changed, 1 deletion(-) diff --git a/frigate/objects.py b/frigate/objects.py index 7b66536c2..fb3ea7daa 100644 --- a/frigate/objects.py +++ b/frigate/objects.py @@ -109,7 +109,6 @@ class ObjectTracker: obj["motionless_count"] - self.detect_config.stationary.threshold > max_frames ): - print(f"expired: {obj['motionless_count']}") return True def update(self, id, new_obj): From 2e5d082ef3e9037ee830a629e43258a95c5c3116 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sat, 2 Apr 2022 07:33:10 -0600 Subject: [PATCH 7/9] Update docs to include warnings about needing record enabled in the config (#3045) * Update record docs to include note for automations. * Update config to warn about recording needing to be enabled. * Update wording from PR comments --- docs/docs/configuration/index.md | 2 ++ docs/docs/configuration/record.md | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/docs/docs/configuration/index.md b/docs/docs/configuration/index.md index 4f1765192..ba4facafc 100644 --- a/docs/docs/configuration/index.md +++ b/docs/docs/configuration/index.md @@ -245,6 +245,8 @@ motion: # 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. # WARNING: Frigate does not currently support limiting recordings based # on available disk space automatically. If using recordings, # you must specify retention settings for a number of days that diff --git a/docs/docs/configuration/record.md b/docs/docs/configuration/record.md index 2194fba0f..9cb5878d5 100644 --- a/docs/docs/configuration/record.md +++ b/docs/docs/configuration/record.md @@ -23,6 +23,12 @@ This configuration will retain recording segments that overlap with events and h 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? 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). From a292f272e939143d7bc83a7f999110551d801af6 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 11 Apr 2022 06:19:25 -0600 Subject: [PATCH 8/9] DOCS: Add stationary tracking config section to elaborate more on stationary tracking (#3077) * Add docs to elaborate more on stationary tracking * Add link to guide on avoiding stationary objects in driveway scenario * Update wording in reference config * Small cleanups * Update with PR comments --- docs/docs/configuration/index.md | 5 ++-- docs/docs/configuration/stationary_objects.md | 28 +++++++++++++++++++ docs/sidebars.js | 1 + 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 docs/docs/configuration/stationary_objects.md diff --git a/docs/docs/configuration/index.md b/docs/docs/configuration/index.md index ba4facafc..c0d74085d 100644 --- a/docs/docs/configuration/index.md +++ b/docs/docs/configuration/index.md @@ -161,8 +161,9 @@ detect: max_disappeared: 25 # Optional: Configuration for stationary object tracking stationary: - # Optional: Frequency for running detection on stationary objects (default: shown below) - # When set to 0, object detection will never be run on stationary objects. If set to 10, it will be run on every 10th frame. + # Optional: Frequency for confirming stationary objects (default: shown below) + # When set to 0, object detection will not confirm stationary objects until movement is detected. + # If set to 10, object detection will run to confirm the object still exists on every 10th frame. interval: 0 # Optional: Number of frames without a position change for an object to be considered stationary (default: 10x the frame rate or 10s) threshold: 50 diff --git a/docs/docs/configuration/stationary_objects.md b/docs/docs/configuration/stationary_objects.md new file mode 100644 index 000000000..deeee9ffd --- /dev/null +++ b/docs/docs/configuration/stationary_objects.md @@ -0,0 +1,28 @@ +# Stationary Objects + +An object is considered stationary when it is being tracked and has been in a very similar position for a certain number of frames. This number is defined in the configuration under `detect -> stationary -> threshold`, and is 10x the frame rate (or 10 seconds) by default. Once an object is considered stationary, it will remain stationary until motion occurs near the object at which point object detection will start running again. If the object changes location, it will be considered active. + +## Why does it matter if an object is stationary? + +Once an object becomes stationary, object detection will not be continually run on that object. This serves to reduce resource usage and redundant detections when there has been no motion near the tracked object. This also means that Frigate is contextually aware, and can for example [filter out recording segments](record.md#what-do-the-different-retain-modes-mean) to only when the object is considered active. Motion alone does not determine if an object is "active" for active_objects segment retention. Lighting changes for a parked car won't make an object active. + +## Tuning stationary behavior + +The default config is: + +```yaml +detect: + stationary: + interval: 0 + threshold: 50 +``` + +`interval` is defined as the frequency for running detection on stationary objects. This means that by default once an object is considered stationary, detection will not be run on it until motion is detected. With `interval > 0`, every nth frames detection will be run to make sure the object is still there. + +NOTE: There is no way to disable stationary object tracking with this value. + +`threshold` is the number of frames an object needs to remain relatively still before it is considered stationary. + +## Avoiding stationary objects + +In some cases, like a driveway, you may prefer to only have an event when a car is coming & going vs a constant event of it stationary in the driveway. [This docs sections](../guides/stationary_objects.md) explains how to approach that scenario. diff --git a/docs/sidebars.js b/docs/sidebars.js index 2b3669bdf..75260d1b2 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -22,6 +22,7 @@ module.exports = { 'configuration/objects', 'configuration/rtmp', 'configuration/zones', + 'configuration/stationary_objects', 'configuration/advanced', 'configuration/hardware_acceleration', 'configuration/nvdec', From 6808ba1b3b7b0268e0ea56b029b96ab66acb1355 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 15 Apr 2022 06:03:04 -0600 Subject: [PATCH 9/9] Add more issue templates (#3095) * Create camera_support_request.yml * Update camera_support_request.yml * Create config_support_request.yml * Update and rename support_request.yml to general_support_request.yml --- .../ISSUE_TEMPLATE/camera_support_request.yml | 107 ++++++++++++++++++ .../ISSUE_TEMPLATE/config_support_request.yml | 82 ++++++++++++++ ...equest.yml => general_support_request.yml} | 4 +- 3 files changed, 191 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/camera_support_request.yml create mode 100644 .github/ISSUE_TEMPLATE/config_support_request.yml rename .github/ISSUE_TEMPLATE/{support_request.yml => general_support_request.yml} (96%) diff --git a/.github/ISSUE_TEMPLATE/camera_support_request.yml b/.github/ISSUE_TEMPLATE/camera_support_request.yml new file mode 100644 index 000000000..7640d26ec --- /dev/null +++ b/.github/ISSUE_TEMPLATE/camera_support_request.yml @@ -0,0 +1,107 @@ +name: Camera Support Request +description: Support for setting up cameras in Frigate +title: "[Camera Support]: " +labels: ["support", "triage"] +assignees: [] +body: + - type: textarea + id: description + attributes: + label: Describe the problem you are having + validations: + required: true + - type: input + id: version + attributes: + label: Version + description: Visible on the Debug page in the Web UI + validations: + required: true + - type: textarea + id: config + attributes: + label: Frigate config file + description: This will be automatically formatted into code, so no need for backticks. + render: yaml + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell + validations: + required: true + - type: textarea + id: ffprobe + attributes: + label: FFprobe output from your camera + description: Run `ffprobe ` and provide output below + render: shell + validations: + required: true + - type: textarea + id: stats + attributes: + label: Frigate stats + description: Output from frigate's /api/stats endpoint + render: json + - type: dropdown + id: os + attributes: + label: Operating system + options: + - HassOS + - Debian + - Other Linux + - Proxmox + - UNRAID + - Windows + - Other + validations: + required: true + - type: dropdown + id: install-method + attributes: + label: Install method + options: + - HassOS Addon + - Docker Compose + - Docker CLI + validations: + required: true + - type: dropdown + id: coral + attributes: + label: Coral version + options: + - USB + - PCIe + - M.2 + - Dev Board + - Other + - CPU (no coral) + validations: + required: true + - type: dropdown + id: network + attributes: + label: Network connection + options: + - Wired + - Wireless + - Mixed + validations: + required: true + - type: input + id: camera + attributes: + label: Camera make and model + description: Dahua, hikvision, amcrest, reolink, etc and model number + validations: + required: true + - type: textarea + id: other + attributes: + label: Any other information that may be helpful diff --git a/.github/ISSUE_TEMPLATE/config_support_request.yml b/.github/ISSUE_TEMPLATE/config_support_request.yml new file mode 100644 index 000000000..cb95f6fa9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config_support_request.yml @@ -0,0 +1,82 @@ +name: Config Support Request +description: Support for Frigate configuration +title: "[Config Support]: " +labels: ["support", "triage"] +assignees: [] +body: + - type: textarea + id: description + attributes: + label: Describe the problem you are having + validations: + required: true + - type: input + id: version + attributes: + label: Version + description: Visible on the Debug page in the Web UI + validations: + required: true + - type: textarea + id: config + attributes: + label: Frigate config file + description: This will be automatically formatted into code, so no need for backticks. + render: yaml + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell + validations: + required: true + - type: textarea + id: stats + attributes: + label: Frigate stats + description: Output from frigate's /api/stats endpoint + render: json + - type: dropdown + id: os + attributes: + label: Operating system + options: + - HassOS + - Debian + - Other Linux + - Proxmox + - UNRAID + - Windows + - Other + validations: + required: true + - type: dropdown + id: install-method + attributes: + label: Install method + options: + - HassOS Addon + - Docker Compose + - Docker CLI + validations: + required: true + - type: dropdown + id: coral + attributes: + label: Coral version + options: + - USB + - PCIe + - M.2 + - Dev Board + - Other + - CPU (no coral) + validations: + required: true + - type: textarea + id: other + attributes: + label: Any other information that may be helpful diff --git a/.github/ISSUE_TEMPLATE/support_request.yml b/.github/ISSUE_TEMPLATE/general_support_request.yml similarity index 96% rename from .github/ISSUE_TEMPLATE/support_request.yml rename to .github/ISSUE_TEMPLATE/general_support_request.yml index 212d7db37..7138cd844 100644 --- a/.github/ISSUE_TEMPLATE/support_request.yml +++ b/.github/ISSUE_TEMPLATE/general_support_request.yml @@ -1,5 +1,5 @@ -name: Support Request -description: Support for Frigate setup or configuration +name: General Support Request +description: General support request for Frigate title: "[Support]: " labels: ["support", "triage"] assignees: []