config.example.yml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. web_port: 5000
  2. ################
  3. ## List of detectors.
  4. ## Currently supported types: cpu, edgetpu
  5. ## EdgeTPU requires device as defined here: https://coral.ai/docs/edgetpu/multiple-edgetpu/#using-the-tensorflow-lite-python-api
  6. ################
  7. detectors:
  8. coral:
  9. type: edgetpu
  10. device: usb
  11. mqtt:
  12. host: mqtt.server.com
  13. topic_prefix: frigate
  14. # client_id: frigate # Optional -- set to override default client id of 'frigate' if running multiple instances
  15. # user: username # Optional
  16. #################
  17. ## Environment variables that begin with 'FRIGATE_' may be referenced in {}.
  18. ## password: '{FRIGATE_MQTT_PASSWORD}'
  19. #################
  20. # password: password # Optional
  21. ################
  22. # Global configuration for saving clips
  23. ################
  24. save_clips:
  25. ###########
  26. # Maximum length of time to retain video during long events.
  27. # If an object is being tracked for longer than this amount of time, the cache
  28. # will begin to expire and the resulting clip will be the last x seconds of the event.
  29. ###########
  30. max_seconds: 300
  31. clips_dir: /clips
  32. cache_dir: /cache
  33. #################
  34. # Default ffmpeg args. Optional and can be overwritten per camera.
  35. # Should work with most RTSP cameras that send h264 video
  36. # Built from the properties below with:
  37. # "ffmpeg" + global_args + input_args + "-i" + input + output_args
  38. #################
  39. # ffmpeg:
  40. # global_args:
  41. # - -hide_banner
  42. # - -loglevel
  43. # - panic
  44. # hwaccel_args: []
  45. # input_args:
  46. # - -avoid_negative_ts
  47. # - make_zero
  48. # - -fflags
  49. # - nobuffer
  50. # - -flags
  51. # - low_delay
  52. # - -strict
  53. # - experimental
  54. # - -fflags
  55. # - +genpts+discardcorrupt
  56. # - -vsync
  57. # - drop
  58. # - -rtsp_transport
  59. # - tcp
  60. # - -stimeout
  61. # - '5000000'
  62. # - -use_wallclock_as_timestamps
  63. # - '1'
  64. # output_args:
  65. # - -f
  66. # - rawvideo
  67. # - -pix_fmt
  68. # - yuv420p
  69. ####################
  70. # Global object configuration. Applies to all cameras
  71. # unless overridden at the camera levels.
  72. # Keys must be valid labels. By default, the model uses coco (https://dl.google.com/coral/canned_models/coco_labels.txt).
  73. # All labels from the model are reported over MQTT. These values are used to filter out false positives.
  74. # min_area (optional): minimum width*height of the bounding box for the detected object
  75. # max_area (optional): maximum width*height of the bounding box for the detected object
  76. # min_score (optional): minimum score for the object to initiate tracking
  77. # threshold (optional): The minimum decimal percentage for tracked object's computed score to considered a true positive
  78. ####################
  79. objects:
  80. track:
  81. - person
  82. filters:
  83. person:
  84. min_area: 5000
  85. max_area: 100000
  86. min_score: 0.5
  87. threshold: 0.85
  88. cameras:
  89. back:
  90. ffmpeg:
  91. ################
  92. # Source passed to ffmpeg after the -i parameter. Supports anything compatible with OpenCV and FFmpeg.
  93. # Environment variables that begin with 'FRIGATE_' may be referenced in {}
  94. ################
  95. input: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2
  96. #################
  97. # These values will override default values for just this camera
  98. #################
  99. # global_args: []
  100. # hwaccel_args: []
  101. # input_args: []
  102. # output_args: []
  103. ################
  104. ## Optionally specify the resolution of the video feed. Frigate will try to auto detect if not specified
  105. ################
  106. # height: 1280
  107. # width: 720
  108. ################
  109. ## Specify the framerate of your camera
  110. ##
  111. ## NOTE: This should only be set in the event ffmpeg is unable to determine your camera's framerate
  112. ## on its own and the reported framerate for your camera in frigate is well over what is expected.
  113. ################
  114. # fps: 5
  115. ################
  116. ## Optional mask. Must be the same aspect ratio as your video feed. Value is any of the following:
  117. ## - name of a file in the config directory
  118. ## - base64 encoded image prefixed with 'base64,' eg. 'base64,asfasdfasdf....'
  119. ## - polygon of x,y coordinates prefixed with 'poly,' eg. 'poly,0,900,1080,900,1080,1920,0,1920'
  120. ##
  121. ## The mask works by looking at the bottom center of the bounding box for the detected
  122. ## person in the image. If that pixel in the mask is a black pixel, it ignores it as a
  123. ## false positive. In my mask, the grass and driveway visible from my backdoor camera
  124. ## are white. The garage doors, sky, and trees (anywhere it would be impossible for a
  125. ## person to stand) are black.
  126. ##
  127. ## Masked areas are also ignored for motion detection.
  128. ################
  129. # mask: back-mask.bmp
  130. ################
  131. # Allows you to limit the framerate within frigate for cameras that do not support
  132. # custom framerates. A value of 1 tells frigate to look at every frame, 2 every 2nd frame,
  133. # 3 every 3rd frame, etc.
  134. ################
  135. take_frame: 1
  136. ################
  137. # The number of seconds to retain the highest scoring image for the best.jpg endpoint before allowing it
  138. # to be replaced by a newer image. Defaults to 60 seconds.
  139. ################
  140. best_image_timeout: 60
  141. ################
  142. # MQTT settings
  143. ################
  144. # mqtt:
  145. # crop_to_region: True
  146. # snapshot_height: 300
  147. ################
  148. # Zones
  149. ################
  150. zones:
  151. #################
  152. # Name of the zone
  153. ################
  154. front_steps:
  155. ####################
  156. # A list of x,y coordinates to define the polygon of the zone. The top
  157. # left corner is 0,0. Can also be a comma separated string of all x,y coordinates combined.
  158. # The same zone name can exist across multiple cameras if they have overlapping FOVs.
  159. # An object is determined to be in the zone based on whether or not the bottom center
  160. # of it's bounding box is within the polygon. The polygon must have at least 3 points.
  161. # Coordinates can be generated at https://www.image-map.net/
  162. ####################
  163. coordinates:
  164. - 545,1077
  165. - 747,939
  166. - 788,805
  167. ################
  168. # Zone level object filters. These are applied in addition to the global and camera filters
  169. # and should be more restrictive than the global and camera filters. The global and camera
  170. # filters are applied upstream.
  171. ################
  172. filters:
  173. person:
  174. min_area: 5000
  175. max_area: 100000
  176. threshold: 0.8
  177. ################
  178. # This will save a clip for each tracked object by frigate along with a json file that contains
  179. # data related to the tracked object. This works by telling ffmpeg to write video segments to /cache
  180. # from the video stream without re-encoding. Clips are then created by using ffmpeg to merge segments
  181. # without re-encoding. The segments saved are unaltered from what frigate receives to avoid re-encoding.
  182. # They do not contain bounding boxes. These are optimized to capture "false_positive" examples for improving frigate.
  183. #
  184. # NOTE: This feature does not work if you have "-vsync drop" configured in your input params.
  185. # This will only work for camera feeds that can be copied into the mp4 container format without
  186. # encoding such as h264. It may not work for some types of streams.
  187. ################
  188. save_clips:
  189. enabled: False
  190. #########
  191. # Number of seconds before the event to include in the clips
  192. #########
  193. pre_capture: 30
  194. #########
  195. # Objects to save clips for. Defaults to all tracked object types.
  196. #########
  197. # objects:
  198. # - person
  199. ################
  200. # Configuration for the snapshots in the debug view and mqtt
  201. ################
  202. snapshots:
  203. show_timestamp: True
  204. draw_zones: False
  205. draw_bounding_boxes: True
  206. ################
  207. # Camera level object config. If defined, this is used instead of the global config.
  208. ################
  209. objects:
  210. track:
  211. - person
  212. - car
  213. filters:
  214. person:
  215. min_area: 5000
  216. max_area: 100000
  217. min_score: 0.5
  218. threshold: 0.85