From 2f475e6e79d91e0145ae55a8ce541fcd1b3c7a95 Mon Sep 17 00:00:00 2001 From: blakeblackshear Date: Sat, 14 Aug 2021 12:24:30 +0000 Subject: [PATCH] deploy: adf2bc078c255dbc575d79477d5ff752954f19f5 --- 3e34525f.4b48363e.js | 1 - 3e34525f.68f6dbde.js | 1 + 404.html | 4 ++-- configuration/advanced/index.html | 4 ++-- configuration/cameras/index.html | 10 +++++----- 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 | 4 ++-- 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.a90fd004.js => runtime~main.e26db1e5.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(+), 49 deletions(-) delete mode 100644 3e34525f.4b48363e.js create mode 100644 3e34525f.68f6dbde.js rename runtime~main.a90fd004.js => runtime~main.e26db1e5.js (98%) diff --git a/3e34525f.4b48363e.js b/3e34525f.4b48363e.js deleted file mode 100644 index ed03bbe71..000000000 --- a/3e34525f.4b48363e.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{158:function(e,t,n){"use strict";n.r(t),t.default=n.p+"assets/images/example-mask-poly-46536487e8112e2adb5834ccc0525c20.png"},77:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return r})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return d}));var a=n(3),o=n(7),i=(n(0),n(99)),r={id:"cameras",title:"Cameras"},s={unversionedId:"configuration/cameras",id:"configuration/cameras",isDocsHomePage:!1,title:"Cameras",description:"Setting Up Camera Inputs",source:"@site/docs/configuration/cameras.md",slug:"/configuration/cameras",permalink:"/frigate/configuration/cameras",editUrl:"https://github.com/blakeblackshear/frigate/edit/master/docs/docs/configuration/cameras.md",version:"current",sidebar:"docs",previous:{title:"Configuration",permalink:"/frigate/configuration/index"},next:{title:"Optimizing performance",permalink:"/frigate/configuration/optimizing"}},l=[{value:"Setting Up Camera Inputs",id:"setting-up-camera-inputs",children:[{value:"Example",id:"example",children:[]}]},{value:"Masks & Zones",id:"masks--zones",children:[{value:"Masks",id:"masks",children:[]},{value:"Zones",id:"zones",children:[]}]},{value:"Objects",id:"objects",children:[]},{value:"Clips",id:"clips",children:[]},{value:"Snapshots",id:"snapshots",children:[]},{value:"24/7 Recordings",id:"247-recordings",children:[]},{value:"RTMP streams",id:"rtmp-streams",children:[]},{value:"Full example",id:"full-example",children:[]},{value:"Camera specific configuration",id:"camera-specific-configuration",children:[{value:"MJPEG Cameras",id:"mjpeg-cameras",children:[]},{value:"RTMP Cameras",id:"rtmp-cameras",children:[]},{value:"Reolink 410/520 (possibly others)",id:"reolink-410520-possibly-others",children:[]},{value:"Blue Iris RTSP Cameras",id:"blue-iris-rtsp-cameras",children:[]}]}],c={toc:l};function d(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},c,r,{components:t,mdxType:"MDXLayout"}),Object(i.b)("h2",{id:"setting-up-camera-inputs"},"Setting Up Camera Inputs"),Object(i.b)("p",null,"Up to 4 inputs can be configured for each camera and the role of each input can be mixed and matched based on your needs. This allows you to use a lower resolution stream for object detection, but create clips from a higher resolution stream, or vice versa."),Object(i.b)("p",null,"Each role can only be assigned to one input per camera. The options for roles are as follows:"),Object(i.b)("table",null,Object(i.b)("thead",{parentName:"table"},Object(i.b)("tr",{parentName:"thead"},Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Role"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Description"))),Object(i.b)("tbody",{parentName:"table"},Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(i.b)("inlineCode",{parentName:"td"},"detect")),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Main feed for object detection")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(i.b)("inlineCode",{parentName:"td"},"clips")),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Clips of events from objects detected in the ",Object(i.b)("inlineCode",{parentName:"td"},"detect")," feed. ",Object(i.b)("a",Object(a.a)({parentName:"td"},{href:"#recording-clips"}),"docs"))),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(i.b)("inlineCode",{parentName:"td"},"record")),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Saves 60 second segments of the video feed. ",Object(i.b)("a",Object(a.a)({parentName:"td"},{href:"#247-recordings"}),"docs"))),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(i.b)("inlineCode",{parentName:"td"},"rtmp")),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Broadcast as an RTMP feed for other services to consume. ",Object(i.b)("a",Object(a.a)({parentName:"td"},{href:"#rtmp-streams"}),"docs"))))),Object(i.b)("h3",{id:"example"},"Example"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"mqtt:\n host: mqtt.server.com\ncameras:\n back:\n ffmpeg:\n inputs:\n - path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2\n roles:\n - detect\n - rtmp\n - path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/live\n roles:\n - clips\n - record\n width: 1280\n height: 720\n fps: 5\n")),Object(i.b)("h2",{id:"masks--zones"},"Masks & Zones"),Object(i.b)("h3",{id:"masks"},"Masks"),Object(i.b)("p",null,"Masks are used to ignore initial detection in areas of your camera's field of view."),Object(i.b)("p",null,"There are two types of masks available:"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("strong",{parentName:"li"},"Motion masks"),": Motion masks are used to prevent unwanted types of motion from triggering detection. Try watching the video feed with ",Object(i.b)("inlineCode",{parentName:"li"},"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 ",Object(i.b)("inlineCode",{parentName:"li"},"Motion Boxes")," enabled again."),Object(i.b)("li",{parentName:"ul"},Object(i.b)("strong",{parentName:"li"},"Object filter masks"),": Object filter masks are used to filter out false positives for a given object type. 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(i.b)("p",null,"To create a poly mask:"),Object(i.b)("ol",null,Object(i.b)("li",{parentName:"ol"},"Visit the ",Object(i.b)("a",Object(a.a)({parentName:"li"},{href:"/usage/web"}),"web UI")),Object(i.b)("li",{parentName:"ol"},"Click the camera you wish to create a mask for"),Object(i.b)("li",{parentName:"ol"},'Click "Mask & Zone creator"'),Object(i.b)("li",{parentName:"ol"},'Click "Add" on the type of mask or zone you would like to create'),Object(i.b)("li",{parentName:"ol"},"Click on the camera's latest image to create a masked area. The yaml representation will be updated in real-time"),Object(i.b)("li",{parentName:"ol"},'When you\'ve finished creating your mask, click "Copy" and paste the contents into your ',Object(i.b)("inlineCode",{parentName:"li"},"config.yaml")," file and restart Frigate")),Object(i.b)("p",null,"Example of a finished row corresponding to the below example image:"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),'motion:\n mask: "0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432"\n')),Object(i.b)("p",null,Object(i.b)("img",{alt:"poly",src:n(158).default})),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"# Optional: camera level motion config\nmotion:\n # Optional: motion mask\n # NOTE: see docs for more detailed info on creating masks\n mask: 0,900,1080,900,1080,1920,0,1920\n")),Object(i.b)("h3",{id:"zones"},"Zones"),Object(i.b)("p",null,"Zones allow you to define a specific area of the frame and apply additional filters for object types so you can determine whether or not an object is within a particular area. Zones cannot have the same name as a camera. If desired, a single zone can include multiple cameras if you have multiple cameras covering the same area by configuring zones with the same name for each camera."),Object(i.b)("p",null,"During testing, ",Object(i.b)("inlineCode",{parentName:"p"},"draw_zones")," should be set in the config to draw the zone on the frames so you can adjust as needed. The zone line will increase in thickness when any object enters the zone."),Object(i.b)("p",null,'To create a zone, follow the same steps above for a "Motion mask", but use the section of the web UI for creating a zone instead.'),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"# Optional: zones for this camera\nzones:\n # Required: name of the zone\n # NOTE: This must be different than any camera names, but can match with another zone on another\n # camera.\n front_steps:\n # Required: List of x,y coordinates to define the polygon of the zone.\n # NOTE: Coordinates can be generated at https://www.image-map.net/\n coordinates: 545,1077,747,939,788,805\n # Optional: Zone level object filters.\n # NOTE: The global and camera filters are applied upstream.\n filters:\n person:\n min_area: 5000\n max_area: 100000\n threshold: 0.7\n")),Object(i.b)("h2",{id:"objects"},"Objects"),Object(i.b)("p",null,"For a list of available objects, see the ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"/frigate/configuration/objects"}),"objects documentation"),"."),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"# Optional: Camera level object filters config.\nobjects:\n track:\n - person\n - car\n # Optional: mask to prevent all object types from being detected in certain areas (default: no mask)\n # Checks based on the bottom center of the bounding box of the object.\n # NOTE: This mask is COMBINED with the object type specific mask below\n mask: 0,0,1000,0,1000,200,0,200\n filters:\n person:\n min_area: 5000\n max_area: 100000\n min_score: 0.5\n threshold: 0.7\n # Optional: mask to prevent this object type from being detected in certain areas (default: no mask)\n # Checks based on the bottom center of the bounding box of the object\n mask: 0,0,1000,0,1000,200,0,200\n")),Object(i.b)("h2",{id:"clips"},"Clips"),Object(i.b)("p",null,"Frigate can save video clips without any CPU overhead for encoding by simply copying the stream directly with FFmpeg. It leverages FFmpeg's segment functionality to maintain a cache of video for each camera. The cache files are written to disk at ",Object(i.b)("inlineCode",{parentName:"p"},"/tmp/cache")," and do not introduce memory overhead. When an object is being tracked, it will extend the cache to ensure it can assemble a clip when the event ends. Once the event ends, it again uses FFmpeg to assemble a clip by combining the video clips without any encoding by the CPU. Assembled clips are are saved to ",Object(i.b)("inlineCode",{parentName:"p"},"/media/frigate/clips"),". Clips are retained according to the retention settings defined on the config for each object type."),Object(i.b)("p",null,"These clips will not be playable in the web UI or in Home Assistant's media browser unless your camera sends video as h264."),Object(i.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"caution")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"Previous versions of frigate included ",Object(i.b)("inlineCode",{parentName:"p"},"-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."))),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"clips:\n # Required: enables clips for the camera (default: shown below)\n # This value can be set via MQTT and will be updated in startup based on retained value\n enabled: False\n # Optional: Number of seconds before the event to include in the clips (default: shown below)\n pre_capture: 5\n # Optional: Number of seconds after the event to include in the clips (default: shown below)\n post_capture: 5\n # Optional: Objects to save clips for. (default: all tracked objects)\n objects:\n - person\n # Optional: Restrict clips to objects that entered any of the listed zones (default: no required zones)\n required_zones: []\n # Optional: Camera override for retention settings (default: global values)\n retain:\n # Required: Default retention days (default: shown below)\n default: 10\n # Optional: Per object retention days\n objects:\n person: 15\n")),Object(i.b)("h2",{id:"snapshots"},"Snapshots"),Object(i.b)("p",null,"Frigate can save a snapshot image to ",Object(i.b)("inlineCode",{parentName:"p"},"/media/frigate/clips")," for each event named as ",Object(i.b)("inlineCode",{parentName:"p"},"-.jpg"),"."),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"# Optional: Configuration for the jpg snapshots written to the clips directory for each event\nsnapshots:\n # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)\n # This value can be set via MQTT and will be updated in startup based on retained value\n enabled: False\n # Optional: print a timestamp on the snapshots (default: shown below)\n timestamp: False\n # Optional: draw bounding box on the snapshots (default: shown below)\n bounding_box: False\n # Optional: crop the snapshot (default: shown below)\n crop: False\n # Optional: height to resize the snapshot to (default: original size)\n height: 175\n # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)\n required_zones: []\n # Optional: Camera override for retention settings (default: global values)\n retain:\n # Required: Default retention days (default: shown below)\n default: 10\n # Optional: Per object retention days\n objects:\n person: 15\n")),Object(i.b)("h2",{id:"247-recordings"},"24/7 Recordings"),Object(i.b)("p",null,"24/7 recordings can be enabled and are stored at ",Object(i.b)("inlineCode",{parentName:"p"},"/media/frigate/recordings"),". The folder structure for the recordings is ",Object(i.b)("inlineCode",{parentName:"p"},"YYYY-MM/DD/HH//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."),Object(i.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"caution")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"Previous versions of frigate included ",Object(i.b)("inlineCode",{parentName:"p"},"-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."))),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"# Optional: 24/7 recording configuration\nrecord:\n # Optional: Enable recording (default: global setting)\n enabled: False\n # Optional: Number of days to retain (default: global setting)\n retain_days: 30\n")),Object(i.b)("h2",{id:"rtmp-streams"},"RTMP streams"),Object(i.b)("p",null,"Frigate can re-stream your video feed as a RTMP feed for other applications such as Home Assistant to utilize it at ",Object(i.b)("inlineCode",{parentName:"p"},"rtmp:///live/"),". Port 1935 must be open. This allows you to use a video feed for detection in frigate and Home Assistant live view at the same time without having to make two separate connections to the camera. The video feed is copied from the original video feed directly to avoid re-encoding. This feed does not include any annotation by Frigate."),Object(i.b)("p",null,"Some video feeds are not compatible with RTMP. If you are experiencing issues, check to make sure your camera feed is h264 with AAC audio. If your camera doesn't support a compatible format for RTMP, you can use the ffmpeg args to re-encode it on the fly at the expense of increased CPU utilization."),Object(i.b)("h2",{id:"full-example"},"Full example"),Object(i.b)("p",null,"The following is a full example of all of the options together for a camera configuration"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"cameras:\n # Required: name of the camera\n back:\n # Required: ffmpeg settings for the camera\n ffmpeg:\n # Required: A list of input streams for the camera. See documentation for more information.\n inputs:\n # Required: the path to the stream\n # NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}\n - path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2\n # Required: list of roles for this stream. valid values are: detect,record,clips,rtmp\n # NOTICE: In addition to assigning the record, clips, and rtmp roles,\n # they must also be enabled in the camera config.\n roles:\n - detect\n - rtmp\n # Optional: stream specific global args (default: inherit)\n global_args:\n # Optional: stream specific hwaccel args (default: inherit)\n hwaccel_args:\n # Optional: stream specific input args (default: inherit)\n input_args:\n # Optional: camera specific global args (default: inherit)\n global_args:\n # Optional: camera specific hwaccel args (default: inherit)\n hwaccel_args:\n # Optional: camera specific input args (default: inherit)\n input_args:\n # Optional: camera specific output args (default: inherit)\n output_args:\n\n # Required: width of the frame for the input with the detect role\n width: 1280\n # Required: height of the frame for the input with the detect role\n height: 720\n # Optional: desired fps for your camera for the input with the detect role\n # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.\n # Frigate will attempt to autodetect if not specified.\n fps: 5\n\n # Optional: camera level motion config\n motion:\n # Optional: motion mask\n # NOTE: see docs for more detailed info on creating masks\n mask: 0,900,1080,900,1080,1920,0,1920\n\n # Optional: timeout for highest scoring image before allowing it\n # to be replaced by a newer image. (default: shown below)\n best_image_timeout: 60\n\n # Optional: zones for this camera\n zones:\n # Required: name of the zone\n # NOTE: This must be different than any camera names, but can match with another zone on another\n # camera.\n front_steps:\n # Required: List of x,y coordinates to define the polygon of the zone.\n # NOTE: Coordinates can be generated at https://www.image-map.net/\n coordinates: 545,1077,747,939,788,805\n # Optional: Zone level object filters.\n # NOTE: The global and camera filters are applied upstream.\n filters:\n person:\n min_area: 5000\n max_area: 100000\n threshold: 0.7\n\n # Optional: Camera level detect settings\n detect:\n # Optional: enables detection for the camera (default: True)\n # This value can be set via MQTT and will be updated in startup based on retained value\n enabled: True\n # Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)\n max_disappeared: 25\n\n # Optional: save clips configuration\n clips:\n # Required: enables clips for the camera (default: shown below)\n # This value can be set via MQTT and will be updated in startup based on retained value\n enabled: False\n # Optional: Number of seconds before the event to include in the clips (default: shown below)\n pre_capture: 5\n # Optional: Number of seconds after the event to include in the clips (default: shown below)\n post_capture: 5\n # Optional: Objects to save clips for. (default: all tracked objects)\n objects:\n - person\n # Optional: Restrict clips to objects that entered any of the listed zones (default: no required zones)\n required_zones: []\n # Optional: Camera override for retention settings (default: global values)\n retain:\n # Required: Default retention days (default: shown below)\n default: 10\n # Optional: Per object retention days\n objects:\n person: 15\n\n # Optional: 24/7 recording configuration\n record:\n # Optional: Enable recording (default: global setting)\n enabled: False\n # Optional: Number of days to retain (default: global setting)\n retain_days: 30\n\n # Optional: RTMP re-stream configuration\n rtmp:\n # Required: Enable the live stream (default: True)\n enabled: True\n\n # Optional: Configuration for the jpg snapshots written to the clips directory for each event\n snapshots:\n # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)\n # This value can be set via MQTT and will be updated in startup based on retained value\n enabled: False\n # Optional: print a timestamp on the snapshots (default: shown below)\n timestamp: False\n # Optional: draw bounding box on the snapshots (default: shown below)\n bounding_box: False\n # Optional: crop the snapshot (default: shown below)\n crop: False\n # Optional: height to resize the snapshot to (default: original size)\n height: 175\n # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)\n required_zones: []\n # Optional: Camera override for retention settings (default: global values)\n retain:\n # Required: Default retention days (default: shown below)\n default: 10\n # Optional: Per object retention days\n objects:\n person: 15\n\n # Optional: Configuration for the jpg snapshots published via MQTT\n mqtt:\n # Optional: Enable publishing snapshot via mqtt for camera (default: shown below)\n # NOTE: Only applies to publishing image data to MQTT via 'frigate///snapshot'.\n # All other messages will still be published.\n enabled: True\n # Optional: print a timestamp on the snapshots (default: shown below)\n timestamp: True\n # Optional: draw bounding box on the snapshots (default: shown below)\n bounding_box: True\n # Optional: crop the snapshot (default: shown below)\n crop: True\n # Optional: height to resize the snapshot to (default: shown below)\n height: 270\n # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)\n required_zones: []\n\n # Optional: Camera level object filters config.\n objects:\n track:\n - person\n - car\n # Optional: mask to prevent all object types from being detected in certain areas (default: no mask)\n # Checks based on the bottom center of the bounding box of the object.\n # NOTE: This mask is COMBINED with the object type specific mask below\n mask: 0,0,1000,0,1000,200,0,200\n filters:\n person:\n min_area: 5000\n max_area: 100000\n min_score: 0.5\n threshold: 0.7\n # Optional: mask to prevent this object type from being detected in certain areas (default: no mask)\n # Checks based on the bottom center of the bounding box of the object\n mask: 0,0,1000,0,1000,200,0,200\n")),Object(i.b)("h2",{id:"camera-specific-configuration"},"Camera specific configuration"),Object(i.b)("h3",{id:"mjpeg-cameras"},"MJPEG Cameras"),Object(i.b)("p",null,"The input and output parameters need to be adjusted for MJPEG cameras"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),'input_args:\n - -avoid_negative_ts\n - make_zero\n - -fflags\n - nobuffer\n - -flags\n - low_delay\n - -strict\n - experimental\n - -fflags\n - +genpts+discardcorrupt\n - -r\n - "3" # <---- adjust depending on your desired frame rate from the mjpeg image\n - -use_wallclock_as_timestamps\n - "1"\n')),Object(i.b)("p",null,"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."),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"output_args:\n record: -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v libx264 -an\n clips: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v libx264 -an\n rtmp: -c:v libx264 -an -f flv\n")),Object(i.b)("h3",{id:"rtmp-cameras"},"RTMP Cameras"),Object(i.b)("p",null,"The input parameters need to be adjusted for RTMP cameras"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),'ffmpeg:\n input_args:\n - -avoid_negative_ts\n - make_zero\n - -fflags\n - nobuffer\n - -flags\n - low_delay\n - -strict\n - experimental\n - -fflags\n - +genpts+discardcorrupt\n - -use_wallclock_as_timestamps\n - "1"\n')),Object(i.b)("h3",{id:"reolink-410520-possibly-others"},"Reolink 410/520 (possibly others)"),Object(i.b)("p",null,"Several users have reported success with the rtmp video from Reolink cameras."),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),'ffmpeg:\n input_args:\n - -avoid_negative_ts\n - make_zero\n - -fflags\n - nobuffer\n - -flags\n - low_delay\n - -strict\n - experimental\n - -fflags\n - +genpts+discardcorrupt\n - -rw_timeout\n - "5000000"\n - -use_wallclock_as_timestamps\n - "1"\n')),Object(i.b)("h3",{id:"blue-iris-rtsp-cameras"},"Blue Iris RTSP Cameras"),Object(i.b)("p",null,"You will need to remove ",Object(i.b)("inlineCode",{parentName:"p"},"nobuffer")," flag for Blue Iris RTSP cameras"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),'ffmpeg:\n input_args:\n - -avoid_negative_ts\n - make_zero\n - -flags\n - low_delay\n - -strict\n - experimental\n - -fflags\n - +genpts+discardcorrupt\n - -rtsp_transport\n - tcp\n - -stimeout\n - "5000000"\n - -use_wallclock_as_timestamps\n - "1"\n')))}d.isMDXComponent=!0},99:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return u}));var a=n(0),o=n.n(a);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=o.a.createContext({}),d=function(e){var t=o.a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},p=function(e){var t=d(e.components);return o.a.createElement(c.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},m=o.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,r=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),p=d(n),m=a,u=p["".concat(r,".").concat(m)]||p[m]||b[m]||i;return n?o.a.createElement(u,s(s({ref:t},c),{},{components:n})):o.a.createElement(u,s({ref:t},c))}));function u(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,r=new Array(i);r[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:a,r[1]=s;for(var c=2;c-.jpg"),"."),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"# Optional: Configuration for the jpg snapshots written to the clips directory for each event\nsnapshots:\n # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)\n # This value can be set via MQTT and will be updated in startup based on retained value\n enabled: False\n # Optional: print a timestamp on the snapshots (default: shown below)\n timestamp: False\n # Optional: draw bounding box on the snapshots (default: shown below)\n bounding_box: False\n # Optional: crop the snapshot (default: shown below)\n crop: False\n # Optional: height to resize the snapshot to (default: original size)\n height: 175\n # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)\n required_zones: []\n # Optional: Camera override for retention settings (default: global values)\n retain:\n # Required: Default retention days (default: shown below)\n default: 10\n # Optional: Per object retention days\n objects:\n person: 15\n")),Object(i.b)("h2",{id:"247-recordings"},"24/7 Recordings"),Object(i.b)("p",null,"24/7 recordings can be enabled and are stored at ",Object(i.b)("inlineCode",{parentName:"p"},"/media/frigate/recordings"),". The folder structure for the recordings is ",Object(i.b)("inlineCode",{parentName:"p"},"YYYY-MM/DD/HH//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."),Object(i.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"caution")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"Previous versions of frigate included ",Object(i.b)("inlineCode",{parentName:"p"},"-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."))),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"# Optional: 24/7 recording configuration\nrecord:\n # Optional: Enable recording (default: global setting)\n enabled: False\n # Optional: Number of days to retain (default: global setting)\n retain_days: 30\n")),Object(i.b)("h2",{id:"rtmp-streams"},"RTMP streams"),Object(i.b)("p",null,"Frigate can re-stream your video feed as a RTMP feed for other applications such as Home Assistant to utilize it at ",Object(i.b)("inlineCode",{parentName:"p"},"rtmp:///live/"),". Port 1935 must be open. This allows you to use a video feed for detection in frigate and Home Assistant live view at the same time without having to make two separate connections to the camera. The video feed is copied from the original video feed directly to avoid re-encoding. This feed does not include any annotation by Frigate."),Object(i.b)("p",null,"Some video feeds are not compatible with RTMP. If you are experiencing issues, check to make sure your camera feed is h264 with AAC audio. If your camera doesn't support a compatible format for RTMP, you can use the ffmpeg args to re-encode it on the fly at the expense of increased CPU utilization."),Object(i.b)("h2",{id:"full-example"},"Full example"),Object(i.b)("p",null,"The following is a full example of all of the options together for a camera configuration"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"cameras:\n # Required: name of the camera\n back:\n # Required: ffmpeg settings for the camera\n ffmpeg:\n # Required: A list of input streams for the camera. See documentation for more information.\n inputs:\n # Required: the path to the stream\n # NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}\n - path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2\n # Required: list of roles for this stream. valid values are: detect,record,clips,rtmp\n # NOTICE: In addition to assigning the record, clips, and rtmp roles,\n # they must also be enabled in the camera config.\n roles:\n - detect\n - rtmp\n # Optional: stream specific global args (default: inherit)\n global_args:\n # Optional: stream specific hwaccel args (default: inherit)\n hwaccel_args:\n # Optional: stream specific input args (default: inherit)\n input_args:\n # Optional: camera specific global args (default: inherit)\n global_args:\n # Optional: camera specific hwaccel args (default: inherit)\n hwaccel_args:\n # Optional: camera specific input args (default: inherit)\n input_args:\n # Optional: camera specific output args (default: inherit)\n output_args:\n\n # Required: width of the frame for the input with the detect role\n width: 1280\n # Required: height of the frame for the input with the detect role\n height: 720\n # Optional: desired fps for your camera for the input with the detect role\n # NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.\n # Frigate will attempt to autodetect if not specified.\n fps: 5\n\n # Optional: camera level motion config\n motion:\n # Optional: motion mask\n # NOTE: see docs for more detailed info on creating masks\n mask: 0,900,1080,900,1080,1920,0,1920\n\n # Optional: timeout for highest scoring image before allowing it\n # to be replaced by a newer image. (default: shown below)\n best_image_timeout: 60\n\n # Optional: zones for this camera\n zones:\n # Required: name of the zone\n # NOTE: This must be different than any camera names, but can match with another zone on another\n # camera.\n front_steps:\n # Required: List of x,y coordinates to define the polygon of the zone.\n # NOTE: Coordinates can be generated at https://www.image-map.net/\n coordinates: 545,1077,747,939,788,805\n # Optional: Zone level object filters.\n # NOTE: The global and camera filters are applied upstream.\n filters:\n person:\n min_area: 5000\n max_area: 100000\n threshold: 0.7\n\n # Optional: Camera level detect settings\n detect:\n # Optional: enables detection for the camera (default: True)\n # This value can be set via MQTT and will be updated in startup based on retained value\n enabled: True\n # Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)\n max_disappeared: 25\n\n # Optional: save clips configuration\n clips:\n # Required: enables clips for the camera (default: shown below)\n # This value can be set via MQTT and will be updated in startup based on retained value\n enabled: False\n # Optional: Number of seconds before the event to include in the clips (default: shown below)\n pre_capture: 5\n # Optional: Number of seconds after the event to include in the clips (default: shown below)\n post_capture: 5\n # Optional: Objects to save clips for. (default: all tracked objects)\n objects:\n - person\n # Optional: Restrict clips to objects that entered any of the listed zones (default: no required zones)\n required_zones: []\n # Optional: Camera override for retention settings (default: global values)\n retain:\n # Required: Default retention days (default: shown below)\n default: 10\n # Optional: Per object retention days\n objects:\n person: 15\n\n # Optional: 24/7 recording configuration\n record:\n # Optional: Enable recording (default: global setting)\n enabled: False\n # Optional: Number of days to retain (default: global setting)\n retain_days: 30\n\n # Optional: RTMP re-stream configuration\n rtmp:\n # Required: Enable the live stream (default: True)\n enabled: True\n\n # Optional: Configuration for the jpg snapshots written to the clips directory for each event\n snapshots:\n # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)\n # This value can be set via MQTT and will be updated in startup based on retained value\n enabled: False\n # Optional: print a timestamp on the snapshots (default: shown below)\n timestamp: False\n # Optional: draw bounding box on the snapshots (default: shown below)\n bounding_box: False\n # Optional: crop the snapshot (default: shown below)\n crop: False\n # Optional: height to resize the snapshot to (default: original size)\n height: 175\n # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)\n required_zones: []\n # Optional: Camera override for retention settings (default: global values)\n retain:\n # Required: Default retention days (default: shown below)\n default: 10\n # Optional: Per object retention days\n objects:\n person: 15\n\n # Optional: Configuration for the jpg snapshots published via MQTT\n mqtt:\n # Optional: Enable publishing snapshot via mqtt for camera (default: shown below)\n # NOTE: Only applies to publishing image data to MQTT via 'frigate///snapshot'.\n # All other messages will still be published.\n enabled: True\n # Optional: print a timestamp on the snapshots (default: shown below)\n timestamp: True\n # Optional: draw bounding box on the snapshots (default: shown below)\n bounding_box: True\n # Optional: crop the snapshot (default: shown below)\n crop: True\n # Optional: height to resize the snapshot to (default: shown below)\n height: 270\n # Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)\n required_zones: []\n\n # Optional: Camera level object filters config.\n objects:\n track:\n - person\n - car\n # Optional: mask to prevent all object types from being detected in certain areas (default: no mask)\n # Checks based on the bottom center of the bounding box of the object.\n # NOTE: This mask is COMBINED with the object type specific mask below\n mask: 0,0,1000,0,1000,200,0,200\n filters:\n person:\n min_area: 5000\n max_area: 100000\n min_score: 0.5\n threshold: 0.7\n # Optional: mask to prevent this object type from being detected in certain areas (default: no mask)\n # Checks based on the bottom center of the bounding box of the object\n mask: 0,0,1000,0,1000,200,0,200\n")),Object(i.b)("h2",{id:"camera-specific-configuration"},"Camera specific configuration"),Object(i.b)("h3",{id:"mjpeg-cameras"},"MJPEG Cameras"),Object(i.b)("p",null,"The input and output parameters need to be adjusted for MJPEG cameras"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),'input_args:\n - -avoid_negative_ts\n - make_zero\n - -fflags\n - nobuffer\n - -flags\n - low_delay\n - -strict\n - experimental\n - -fflags\n - +genpts+discardcorrupt\n - -r\n - "3" # <---- adjust depending on your desired frame rate from the mjpeg image\n - -use_wallclock_as_timestamps\n - "1"\n')),Object(i.b)("p",null,"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."),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),"output_args:\n record: -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v libx264 -an\n clips: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v libx264 -an\n rtmp: -c:v libx264 -an -f flv\n")),Object(i.b)("h3",{id:"rtmp-cameras"},"RTMP Cameras"),Object(i.b)("p",null,"The input parameters need to be adjusted for RTMP cameras"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),'ffmpeg:\n input_args:\n - -avoid_negative_ts\n - make_zero\n - -fflags\n - nobuffer\n - -flags\n - low_delay\n - -strict\n - experimental\n - -fflags\n - +genpts+discardcorrupt\n - -use_wallclock_as_timestamps\n - "1"\n')),Object(i.b)("h3",{id:"reolink-410520-possibly-others"},"Reolink 410/520 (possibly others)"),Object(i.b)("p",null,"Several users have reported success with the rtmp video from Reolink cameras."),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),'ffmpeg:\n input_args:\n - -avoid_negative_ts\n - make_zero\n - -fflags\n - nobuffer\n - -flags\n - low_delay\n - -strict\n - experimental\n - -fflags\n - +genpts+discardcorrupt\n - -rw_timeout\n - "5000000"\n - -use_wallclock_as_timestamps\n - "1"\n')),Object(i.b)("h3",{id:"blue-iris-rtsp-cameras"},"Blue Iris RTSP Cameras"),Object(i.b)("p",null,"You will need to remove ",Object(i.b)("inlineCode",{parentName:"p"},"nobuffer")," flag for Blue Iris RTSP cameras"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-yaml"}),'ffmpeg:\n input_args:\n - -avoid_negative_ts\n - make_zero\n - -flags\n - low_delay\n - -strict\n - experimental\n - -fflags\n - +genpts+discardcorrupt\n - -rtsp_transport\n - tcp\n - -stimeout\n - "5000000"\n - -use_wallclock_as_timestamps\n - "1"\n')))}d.isMDXComponent=!0},99:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return u}));var a=n(0),o=n.n(a);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=o.a.createContext({}),d=function(e){var t=o.a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},p=function(e){var t=d(e.components);return o.a.createElement(c.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},m=o.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,r=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),p=d(n),m=a,u=p["".concat(r,".").concat(m)]||p[m]||b[m]||i;return n?o.a.createElement(u,s(s({ref:t},c),{},{components:n})):o.a.createElement(u,s({ref:t},c))}));function u(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,r=new Array(i);r[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:a,r[1]=s;for(var c=2;c Page 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.

