mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-26 19:06:11 +01:00
1 line
8.6 KiB
JavaScript
1 line
8.6 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{73: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(92)),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, but Frigate will 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},92: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<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},o=Object.keys(e);for(a=0;a<o.length;a++)r=o[a],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],t.indexOf(r)>=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<o;s++)i[s]=r[s];return n.a.createElement.apply(null,i)}return n.a.createElement.apply(null,r)}m.displayName="MDXCreateElement"}}]); |