From 389bf94641ae80d85f86a9069b33794833b66735 Mon Sep 17 00:00:00 2001
From: blakeblackshear
Date: Fri, 3 Sep 2021 12:05:21 +0000
Subject: [PATCH] deploy: faf103152ade0b6de7c65857a5391947b558fb44
---
1c86fc29.86e2b377.js | 1 -
1c86fc29.9ddf1dd6.js | 1 +
404.html | 4 ++--
configuration/advanced/index.html | 4 ++--
configuration/cameras/index.html | 4 ++--
configuration/detectors/index.html | 4 ++--
configuration/false_positives/index.html | 4 ++--
configuration/index/index.html | 4 ++--
configuration/nvdec/index.html | 4 ++--
configuration/objects/index.html | 4 ++--
configuration/optimizing/index.html | 9 +++++----
contributing/index.html | 4 ++--
hardware/index.html | 4 ++--
how-it-works/index.html | 4 ++--
index.html | 4 ++--
installation/index.html | 4 ++--
mdx/index.html | 4 ++--
runtime~main.5ea23ef4.js => runtime~main.35eb7541.js | 2 +-
search/index.html | 4 ++--
troubleshooting/index.html | 4 ++--
usage/api/index.html | 4 ++--
usage/home-assistant/index.html | 4 ++--
usage/howtos/index.html | 4 ++--
usage/mqtt/index.html | 4 ++--
usage/web/index.html | 4 ++--
25 files changed, 49 insertions(+), 48 deletions(-)
delete mode 100644 1c86fc29.86e2b377.js
create mode 100644 1c86fc29.9ddf1dd6.js
rename runtime~main.5ea23ef4.js => runtime~main.35eb7541.js (98%)
diff --git a/1c86fc29.86e2b377.js b/1c86fc29.86e2b377.js
deleted file mode 100644
index b0dcb0951..000000000
--- a/1c86fc29.86e2b377.js
+++ /dev/null
@@ -1 +0,0 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{74:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return i})),r.d(t,"metadata",(function(){return c})),r.d(t,"toc",(function(){return l})),r.d(t,"default",(function(){return p}));var a=r(3),n=r(7),o=(r(0),r(99)),i={id:"optimizing",title:"Optimizing performance"},c={unversionedId:"configuration/optimizing",id:"configuration/optimizing",isDocsHomePage:!1,title:"Optimizing performance",description:"- Google Coral//coral.ai",source:"@site/docs/configuration/optimizing.md",slug:"/configuration/optimizing",permalink:"/frigate/configuration/optimizing",editUrl:"https://github.com/blakeblackshear/frigate/edit/master/docs/docs/configuration/optimizing.md",version:"current",sidebar:"docs",previous:{title:"Cameras",permalink:"/frigate/configuration/cameras"},next:{title:"Detectors",permalink:"/frigate/configuration/detectors"}},l=[{value:"FFmpeg Hardware Acceleration",id:"ffmpeg-hardware-acceleration",children:[]}],s={toc:l};function p(e){var t=e.components,r=Object(n.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},s,r,{components:t,mdxType:"MDXLayout"}),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("strong",{parentName:"li"},"Google Coral"),": It is strongly recommended to use a Google Coral, Frigate will no longer fall back to CPU in the event one is not found. Offloading TensorFlow to the Google Coral is an order of magnitude faster and will reduce your CPU load dramatically. A $60 device will outperform $2000 CPU. Frigate should work with any supported Coral device from ",Object(o.b)("a",Object(a.a)({parentName:"li"},{href:"https://coral.ai"}),"https://coral.ai")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("strong",{parentName:"li"},"Resolution"),": For the ",Object(o.b)("inlineCode",{parentName:"li"},"detect")," input, choose a camera resolution where the smallest object you want to detect barely fits inside a 300x300px square. The model used by Frigate is trained on 300x300px images, so you will get worse performance and no improvement in accuracy by using a larger resolution since Frigate resizes the area where it is looking for objects to 300x300 anyway."),Object(o.b)("li",{parentName:"ul"},Object(o.b)("strong",{parentName:"li"},"FPS"),": 5 frames per second should be adequate. Higher frame rates will require more CPU usage without improving detections or accuracy. Reducing the frame rate on your camera will have the greatest improvement on system resources."),Object(o.b)("li",{parentName:"ul"},Object(o.b)("strong",{parentName:"li"},"Hardware Acceleration"),": Make sure you configure the ",Object(o.b)("inlineCode",{parentName:"li"},"hwaccel_args")," for your hardware. They provide a significant reduction in CPU usage if they are available."),Object(o.b)("li",{parentName:"ul"},Object(o.b)("strong",{parentName:"li"},"Masks"),": Masks can be used to ignore motion and reduce your idle CPU load. If you have areas with regular motion such as timestamps or trees blowing in the wind, frigate will constantly try to determine if that motion is from a person or other object you are tracking. Those detections not only increase your average CPU usage, but also clog the pipeline for detecting objects elsewhere. If you are experiencing high values for ",Object(o.b)("inlineCode",{parentName:"li"},"detection_fps")," when no objects of interest are in the cameras, you should use masks to tell frigate to ignore movement from trees, bushes, timestamps, or any part of the image where detections should not be wasted looking for objects.")),Object(o.b)("h3",{id:"ffmpeg-hardware-acceleration"},"FFmpeg Hardware Acceleration"),Object(o.b)("p",null,"Frigate works on Raspberry Pi 3b/4 and x86 machines. It is recommended to update your configuration to enable hardware accelerated decoding in ffmpeg. Depending on your system, these parameters may not be compatible."),Object(o.b)("p",null,"Raspberry Pi 3/4 (32-bit OS)\n",Object(o.b)("strong",{parentName:"p"},"NOTICE"),": If you are using the addon, ensure you turn off ",Object(o.b)("inlineCode",{parentName:"p"},"Protection mode")," for hardware acceleration."),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"ffmpeg:\n hwaccel_args:\n - -c:v\n - h264_mmal\n")),Object(o.b)("p",null,"Raspberry Pi 3/4 (64-bit OS)\n",Object(o.b)("strong",{parentName:"p"},"NOTICE"),": If you are using the addon, ensure you turn off ",Object(o.b)("inlineCode",{parentName:"p"},"Protection mode")," for hardware acceleration."),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"ffmpeg:\n hwaccel_args:\n - -c:v\n - h264_v4l2m2m\n")),Object(o.b)("p",null,"Intel-based CPUs (<10th Generation) via Quicksync (",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://trac.ffmpeg.org/wiki/Hardware/QuickSync"}),"https://trac.ffmpeg.org/wiki/Hardware/QuickSync"),")"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"ffmpeg:\n hwaccel_args:\n - -hwaccel\n - vaapi\n - -hwaccel_device\n - /dev/dri/renderD128\n - -hwaccel_output_format\n - yuv420p\n")),Object(o.b)("p",null,"Intel-based CPUs (>=10th Generation) via Quicksync (",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://trac.ffmpeg.org/wiki/Hardware/QuickSync"}),"https://trac.ffmpeg.org/wiki/Hardware/QuickSync"),")"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"ffmpeg:\n hwaccel_args:\n - -hwaccel\n - qsv\n - -qsv_device\n - /dev/dri/renderD128\n")),Object(o.b)("p",null,"AMD/ATI GPUs (Radeon HD 2000 and newer GPUs) via libva-mesa-driver (",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://trac.ffmpeg.org/wiki/Hardware/QuickSync"}),"https://trac.ffmpeg.org/wiki/Hardware/QuickSync"),")\n",Object(o.b)("strong",{parentName:"p"},"Note:")," You also need to set ",Object(o.b)("inlineCode",{parentName:"p"},"LIBVA_DRIVER_NAME=radeonsi")," as an environment variable on the container."),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"ffmpeg:\n hwaccel_args:\n - -hwaccel\n - vaapi\n - -hwaccel_device\n - /dev/dri/renderD128\n")),Object(o.b)("p",null,"Nvidia GPU based decoding via NVDEC is supported, but requires special configuration. See the ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"/configuration/nvdec"}),"nvidia NVDEC documentation")," for more details."))}p.isMDXComponent=!0},99:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return d}));var a=r(0),n=r.n(a);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function c(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=n.a.createContext({}),p=function(e){var t=n.a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},u=function(e){var t=p(e.components);return n.a.createElement(s.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return n.a.createElement(n.a.Fragment,{},t)}},m=n.a.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=p(r),m=a,d=u["".concat(i,".").concat(m)]||u[m]||b[m]||o;return r?n.a.createElement(d,c(c({ref:t},s),{},{components:r})):n.a.createElement(d,c({ref:t},s))}));function d(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=m;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,i[1]=c;for(var s=2;s Performance Options > GPU Memory).\n",Object(o.b)("strong",{parentName:"p"},"NOTICE"),": If you are using the addon, ensure you turn off ",Object(o.b)("inlineCode",{parentName:"p"},"Protection mode")," for hardware acceleration."),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"ffmpeg:\n hwaccel_args:\n - -c:v\n - h264_mmal\n")),Object(o.b)("p",null,"Raspberry Pi 3/4 (64-bit OS)\n",Object(o.b)("strong",{parentName:"p"},"NOTICE"),": If you are using the addon, ensure you turn off ",Object(o.b)("inlineCode",{parentName:"p"},"Protection mode")," for hardware acceleration."),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"ffmpeg:\n hwaccel_args:\n - -c:v\n - h264_v4l2m2m\n")),Object(o.b)("p",null,"Intel-based CPUs (<10th Generation) via Quicksync (",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://trac.ffmpeg.org/wiki/Hardware/QuickSync"}),"https://trac.ffmpeg.org/wiki/Hardware/QuickSync"),")"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"ffmpeg:\n hwaccel_args:\n - -hwaccel\n - vaapi\n - -hwaccel_device\n - /dev/dri/renderD128\n - -hwaccel_output_format\n - yuv420p\n")),Object(o.b)("p",null,"Intel-based CPUs (>=10th Generation) via Quicksync (",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://trac.ffmpeg.org/wiki/Hardware/QuickSync"}),"https://trac.ffmpeg.org/wiki/Hardware/QuickSync"),")"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"ffmpeg:\n hwaccel_args:\n - -hwaccel\n - qsv\n - -qsv_device\n - /dev/dri/renderD128\n")),Object(o.b)("p",null,"AMD/ATI GPUs (Radeon HD 2000 and newer GPUs) via libva-mesa-driver (",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://trac.ffmpeg.org/wiki/Hardware/QuickSync"}),"https://trac.ffmpeg.org/wiki/Hardware/QuickSync"),")\n",Object(o.b)("strong",{parentName:"p"},"Note:")," You also need to set ",Object(o.b)("inlineCode",{parentName:"p"},"LIBVA_DRIVER_NAME=radeonsi")," as an environment variable on the container."),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"ffmpeg:\n hwaccel_args:\n - -hwaccel\n - vaapi\n - -hwaccel_device\n - /dev/dri/renderD128\n")),Object(o.b)("p",null,"Nvidia GPU based decoding via NVDEC is supported, but requires special configuration. See the ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"/configuration/nvdec"}),"nvidia NVDEC documentation")," for more details."))}p.isMDXComponent=!0},99:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return d}));var a=r(0),n=r.n(a);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function c(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=n.a.createContext({}),p=function(e){var t=n.a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},u=function(e){var t=p(e.components);return n.a.createElement(s.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.a.createElement(n.a.Fragment,{},t)}},b=n.a.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=p(r),b=a,d=u["".concat(i,".").concat(b)]||u[b]||m[b]||o;return r?n.a.createElement(d,c(c({ref:t},s),{},{components:r})):n.a.createElement(d,c({ref:t},s))}));function d(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=b;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,i[1]=c;for(var s=2;sPage Not Found | Frigate
-
+
@@ -20,7 +20,7 @@
Page Not Found
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
Event and clip information is managed in a sqlite database at /media/frigate/clips/frigate.db. If that database is deleted, clips will be orphaned and will need to be cleaned up manually. They also won't show up in the Media Browser within Home Assistant.
If you are storing your clips on a network share (SMB, NFS, etc), you may get a database is locked error message on startup. You can customize the location of the database in the config if necessary.
This may need to be in a custom location if network storage is used for clips.
The input and output parameters need to be adjusted for MJPEG cameras
input_args:
--avoid_negative_ts
- make_zero
--fflags
- nobuffer
--flags
- low_delay
--strict
- experimental
--fflags
- +genpts+discardcorrupt
--r
-"3"# <---- adjust depending on your desired frame rate from the mjpeg image
--use_wallclock_as_timestamps
-"1"
Note that mjpeg cameras require encoding the video into h264 for clips, recording, and rtmp roles. This will use significantly more CPU than if the cameras supported h264 feeds directly.
The default config will look for a USB Coral device. If you do not have a Coral, you will need to configure a CPU detector. If you have PCI or multiple Coral devices, you need to configure your detector devices in the config file. When using multiple detectors, they run in dedicated processes, but pull from a common queue of requested detections across all cameras.
Tune your object filters to adjust false positives: min_area, max_area, min_score, threshold.
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:
Frame
Current Score
Score History
Computed Score
Detected Object
1
0.7
0.0, 0, 0.7
0.0
No
2
0.55
0.0, 0.7, 0.0
0.0
No
3
0.85
0.7, 0.0, 0.85
0.7
No
4
0.90
0.7, 0.85, 0.95, 0.90
0.875
Yes
5
0.88
0.7, 0.85, 0.95, 0.90, 0.88
0.88
Yes
6
0.95
0.7, 0.85, 0.95, 0.90, 0.88, 0.95
0.89
Yes
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.
For HassOS installations, the default location for the config file is /config/frigate.yml.
For all other installations, the default location for the config file is '/config/config.yml'. This can be overridden with the CONFIG_FILE environment variable. Camera specific ffmpeg parameters are documented here.
It is recommended to start with a minimal configuration and add to it:
Each of your cameras must be configured. The following is the minimum required to register a camera in Frigate. Check the camera configuration page for a complete list of options.
Can be overridden at the camera level. 24/7 recordings can be enabled and are stored at /media/frigate/recordings. The folder structure for the recordings is YYYY-MM/DD/HH/<camera_name>/MM.SS.mp4. These recordings are written directly from your camera stream without re-encoding and are available in Home Assistant's media browser. Each camera supports a configurable retention policy in the config.
caution
Previous versions of frigate included -vsync drop in input parameters. This is not compatible with FFmpeg's segment feature and must be removed from your input parameters if you have overrides set.
This setting, for example, allows Frigate to consume my 10-15fps camera streams on
my relatively low powered Haswell machine with relatively low cpu usage.
The labelmap can be customized to your needs. A common reason to do this is to combine multiple object types that are easily confused when you don't need to be as granular such as car/truck. You must retain the same number of labels, but you can change the names. To change:
Google Coral: It is strongly recommended to use a Google Coral, Frigate will no longer fall back to CPU in the event one is not found. Offloading TensorFlow to the Google Coral is an order of magnitude faster and will reduce your CPU load dramatically. A $60 device will outperform $2000 CPU. Frigate should work with any supported Coral device from https://coral.ai
Resolution: For the detect input, choose a camera resolution where the smallest object you want to detect barely fits inside a 300x300px square. The model used by Frigate is trained on 300x300px images, so you will get worse performance and no improvement in accuracy by using a larger resolution since Frigate resizes the area where it is looking for objects to 300x300 anyway.
FPS: 5 frames per second should be adequate. Higher frame rates will require more CPU usage without improving detections or accuracy. Reducing the frame rate on your camera will have the greatest improvement on system resources.
Hardware Acceleration: Make sure you configure the hwaccel_args for your hardware. They provide a significant reduction in CPU usage if they are available.
Masks: Masks can be used to ignore motion and reduce your idle CPU load. If you have areas with regular motion such as timestamps or trees blowing in the wind, frigate will constantly try to determine if that motion is from a person or other object you are tracking. Those detections not only increase your average CPU usage, but also clog the pipeline for detecting objects elsewhere. If you are experiencing high values for detection_fps when no objects of interest are in the cameras, you should use masks to tell frigate to ignore movement from trees, bushes, timestamps, or any part of the image where detections should not be wasted looking for objects.
Frigate works on Raspberry Pi 3b/4 and x86 machines. It is recommended to update your configuration to enable hardware accelerated decoding in ffmpeg. Depending on your system, these parameters may not be compatible.
Raspberry Pi 3/4 (32-bit OS)
+Ensure you increase the allocated RAM for your GPU to at least 128 (raspi-config > Performance Options > GPU Memory).
NOTICE: If you are using the addon, ensure you turn off Protection mode for hardware acceleration.
ffmpeg:
hwaccel_args:
--c:v
- h264_mmal
Raspberry Pi 3/4 (64-bit OS)
NOTICE: If you are using the addon, ensure you turn off Protection mode for hardware acceleration.
AMD/ATI GPUs (Radeon HD 2000 and newer GPUs) via libva-mesa-driver (https://trac.ffmpeg.org/wiki/Hardware/QuickSync)
Note: You also need to set LIBVA_DRIVER_NAME=radeonsi as an environment variable on the container.
ffmpeg:
hwaccel_args:
--hwaccel
- vaapi
--hwaccel_device
- /dev/dri/renderD128
Nvidia GPU based decoding via NVDEC is supported, but requires special configuration. See the nvidia NVDEC documentation for more details.