- + diff --git a/configuration/advanced/index.html b/configuration/advanced/index.html index 231a0ff2d..400e52efe 100644 --- a/configuration/advanced/index.html +++ b/configuration/advanced/index.html @@ -8,7 +8,7 @@ Advanced | Frigate - + @@ -22,7 +22,7 @@

Advanced

Advanced configuration#

motion#

Global motion detection config. These may also be defined 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: 25
# Optional: Minimum size in pixels in the resized motion image that counts as motion
# Increasing this value will prevent smaller areas of motion from being detected. Decreasing will make motion detection more sensitive to smaller
# moving objects.
contour_area: 100
# Optional: Alpha value passed to cv2.accumulateWeighted when averaging the motion delta across multiple frames (default: shown below)
# Higher values mean the current frame impacts the delta a lot, and a single raindrop may register as motion.
# Too low and a fast moving person wont be detected as motion.
delta_alpha: 0.2
# 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.2
# Optional: Height of the resized motion frame (default: 1/6th of the original frame height)
# This operates as an efficient blur alternative. 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: 180

detect#

Global object detection settings. These may also be defined at the camera level.

detect:
# Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)
max_disappeared: 25

logger#

Change the default log level for troubleshooting purposes.

logger:
# Optional: default log level (default: shown below)
default: info
# Optional: module by module log level configuration
logs:
frigate.mqtt: error

Available log levels are: debug, info, warning, error, critical

Examples of available modules are:

  • frigate.app
  • frigate.mqtt
  • frigate.edgetpu
  • frigate.zeroconf
  • detector.<detector_name>
  • watchdog.<camera_name>
  • ffmpeg.<camera_name>.<sorted_roles> NOTE: All FFmpeg logs are sent as error level.

environment_vars#

This section can be used to set environment variables for those unable to modify the environment of the container (ie. within Hass.io)

environment_vars:
EXAMPLE_VAR: value

database#

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.

database:
path: /media/frigate/clips/frigate.db

detectors#

detectors:
# Required: name of the detector
coral:
# Required: type of the detector
# Valid values are 'edgetpu' (requires device property below) and 'cpu'.
type: edgetpu
# Optional: device name as defined here: https://coral.ai/docs/edgetpu/multiple-edgetpu/#using-the-tensorflow-lite-python-api
device: usb
# Optional: num_threads value passed to the tflite.Interpreter (default: shown below)
# This value is only used for CPU types
num_threads: 3

model#

model:
# Required: height of the trained model
height: 320
# Required: width of the trained model
width: 320
- + diff --git a/configuration/cameras/index.html b/configuration/cameras/index.html index c656bf37b..c2644feb8 100644 --- a/configuration/cameras/index.html +++ b/configuration/cameras/index.html @@ -8,7 +8,7 @@ Cameras | Frigate - + @@ -16,11 +16,11 @@ - +
-

Cameras

Setting Up Camera Inputs#

Up to 4 inputs can be configured for each camera and the role of each input can be mixed and matched based on your needs. This allows you to use a lower resolution stream for object detection, but create clips from a higher resolution stream, or vice versa.

Each role can only be assigned to one input per camera. The options for roles are as follows:

RoleDescription
detectMain feed for object detection
clipsClips of events from objects detected in the detect feed. docs
recordSaves 60 second segments of the video feed. docs
rtmpBroadcast as an RTMP feed for other services to consume. docs

Example#

mqtt:
host: mqtt.server.com
cameras:
back:
ffmpeg:
inputs:
- path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2
roles:
- detect
- rtmp
- path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/live
roles:
- clips
- record
width: 1280
height: 720
fps: 5

Masks & Zones#

Masks#

Masks are used to ignore initial detection in areas of your camera's field of view.

There are two types of masks available:

  • Motion masks: Motion masks are used to prevent unwanted types of motion from triggering detection. Try watching the video 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. 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.

To create a poly mask:

  1. Visit the web UI
  2. Click the camera you wish to create a mask for
  3. Click "Mask & Zone creator"
  4. Click "Add" on the type of mask or zone you would like to create
  5. Click on the camera's latest image to create a masked area. The yaml representation will be updated in real-time
  6. When you've finished creating your mask, click "Copy" and paste the contents into your config.yaml file and restart Frigate

Example of a finished row corresponding to the below example image:

motion:
mask: "0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432"

poly

# Optional: camera level motion config
motion:
# Optional: motion mask
# NOTE: see docs for more detailed info on creating masks
mask: 0,900,1080,900,1080,1920,0,1920

Zones#

Zones allow you to define a specific area of the frame and apply additional filters for object types so you can determine whether or not an object is within a particular area. Zones cannot have the same name as a camera. If desired, a single zone can include multiple cameras if you have multiple cameras covering the same area by configuring zones with the same name for each camera.

During testing, draw_zones should be set in the config to draw the zone on the frames so you can adjust as needed. The zone line will increase in thickness when any object enters the zone.

To create a zone, follow the same steps above for a "Motion mask", but use the section of the web UI for creating a zone instead.

# 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: Coordinates can be generated at https://www.image-map.net/
coordinates: 545,1077,747,939,788,805
# 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

Objects#

For a list of available objects, see the objects documentation.

# Optional: Camera level object filters config.
objects:
track:
- person
- car
# 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
filters:
person:
min_area: 5000
max_area: 100000
min_score: 0.5
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

Clips#

Frigate can save video clips without any CPU overhead for encoding by simply copying the stream directly with FFmpeg. It leverages FFmpeg's segment functionality to maintain a cache of video for each camera. The cache files are written to disk at /tmp/cache and do not introduce memory overhead. When an object is being tracked, it will extend the cache to ensure it can assemble a clip when the event ends. Once the event ends, it again uses FFmpeg to assemble a clip by combining the video clips without any encoding by the CPU. Assembled clips are are saved to /media/frigate/clips. Clips are retained according to the retention settings defined on the config for each object type.

These clips will not be playable in the web UI or in Home Assistant's media browser unless your camera sends video as h264.

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.

clips:
# Required: enables clips for the camera (default: shown below)
# This value can be set via MQTT and will be updated in startup based on retained value
enabled: False
# Optional: Number of seconds before the event to include in the clips (default: shown below)
pre_capture: 5
# Optional: Number of seconds after the event to include in the clips (default: shown below)
post_capture: 5
# Optional: Objects to save clips for. (default: all tracked objects)
objects:
- person
# Optional: Restrict clips to objects that entered any of the listed zones (default: no required zones)
required_zones: []
# Optional: Camera override for retention settings (default: global values)
retain:
# Required: Default retention days (default: shown below)
default: 10
# Optional: Per object retention days
objects:
person: 15

Snapshots#

Frigate can save a snapshot image to /media/frigate/clips for each event named as <camera>-<id>.jpg.

# Optional: Configuration for the jpg snapshots written to the clips directory for each event
snapshots:
# Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
# This value can be set via MQTT and will be updated in startup based on retained value
enabled: False
# Optional: print a timestamp on the snapshots (default: shown below)
timestamp: False
# Optional: draw bounding box on the snapshots (default: shown below)
bounding_box: False
# 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)
retain:
# Required: Default retention days (default: shown below)
default: 10
# Optional: Per object retention days
objects:
person: 15

24/7 Recordings#

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.

# Optional: 24/7 recording configuration
record:
# Optional: Enable recording (default: global setting)
enabled: False
# Optional: Number of days to retain (default: global setting)
retain_days: 30

RTMP streams#

Frigate can re-stream your video feed as a RTMP feed for other applications such as Home Assistant to utilize it at rtmp://<frigate_host>/live/<camera_name>. Port 1935 must be open. This allows you to use a video feed for detection in frigate and Home Assistant live view at the same time without having to make two separate connections to the camera. The video feed is copied from the original video feed directly to avoid re-encoding. This feed does not include any annotation by Frigate.

Some video feeds are not compatible with RTMP. If you are experiencing issues, check to make sure your camera feed is h264 with AAC audio. If your camera doesn't support a compatible format for RTMP, you can use the ffmpeg args to re-encode it on the fly at the expense of increased CPU utilization.

Full example#

The following is a full example of all of the options together for a camera configuration

cameras:
# Required: name of the camera
back:
# Required: ffmpeg settings for the camera
ffmpeg:
# Required: A list of input streams for the camera. See documentation for more information.
inputs:
# Required: the path to the stream
# NOTE: Environment variables that begin with 'FRIGATE_' may 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: detect,record,clips,rtmp
# NOTICE: In addition to assigning the record, clips, and rtmp roles,
# they must also be enabled in the camera config.
roles:
- detect
- 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:
+

Cameras

Setting Up Camera Inputs#

Up to 4 inputs can be configured for each camera and the role of each input can be mixed and matched based on your needs. This allows you to use a lower resolution stream for object detection, but create clips from a higher resolution stream, or vice versa.

Each role can only be assigned to one input per camera. The options for roles are as follows:

RoleDescription
detectMain feed for object detection
clipsClips of events from objects detected in the detect feed. docs
recordSaves 60 second segments of the video feed. docs
rtmpBroadcast as an RTMP feed for other services to consume. docs

Example#

mqtt:
host: mqtt.server.com
cameras:
back:
ffmpeg:
inputs:
- path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2
roles:
- detect
- rtmp
- path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/live
roles:
- clips
- record
width: 1280
height: 720
fps: 5

width, height, and fps are only used for the detect role. Other streams are passed through, so there is no need to specify the resolution.

Masks & Zones#

Masks#

Masks are used to ignore initial detection in areas of your camera's field of view.

There are two types of masks available:

  • Motion masks: Motion masks are used to prevent unwanted types of motion from triggering detection. Try watching the video 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. 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.

To create a poly mask:

  1. Visit the web UI
  2. Click the camera you wish to create a mask for
  3. Click "Mask & Zone creator"
  4. Click "Add" on the type of mask or zone you would like to create
  5. Click on the camera's latest image to create a masked area. The yaml representation will be updated in real-time
  6. When you've finished creating your mask, click "Copy" and paste the contents into your config.yaml file and restart Frigate

Example of a finished row corresponding to the below example image:

motion:
mask: "0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432"

poly

# Optional: camera level motion config
motion:
# Optional: motion mask
# NOTE: see docs for more detailed info on creating masks
mask: 0,900,1080,900,1080,1920,0,1920

Zones#

Zones allow you to define a specific area of the frame and apply additional filters for object types so you can determine whether or not an object is within a particular area. Zones cannot have the same name as a camera. If desired, a single zone can include multiple cameras if you have multiple cameras covering the same area by configuring zones with the same name for each camera.

During testing, draw_zones should be set in the config to draw the zone on the frames so you can adjust as needed. The zone line will increase in thickness when any object enters the zone.

To create a zone, follow the same steps above for a "Motion mask", but use the section of the web UI for creating a zone instead.

# 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: Coordinates can be generated at https://www.image-map.net/
coordinates: 545,1077,747,939,788,805
# 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

Objects#

For a list of available objects, see the objects documentation.

# Optional: Camera level object filters config.
objects:
track:
- person
- car
# 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
filters:
person:
min_area: 5000
max_area: 100000
min_score: 0.5
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

Clips#

Frigate can save video clips without any CPU overhead for encoding by simply copying the stream directly with FFmpeg. It leverages FFmpeg's segment functionality to maintain a cache of video for each camera. The cache files are written to disk at /tmp/cache and do not introduce memory overhead. When an object is being tracked, it will extend the cache to ensure it can assemble a clip when the event ends. Once the event ends, it again uses FFmpeg to assemble a clip by combining the video clips without any encoding by the CPU. Assembled clips are are saved to /media/frigate/clips. Clips are retained according to the retention settings defined on the config for each object type.

These clips will not be playable in the web UI or in Home Assistant's media browser unless your camera sends video as h264.

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.

clips:
# Required: enables clips for the camera (default: shown below)
# This value can be set via MQTT and will be updated in startup based on retained value
enabled: False
# Optional: Number of seconds before the event to include in the clips (default: shown below)
pre_capture: 5
# Optional: Number of seconds after the event to include in the clips (default: shown below)
post_capture: 5
# Optional: Objects to save clips for. (default: all tracked objects)
objects:
- person
# Optional: Restrict clips to objects that entered any of the listed zones (default: no required zones)
required_zones: []
# Optional: Camera override for retention settings (default: global values)
retain:
# Required: Default retention days (default: shown below)
default: 10
# Optional: Per object retention days
objects:
person: 15

Snapshots#

Frigate can save a snapshot image to /media/frigate/clips for each event named as <camera>-<id>.jpg.

# Optional: Configuration for the jpg snapshots written to the clips directory for each event
snapshots:
# Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
# This value can be set via MQTT and will be updated in startup based on retained value
enabled: False
# Optional: print a timestamp on the snapshots (default: shown below)
timestamp: False
# Optional: draw bounding box on the snapshots (default: shown below)
bounding_box: False
# 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)
retain:
# Required: Default retention days (default: shown below)
default: 10
# Optional: Per object retention days
objects:
person: 15

24/7 Recordings#

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.

# Optional: 24/7 recording configuration
record:
# Optional: Enable recording (default: global setting)
enabled: False
# Optional: Number of days to retain (default: global setting)
retain_days: 30

RTMP streams#

Frigate can re-stream your video feed as a RTMP feed for other applications such as Home Assistant to utilize it at rtmp://<frigate_host>/live/<camera_name>. Port 1935 must be open. This allows you to use a video feed for detection in frigate and Home Assistant live view at the same time without having to make two separate connections to the camera. The video feed is copied from the original video feed directly to avoid re-encoding. This feed does not include any annotation by Frigate.

Some video feeds are not compatible with RTMP. If you are experiencing issues, check to make sure your camera feed is h264 with AAC audio. If your camera doesn't support a compatible format for RTMP, you can use the ffmpeg args to re-encode it on the fly at the expense of increased CPU utilization.

Full example#

The following is a full example of all of the options together for a camera configuration

cameras:
# Required: name of the camera
back:
# Required: ffmpeg settings for the camera
ffmpeg:
# Required: A list of input streams for the camera. See documentation for more information.
inputs:
# Required: the path to the stream
# NOTE: Environment variables that begin with 'FRIGATE_' may 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: detect,record,clips,rtmp
# NOTICE: In addition to assigning the record, clips, and rtmp roles,
# they must also be enabled in the camera config.
roles:
- detect
- 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:
# Required: width of the frame for the input with the detect role
width: 1280
# Required: height of the frame for the input with the detect role
height: 720
# Optional: desired fps for your camera for the input with the detect role
# NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
# Frigate will attempt to autodetect if not specified.
fps: 5
# Optional: camera level motion config
motion:
# Optional: motion mask
# NOTE: see docs for more detailed info on creating masks
mask: 0,900,1080,900,1080,1920,0,1920
# Optional: timeout for highest scoring image before allowing it
# to be replaced by a newer image. (default: shown below)
best_image_timeout: 60
@@ -33,7 +33,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/<camera_name>/<object_name>/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: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
required_zones: []
# Optional: Camera level object filters config.
objects:
track:
- person
- car
# 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
filters:
person:
min_area: 5000
max_area: 100000
min_score: 0.5
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

Camera specific configuration#

MJPEG Cameras#

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.

output_args:
record: -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v libx264 -an
clips: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v libx264 -an
rtmp: -c:v libx264 -an -f flv

RTMP Cameras#

The input parameters need to be adjusted for RTMP cameras

ffmpeg:
input_args:
- -avoid_negative_ts
- make_zero
- -fflags
- nobuffer
- -flags
- low_delay
- -strict
- experimental
- -fflags
- +genpts+discardcorrupt
- -use_wallclock_as_timestamps
- "1"

Reolink 410/520 (possibly others)#

Several users have reported success with the rtmp video from Reolink cameras.

ffmpeg:
input_args:
- -avoid_negative_ts
- make_zero
- -fflags
- nobuffer
- -flags
- low_delay
- -strict
- experimental
- -fflags
- +genpts+discardcorrupt
- -rw_timeout
- "5000000"
- -use_wallclock_as_timestamps
- "1"

Blue Iris RTSP Cameras#

You will need to remove nobuffer flag for Blue Iris RTSP cameras

ffmpeg:
input_args:
- -avoid_negative_ts
- make_zero
- -flags
- low_delay
- -strict
- experimental
- -fflags
- +genpts+discardcorrupt
- -rtsp_transport
- tcp
- -stimeout
- "5000000"
- -use_wallclock_as_timestamps
- "1"
- + @@ -41,6 +41,6 @@ - + \ No newline at end of file diff --git a/configuration/detectors/index.html b/configuration/detectors/index.html index aa73bb1a7..d45dcbefa 100644 --- a/configuration/detectors/index.html +++ b/configuration/detectors/index.html @@ -8,7 +8,7 @@ Detectors | Frigate - + @@ -22,7 +22,7 @@

Detectors

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.

Frigate supports edgetpu and cpu as detector types. The device value should be specified according to the Documentation for the TensorFlow Lite Python API.

Note: There is no support for Nvidia GPUs to perform object detection with tensorflow. It can be used for ffmpeg decoding, but not object detection.

Single USB Coral:

detectors:
coral:
type: edgetpu
device: usb

Multiple USB Corals:

detectors:
coral1:
type: edgetpu
device: usb:0
coral2:
type: edgetpu
device: usb:1

Native Coral (Dev Board):

detectors:
coral:
type: edgetpu
device: ''

Multiple PCIE/M.2 Corals:

detectors:
coral1:
type: edgetpu
device: pci:0
coral2:
type: edgetpu
device: pci:1

Mixing Corals:

detectors:
coral_usb:
type: edgetpu
device: usb
coral_pci:
type: edgetpu
device: pci

CPU Detectors (not recommended):

detectors:
cpu1:
type: cpu
cpu2:
type: cpu
- + diff --git a/configuration/false_positives/index.html b/configuration/false_positives/index.html index 24714eb4b..4a58ed173 100644 --- a/configuration/false_positives/index.html +++ b/configuration/false_positives/index.html @@ -8,7 +8,7 @@ Reducing false positives | Frigate - + @@ -22,7 +22,7 @@

Reducing false positives

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:

FrameCurrent ScoreScore HistoryComputed ScoreDetected Object
10.70.0, 0, 0.70.0No
20.550.0, 0.7, 0.00.0No
30.850.7, 0.0, 0.850.7No
40.900.7, 0.85, 0.95, 0.900.875Yes
50.880.7, 0.85, 0.95, 0.90, 0.880.88Yes
60.950.7, 0.85, 0.95, 0.90, 0.88, 0.950.89Yes

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.

- + diff --git a/configuration/index/index.html b/configuration/index/index.html index 983cb8c50..2eee42b5a 100644 --- a/configuration/index/index.html +++ b/configuration/index/index.html @@ -8,7 +8,7 @@ Configuration | Frigate - + @@ -22,7 +22,7 @@

Configuration

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:

mqtt:
host: mqtt.server.com
cameras:
back:
ffmpeg:
inputs:
- path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2
roles:
- detect
- rtmp
width: 1280
height: 720
fps: 5

Required#

mqtt#

mqtt:
# Required: host name
host: mqtt.server.com
# Optional: port (default: shown below)
port: 1883
# Optional: topic prefix (default: shown below)
# WARNING: must be unique if you are running multiple instances
topic_prefix: frigate
# Optional: client id (default: shown below)
# WARNING: must be unique if you are running multiple instances
client_id: frigate
# Optional: user
user: mqtt_user
# Optional: password
# NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}.
# eg. password: '{FRIGATE_MQTT_PASSWORD}'
password: password
# Optional: interval in seconds for publishing stats (default: shown below)
stats_interval: 60

cameras#

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.

cameras:
# Name of your camera
front_door:
ffmpeg:
inputs:
- path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2
roles:
- detect
- rtmp
width: 1280
height: 720
fps: 5

Optional#

clips#

clips:
# Optional: Maximum length of time to retain video during long events. (default: shown below)
# NOTE: If an object is being tracked for longer than this amount of time, the cache
# will begin to expire and the resulting clip will be the last x seconds of the event.
max_seconds: 300
# Optional: size of tmpfs mount to create for cache files (default: not set)
# mount -t tmpfs -o size={tmpfs_cache_size} tmpfs /tmp/cache
# NOTICE: Addon users must have Protection mode disabled for the addon when using this setting.
# Also, if you have mounted a tmpfs volume through docker, this value should not be set in your config.
tmpfs_cache_size: 256m
# Optional: Retention settings for clips (default: shown below)
retain:
# Required: Default retention days (default: shown below)
default: 10
# Optional: Per object retention days
objects:
person: 15

ffmpeg#

ffmpeg:
# Optional: global ffmpeg args (default: shown below)
global_args: -hide_banner -loglevel warning
# 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: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
# Optional: global output args
output_args:
# Optional: output args for detect streams (default: shown below)
detect: -f rawvideo -pix_fmt yuv420p
# Optional: output args for record streams (default: shown below)
record: -f segment -segment_time 60 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
# Optional: output args for clips streams (default: shown below)
clips: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
# Optional: output args for rtmp streams (default: shown below)
rtmp: -c copy -f flv

objects#

Can be overridden at the camera level. For a list of available objects, see the objects documentation.

objects:
# Optional: list of objects to track from labelmap.txt (default: shown below)
track:
- person
# 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 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

record#

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.

record:
# Optional: Enable recording
enabled: False
# Optional: Number of days to retain
retain_days: 30
- + diff --git a/configuration/nvdec/index.html b/configuration/nvdec/index.html index 9e09adde1..bb162f3e6 100644 --- a/configuration/nvdec/index.html +++ b/configuration/nvdec/index.html @@ -8,7 +8,7 @@ nVidia hardware decoder | Frigate - + @@ -35,7 +35,7 @@ processes:

using the fps filter:

output_args:
- -filter:v
- fps=fps=5

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.

- + diff --git a/configuration/objects/index.html b/configuration/objects/index.html index 60870ae21..30824db3e 100644 --- a/configuration/objects/index.html +++ b/configuration/objects/index.html @@ -8,7 +8,7 @@ Default available objects | Frigate - + @@ -22,7 +22,7 @@

Default available objects

By default, Frigate includes the following object models from the Google Coral test data.

  • person
  • bicycle
  • car
  • motorcycle
  • airplane
  • bus
  • train
  • car
  • boat
  • traffic light
  • fire hydrant
  • stop sign
  • parking meter
  • bench
  • bird
  • cat
  • dog
  • horse
  • sheep
  • cow
  • elephant
  • bear
  • zebra
  • giraffe
  • backpack
  • umbrella
  • handbag
  • tie
  • suitcase
  • frisbee
  • skis
  • snowboard
  • sports ball
  • kite
  • baseball bat
  • baseball glove
  • skateboard
  • surfboard
  • tennis racket
  • bottle
  • wine glass
  • cup
  • fork
  • knife
  • spoon
  • bowl
  • banana
  • apple
  • sandwich
  • orange
  • broccoli
  • carrot
  • hot dog
  • pizza
  • donut
  • cake
  • chair
  • couch
  • potted plant
  • bed
  • dining table
  • toilet
  • tv
  • laptop
  • mouse
  • remote
  • keyboard
  • cell phone
  • microwave
  • oven
  • toaster
  • sink
  • refrigerator
  • book
  • clock
  • vase
  • scissors
  • teddy bear
  • hair drier
  • toothbrush

Custom Models#

Models for both CPU and EdgeTPU (Coral) are bundled in the image. You can use your own models with volume mounts:

  • CPU Model: /cpu_model.tflite
  • EdgeTPU Model: /edgetpu_model.tflite
  • Labels: /labelmap.txt

You also need to update the model width/height in the config if they differ from the defaults.

Customizing the Labelmap#

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:

  • Download the COCO labelmap
  • Modify the label names as desired. For example, change 7 truck to 7 car
  • Mount the new file at /labelmap.txt in the container with an additional volume
    -v ./config/labelmap.txt:/labelmap.txt
- + diff --git a/configuration/optimizing/index.html b/configuration/optimizing/index.html index aea89a889..ba339d3d0 100644 --- a/configuration/optimizing/index.html +++ b/configuration/optimizing/index.html @@ -8,7 +8,7 @@ Optimizing performance | Frigate - + @@ -25,7 +25,7 @@ NOTICE: If you are using the addon, ensure you turn off Protection mode for hardware acceleration.

ffmpeg:
hwaccel_args:
- -c:v
- h264_v4l2m2m

Intel-based CPUs (<10th Generation) via Quicksync (https://trac.ffmpeg.org/wiki/Hardware/QuickSync)

ffmpeg:
hwaccel_args:
- -hwaccel
- vaapi
- -hwaccel_device
- /dev/dri/renderD128
- -hwaccel_output_format
- yuv420p

Intel-based CPUs (>=10th Generation) via Quicksync (https://trac.ffmpeg.org/wiki/Hardware/QuickSync)

ffmpeg:
hwaccel_args:
- -hwaccel
- qsv
- -qsv_device
- /dev/dri/renderD128

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.

- + diff --git a/contributing/index.html b/contributing/index.html index a3a899d66..9d54a2739 100644 --- a/contributing/index.html +++ b/contributing/index.html @@ -8,7 +8,7 @@ Contributing | Frigate - + @@ -22,7 +22,7 @@

Contributing

Getting the source#

Core, Web, Docker, and Documentation#

This repository holds the main Frigate application and all of its dependencies.

Fork blakeblackshear/frigate to your own GitHub profile, then clone the forked repo to your local machine.

From here, follow the guides for:

Frigate Home Assistant Addon#

This repository holds the Home Assistant Addon, for use with Home Assistant OS and compatible installations. It is the piece that allows you to run Frigate from your Home Assistant Supervisor tab.

Fork blakeblackshear/frigate-hass-addons to your own Github profile, then clone the forked repo to your local machine.

Frigate Home Assistant Integration#

This repository holds the custom integration that allows your Home Assistant installation to automatically create entities for your Frigate instance, whether you run that with the addon or in a separate Docker instance.

Fork blakeblackshear/frigate-hass-integration to your own GitHub profile, then clone the forked repo to your local machine.

Core#

Prerequisites#

Web Interface#

Prerequisites#

Making changes#

1. Set up a Frigate instance#

The Web UI requires an instance of Frigate to interact with for all of its data. You can either run an instance locally (recommended) or attach to a separate instance accessible on your network.

To run the local instance, follow the core development instructions.

If you won't be making any changes to the Frigate HTTP API, you can attach the web development server to any Frigate instance on your network. Skip this step and go to 3a.

2. Install dependencies#

cd web && npm install

3. Run the development server#

cd web && npm run start

3a. Run the development server against a non-local instance#

To run the development server against a non-local instance, you will need to provide an environment variable, SNOWPACK_PUBLIC_API_HOST that tells the web application how to connect to the Frigate API:

cd web && SNOWPACK_PUBLIC_API_HOST=http://<ip-address-to-your-frigate-instance>:5000 npm run start

4. Making changes#

The Web UI is built using Snowpack, Preact, and Tailwind CSS.

Light guidelines and advice:

  • Avoid adding more dependencies. The web UI intends to be lightweight and fast to load.
  • Do not make large sweeping changes. Open a discussion on GitHub for any large or architectural ideas.
  • Ensure lint passes. This command will ensure basic conformance to styles, applying as many automatic fixes as possible, including Prettier formatting.
npm run lint
  • Add to unit tests and ensure they pass. As much as possible, you should strive to increase test coverage whenever making changes. This will help ensure features do not accidentally become broken in the future.
npm run test
  • Test in different browsers. Firefox, Chrome, and Safari all have different quirks that make them unique targets to interact with.

Documentation#

Prerequisites#

Making changes#

1. Installation#

npm run install

2. Local Development#

npm run start

This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.

The docs are built using Docusaurus v2. Please refer to the Docusaurus docs for more information on how to modify Frigate's documentation.

3. Build (optional)#

npm run build

This command generates static content into the build directory and can be served using any static contents hosting service.

- + diff --git a/hardware/index.html b/hardware/index.html index 8ad55a50e..05264823d 100644 --- a/hardware/index.html +++ b/hardware/index.html @@ -8,7 +8,7 @@ Recommended hardware | Frigate - + @@ -23,7 +23,7 @@

Recommended hardware

Cameras#

Cameras that output H.264 video and AAC audio will offer the most compatibility with all features of Frigate and Home Assistant. It is also helpful if your camera supports multiple substreams to allow different resolutions to be used for detection, streaming, clips, and recordings without re-encoding.

Computer#

NameInference SpeedNotes
Atomic Pi16msGood option for a dedicated low power board with a small number of cameras. Can leverage Intel QuickSync for stream decoding.
Intel NUC NUC7i3BNK8-10msGreat performance. Can handle many cameras at 5fps depending on typical amounts of motion.
BMAX B2 Plus10-12msGood balance of performance and cost. Also capable of running many other services at the same time as frigate.
Minisforum GK419-10msGreat alternative to a NUC with dual Gigabit NICs. Easily handles several 1080p cameras.
Raspberry Pi 3B (32bit)60msCan handle a small number of cameras, but the detection speeds are slow due to USB 2.0.
Raspberry Pi 4 (32bit)15-20msCan handle a small number of cameras. The 2GB version runs fine.
Raspberry Pi 4 (64bit)10-15msCan handle a small number of cameras. The 2GB version runs fine.

Unraid#

Many people have powerful enough NAS devices or home servers to also run docker. There is a Unraid Community App. To install make sure you have the community app plugin here. Then search for "Frigate" in the apps section within Unraid - you can see the online store here

NameInference SpeedNotes
M2 Coral Edge TPU6.2msInstall the Coral plugin from Unraid Community App Center info here
- + diff --git a/how-it-works/index.html b/how-it-works/index.html index e74195dfa..6a6a5361f 100644 --- a/how-it-works/index.html +++ b/how-it-works/index.html @@ -8,7 +8,7 @@ How Frigate Works | Frigate - + @@ -22,7 +22,7 @@
- + diff --git a/index.html b/index.html index 0609549ea..b4ce49d30 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ Frigate | Frigate - + @@ -22,7 +22,7 @@

Your Docusaurus site did not load properly.

A very common reason is a wrong site baseUrl configuration.

Current configured baseUrl = /frigate/

We suggest trying baseUrl =

Frigate

A complete and local NVR designed for Home Assistant with AI object detection. Uses OpenCV and Tensorflow to perform realtime object detection locally for IP cameras.

Use of a Google Coral Accelerator is optional, but highly recommended. The Coral will outperform even the best CPUs and can process 100+ FPS with very little overhead.

  • Tight integration with Home Assistant via a custom component
  • Designed to minimize resource use and maximize performance by only looking for objects when and where it is necessary
  • Leverages multiprocessing heavily with an emphasis on realtime over processing every frame
  • Uses a very low overhead motion detection to determine where to run object detection
  • Object detection with TensorFlow runs in separate processes for maximum FPS
  • Communicates over MQTT for easy integration into other systems
  • 24/7 recording
  • Re-streaming via RTMP to reduce the number of connections to your camera

Screenshots#

Media Browser

Notification

- + diff --git a/installation/index.html b/installation/index.html index d149c61ef..e82e6c7ba 100644 --- a/installation/index.html +++ b/installation/index.html @@ -8,7 +8,7 @@ Installation | Frigate - + @@ -22,7 +22,7 @@

Installation

Frigate is a Docker container that can be run on any Docker host including as a HassOS Addon. See instructions below for installing the HassOS addon.

For Home Assistant users, there is also a custom component (aka integration). This custom component adds tighter integration with Home Assistant by automatically setting up camera entities, sensors, media browser for clips and recordings, and a public API to simplify notifications.

Note that HassOS Addons and custom components are different things. If you are already running Frigate with Docker directly, you do not need the Addon since the Addon would run another instance of Frigate.

HassOS Addon#

HassOS users can install via the addon repository. Frigate requires an MQTT server.

  1. Navigate to Supervisor > Add-on Store > Repositories
  2. Add https://github.com/blakeblackshear/frigate-hass-addons
  3. Setup your network configuration in the Configuration tab if deisred
  4. Create the file frigate.yml in your config directory with your detailed Frigate configuration
  5. Start the addon container
  6. If you are using hardware acceleration for ffmpeg, you will need to disable "Protection mode"

Docker#

Make sure you choose the right image for your architecture:

ArchImage Name
amd64blakeblackshear/frigate:stable-amd64
amd64nvidiablakeblackshear/frigate:stable-amd64nvidia
armv7blakeblackshear/frigate:stable-armv7
aarch64blakeblackshear/frigate:stable-aarch64

It is recommended to run with docker-compose:

version: "3.9"
services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
image: blakeblackshear/frigate:<specify_version_tag>
devices:
- /dev/bus/usb:/dev/bus/usb
- /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
volumes:
- /etc/localtime:/etc/localtime:ro
- <path_to_config_file>:/config/config.yml:ro
- <path_to_directory_for_media>:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "5000:5000"
- "1935:1935" # RTMP feeds
environment:
FRIGATE_RTSP_PASSWORD: "password"

If you can't use docker compose, you can run the container with something similar to this:

docker run -d \
--name frigate \
--restart=unless-stopped \
--mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 \
--device /dev/bus/usb:/dev/bus/usb \
--device /dev/dri/renderD128 \
-v <path_to_directory_for_media>:/media/frigate \
-v <path_to_config_file>:/config/config.yml:ro \
-v /etc/localtime:/etc/localtime:ro \
-e FRIGATE_RTSP_PASSWORD='password' \
-p 5000:5000 \
-p 1935:1935 \
blakeblackshear/frigate:<specify_version_tag>

Calculating shm-size#

The default shm-size of 64m is fine for setups with 3 or less 1080p cameras. If frigate is exiting with "Bus error" messages, it could be because you have too many high resolution cameras and you need to specify a higher shm size.

You can calculate the necessary shm-size for each camera with the following formula:

(width * height * 1.5 * 7 + 270480)/1048576 = <shm size in mb>

The shm size cannot be set per container for Home Assistant Addons. You must set default-shm-size in /etc/docker/daemon.json to increase the default shm size. This will increase the shm size for all of your docker containers. This may or may not cause issues with your setup. https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file

Kubernetes#

Use the helm chart.

Virtualization#

For ideal performance, Frigate needs access to underlying hardware for the Coral and GPU devices for ffmpeg decoding. Running Frigate in a VM on top of Proxmox, ESXi, Virtualbox, etc. is not recommended. The virtualization layer typically introduces a sizable amount of overhead for communication with Coral devices.

Proxmox#

Some people have had success running Frigate in LXC directly with the following config:

arch: amd64
cores: 2
features: nesting=1
hostname: FrigateLXC
memory: 4096
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=2E:76:AE:5A:58:48,ip=dhcp,ip6=auto,type=veth
ostype: debian
rootfs: local-lvm:vm-115-disk-0,size=12G
swap: 512
lxc.cgroup.devices.allow: c 189:385 rwm
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
lxc.mount.entry: /dev/bus/usb/004/002 dev/bus/usb/004/002 none bind,optional,create=file
lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: a
lxc.cap.drop:

ESX#

For details on running Frigate under ESX, see details here.

- + diff --git a/mdx/index.html b/mdx/index.html index cc6758846..3bf83eaf6 100644 --- a/mdx/index.html +++ b/mdx/index.html @@ -8,7 +8,7 @@ Powered by MDX | Frigate - + @@ -22,7 +22,7 @@

Powered by MDX

You can write JSX and use React components within your Markdown thanks to MDX.

Docusaurus green and Facebook blue are my favorite colors.

I can write Markdown alongside my JSX!

- + diff --git a/runtime~main.a90fd004.js b/runtime~main.e26db1e5.js similarity index 98% rename from runtime~main.a90fd004.js rename to runtime~main.e26db1e5.js index 35225f694..1dea7eb56 100644 --- a/runtime~main.a90fd004.js +++ b/runtime~main.e26db1e5.js @@ -1 +1 @@ -!function(e){function r(r){for(var n,o,c=r[0],d=r[1],u=r[2],i=0,b=[];i Search the documentation | Frigate - + @@ -18,7 +18,7 @@

Search the documentation

- + diff --git a/troubleshooting/index.html b/troubleshooting/index.html index 455a5109f..0ace15a75 100644 --- a/troubleshooting/index.html +++ b/troubleshooting/index.html @@ -8,7 +8,7 @@ Troubleshooting and FAQ | Frigate - + @@ -22,7 +22,7 @@

Troubleshooting and FAQ

How can I get sound or audio in my clips and recordings?#

By default, Frigate removes audio from clips and recordings to reduce the likelihood of failing for invalid data. If you would like to include audio, you need to override the output args to remove -an for where you want to include audio. The recommended audio codec is aac. Not all audio codecs are supported by RTMP, so you may need to re-encode your audio with -c:a aac. The default ffmpeg args are shown here.

My mjpeg stream or snapshots look green and crazy#

This almost always means that the width/height defined for your camera are not correct. Double check the resolution with vlc or another player. Also make sure you don't have the width and height values backwards.

mismatched-resolution

I have clips and snapshots in my clips folder, but I can't view them in the Web UI.#

This is usually caused one of two things:

  • The permissions on the parent folder don't have execute and nginx returns a 403 error you can see in the browser logs
    • In this case, try mounting a volume to /media/frigate inside the container instead of /media/frigate/clips.
  • Your cameras do not send h264 encoded video and the mp4 files are not playable in the browser

"[mov,mp4,m4a,3gp,3g2,mj2 @ 0x5639eeb6e140] moov atom not found"#

These messages in the logs are expected in certain situations. Frigate checks the integrity of the video cache before assembling clips. Occasionally these cached files will be invalid and cleaned up automatically.

"On connect called"#

If you see repeated "On connect called" messages in your config, check for another instance of frigate. This happens when multiple frigate containers are trying to connect to mqtt with the same client_id.

- + diff --git a/usage/api/index.html b/usage/api/index.html index 3e8336c61..c17728f34 100644 --- a/usage/api/index.html +++ b/usage/api/index.html @@ -8,7 +8,7 @@ HTTP API | Frigate - + @@ -22,7 +22,7 @@

HTTP API

A web server is available on port 5000 with the following endpoints.

/api/<camera_name>#

An mjpeg stream for debugging. Keep in mind the mjpeg endpoint is for debugging only and will put additional load on the system when in use.

Accepts the following query string parameters:

paramTypeDescription
fpsintFrame rate
hintHeight in pixels
bboxintShow bounding boxes for detected objects (0 or 1)
timestampintPrint the timestamp in the upper left (0 or 1)
zonesintDraw the zones on the image (0 or 1)
maskintOverlay the mask on the image (0 or 1)
motionintDraw blue boxes for areas with detected motion (0 or 1)
regionsintDraw green boxes for areas where object detection was run (0 or 1)

You can access a higher resolution mjpeg stream by appending h=height-in-pixels to the endpoint. For example http://localhost:5000/api/back?h=1080. You can also increase the FPS by appending fps=frame-rate to the URL such as http://localhost:5000/api/back?fps=10 or both with ?fps=10&h=1000.

/api/<camera_name>/<object_name>/best.jpg[?h=300&crop=1]#

The best snapshot for any object type. It is a full resolution image by default.

Example parameters:

  • h=300: resizes the image to 300 pixes tall
  • crop=1: crops the image to the region of the detection rather than returning the entire image

/api/<camera_name>/latest.jpg[?h=300]#

The most recent frame that frigate has finished processing. It is a full resolution image by default.

Accepts the following query string parameters:

paramTypeDescription
hintHeight in pixels
bboxintShow bounding boxes for detected objects (0 or 1)
timestampintPrint the timestamp in the upper left (0 or 1)
zonesintDraw the zones on the image (0 or 1)
maskintOverlay the mask on the image (0 or 1)
motionintDraw blue boxes for areas with detected motion (0 or 1)
regionsintDraw green boxes for areas where object detection was run (0 or 1)

Example parameters:

  • h=300: resizes the image to 300 pixes tall

/api/stats#

Contains some granular debug info that can be used for sensors in Home Assistant.

Sample response:

{
/* Per Camera Stats */
"back": {
/***************
* Frames per second being consumed from your camera. If this is higher
* than it is supposed to be, you should set -r FPS in your input_args.
* camera_fps = process_fps + skipped_fps
***************/
"camera_fps": 5.0,
/***************
* Number of times detection is run per second. This can be higher than
* your camera FPS because frigate often looks at the same frame multiple times
* or in multiple locations
***************/
"detection_fps": 1.5,
/***************
* PID for the ffmpeg process that consumes this camera
***************/
"capture_pid": 27,
/***************
* PID for the process that runs detection for this camera
***************/
"pid": 34,
/***************
* Frames per second being processed by frigate.
***************/
"process_fps": 5.1,
/***************
* Frames per second skip for processing by frigate.
***************/
"skipped_fps": 0.0
},
/***************
* Sum of detection_fps across all cameras and detectors.
* This should be the sum of all detection_fps values from cameras.
***************/
"detection_fps": 5.0,
/* Detectors Stats */
"detectors": {
"coral": {
/***************
* Timestamp when object detection started. If this value stays non-zero and constant
* for a long time, that means the detection process is stuck.
***************/
"detection_start": 0.0,
/***************
* Time spent running object detection in milliseconds.
***************/
"inference_speed": 10.48,
/***************
* PID for the shared process that runs object detection on the Coral.
***************/
"pid": 25321
}
},
"service": {
/* Uptime in seconds */
"uptime": 10,
"version": "0.8.0-8883709",
/* Storage data in MB for important locations */
"storage": {
"/media/frigate/clips": {
"total": 1000,
"used": 700,
"free": 300,
"mnt_type": "ext4"
},
"/media/frigate/recordings": {
"total": 1000,
"used": 700,
"free": 300,
"mnt_type": "ext4"
},
"/tmp/cache": {
"total": 256,
"used": 100,
"free": 156,
"mnt_type": "tmpfs"
},
"/dev/shm": {
"total": 256,
"used": 100,
"free": 156,
"mnt_type": "tmpfs"
}
}
}
}

/api/config#

A json representation of your configuration

/api/version#

Version info

/api/events#

Events from the database. Accepts the following query string parameters:

paramTypeDescription
beforeintEpoch time
afterintEpoch time
camerastrCamera name
labelstrLabel name
zonestrZone name
limitintLimit the number of events returned
has_snapshotintFilter to events that have snapshots (0 or 1)
has_clipintFilter to events that have clips (0 or 1)
include_thumbnailsintInclude thumbnails in the response (0 or 1)

/api/events/summary#

Returns summary data for events in the database. Used by the Home Assistant integration.

/api/events/<id>#

Returns data for a single event.

/api/events/<id>/thumbnail.jpg#

Returns a thumbnail for the event id optimized for notifications. Works while the event is in progress and after completion. Passing ?format=android will convert the thumbnail to 2:1 aspect ratio.

/api/events/<id>/snapshot.jpg#

Returns the snapshot image for the event id. Works while the event is in progress and after completion.

Accepts the following query string parameters, but they are only applied when an event is in progress. After the event is completed, the saved snapshot is returned from disk without modification:

paramTypeDescription
hintHeight in pixels
bboxintShow bounding boxes for detected objects (0 or 1)
timestampintPrint the timestamp in the upper left (0 or 1)
cropintCrop the snapshot to the (0 or 1)

/clips/<camera>-<id>.mp4#

Video clip for the given camera and event id.

/clips/<camera>-<id>.jpg#

JPG snapshot for the given camera and event id.

- + diff --git a/usage/home-assistant/index.html b/usage/home-assistant/index.html index 76feca026..a8e3f7148 100644 --- a/usage/home-assistant/index.html +++ b/usage/home-assistant/index.html @@ -8,7 +8,7 @@ Integration with Home Assistant | Frigate - + @@ -50,7 +50,7 @@ be specified in URLs/identifiers -- that single instance is assumed. When multiple Frigate instances are configured, the user must explicitly specify which server they are referring to.

- + diff --git a/usage/howtos/index.html b/usage/howtos/index.html index a0759d644..1f9f1d242 100644 --- a/usage/howtos/index.html +++ b/usage/howtos/index.html @@ -8,7 +8,7 @@ Community Guides | Frigate - + @@ -22,7 +22,7 @@

Community Guides

Communitiy Guides/How-To's#

  • Best Camera AI Person & Object Detection - How to Setup Frigate w/ Home Assistant - digiblurDIY YouTube - Article
  • Even More Free Local Object Detection with Home Assistant - Frigate Install - Everything Smart Home YouTube
  • Home Assistant Frigate integration for local image recognition - KPeyanski YouTube - Article
- + diff --git a/usage/mqtt/index.html b/usage/mqtt/index.html index 2536a0622..3c152bc64 100644 --- a/usage/mqtt/index.html +++ b/usage/mqtt/index.html @@ -8,7 +8,7 @@ MQTT | Frigate - + @@ -25,7 +25,7 @@ "offline": published right before frigate stops

frigate/<camera_name>/<object_name>#

Publishes the count of objects for the camera for use as a sensor in Home Assistant.

frigate/<zone_name>/<object_name>#

Publishes the count of objects for the zone for use as a sensor in Home Assistant.

frigate/<camera_name>/<object_name>/snapshot#

Publishes a jpeg encoded frame of the detected object type. When the object is no longer detected, the highest confidence image is published or the original image is published again.

The height and crop of snapshots can be configured in the config.

frigate/events#

Message published for each changed event. The first message is published when the tracked object is no longer marked as a false_positive. When frigate finds a better snapshot of the tracked object or when a zone change occurs, it will publish a message with the same id. When the event ends, a final message is published with end_time set.

{
"type": "update", // new, update, or end
"before": {
"id": "1607123955.475377-mxklsc",
"camera": "front_door",
"frame_time": 1607123961.837752,
"label": "person",
"top_score": 0.958984375,
"false_positive": false,
"start_time": 1607123955.475377,
"end_time": null,
"score": 0.7890625,
"box": [424, 500, 536, 712],
"area": 23744,
"region": [264, 450, 667, 853],
"current_zones": ["driveway"],
"entered_zones": ["yard", "driveway"],
"thumbnail": null
},
"after": {
"id": "1607123955.475377-mxklsc",
"camera": "front_door",
"frame_time": 1607123962.082975,
"label": "person",
"top_score": 0.958984375,
"false_positive": false,
"start_time": 1607123955.475377,
"end_time": null,
"score": 0.87890625,
"box": [432, 496, 544, 854],
"area": 40096,
"region": [218, 440, 693, 915],
"current_zones": ["yard", "driveway"],
"entered_zones": ["yard", "driveway"],
"thumbnail": null
}
}

frigate/stats#

Same data available at /api/stats published at a configurable interval.

frigate/<camera_name>/detect/set#

Topic to turn detection for a camera on and off. Expected values are ON and OFF.

frigate/<camera_name>/detect/state#

Topic with current state of detection for a camera. Published values are ON and OFF.

frigate/<camera_name>/clips/set#

Topic to turn clips for a camera on and off. Expected values are ON and OFF.

frigate/<camera_name>/clips/state#

Topic with current state of clips for a camera. Published values are ON and OFF.

frigate/<camera_name>/snapshots/set#

Topic to turn snapshots for a camera on and off. Expected values are ON and OFF.

frigate/<camera_name>/snapshots/state#

Topic with current state of snapshots for a camera. Published values are ON and OFF.

- + diff --git a/usage/web/index.html b/usage/web/index.html index 609d5e0f0..e3ac708de 100644 --- a/usage/web/index.html +++ b/usage/web/index.html @@ -8,7 +8,7 @@ Web Interface | Frigate - + @@ -22,7 +22,7 @@ - +