Compare commits

...

678 Commits

Author SHA1 Message Date
Blake Blackshear
b97e274b6a master sync v2 2024-05-25 11:58:11 -05:00
Blake Blackshear
e6b735231d master sync 2024-05-25 11:52:24 -05:00
Josh Hawkins
058e9a3ba0 calculate aspect ratio of container to prevent overflow (#11495) 2024-05-23 07:30:16 -06:00
Nicolas Mowen
4d05bc25f4 Safely load config file for go2rtc (#11491)
* Safely load config file for go2rtc

* Add log for default config

* Cleanup
2024-05-22 18:10:55 -05:00
Nicolas Mowen
527d2ab27b Fix extra space in command (#11487) 2024-05-22 13:25:58 -05:00
Nicolas Mowen
01e387ee9a Adjust date math (#11485) 2024-05-22 10:06:40 -06:00
Nicolas Mowen
db496ec525 Fix current hour check for uneven timezones (#11484) 2024-05-22 09:27:00 -06:00
Josh Hawkins
9652ea9e96 Update beta docs (#11483)
* update beta docs

* fix relative coordinates

* fix relative coordinates

* changes
2024-05-22 08:51:59 -06:00
Nicolas Mowen
c935eb0c79 Update Deps (#11480)
* Update web deps

* Update python deps

* revert matplotlib
2024-05-22 08:41:43 -06:00
Nicolas Mowen
c49be0a47f UI tweaks / fixes (#11479)
* Update coloring of logs button

* Fix paging after submitting

* Fix sorting

* Add icon
2024-05-22 07:14:48 -06:00
Rémi Bédard-Couture
592b645231 Add support for TensorRT v10 (multiple api calls have changed) (#11166)
* Add support for TensorRT v10 (multiple api calls have changed)

* Remove unnecessary size check in TensorRT v10 block

* Refactor to reduce code duplication

* Fix wrong function name in new _get_binding_dtype function and only return input check (not assertion) in new _binding_is_input function

* Add space around TRT_VERSION variable assignment (=) to respect linting

* More linting fix

* Update frigate/detectors/plugins/tensorrt.py

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* More linting

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-05-22 06:57:52 -06:00
Marc Altmann
e91f3d8d9b Reimplement support for rknn detector (#11365)
* initial support for rknn detector

* remove purge_model_cache option

* update rknn

* support rk3576

* fix post_process_yolonas call

* add yolonas models

* update config

* exclude yolonas from image

* remove code
2024-05-21 17:50:03 -05:00
Josh Hawkins
910c85b1c0 Clean up config editor (#11474)
* clean up config editor

* remove unneeded size
2024-05-21 13:06:17 -05:00
Nicolas Mowen
cc3bbcc303 Improve preview loading (#11469)
* Improve preview loading

* Ensure it works when selecting dates
2024-05-21 08:00:29 -05:00
Nicolas Mowen
2a86969f54 UI Tweaks (#11459)
* refresh dashboard activity on visibility change

* Make video controls more consistent

* Use const
2024-05-20 18:26:17 -05:00
Nicolas Mowen
dda65ba514 Update review APIs (#11457) 2024-05-20 16:04:18 -05:00
Nicolas Mowen
e268da9df7 Update motion detection tuning to reflect UI tuner (#11455) 2024-05-20 13:35:49 -05:00
Josh Hawkins
e543cc642c add clarifying message and docs link around motion masks (#11452) 2024-05-20 23:18:01 +05:30
Nicolas Mowen
8897b4b0e0 Remove parked car guide as it is no longer relevant (#11451)
* Remove parked cars guide

* Update sidebar

* Update stationary_objects.md
2024-05-20 22:56:03 +05:30
Nicolas Mowen
7413810fa4 Don't timeshift recordings (#11449) 2024-05-20 20:14:39 +05:30
Lachlan MacPhee
87d3ee09b0 Minimal config in installation guide (#11339)
* Minimal config in installation guide (#11339)

+ Adds a subsection to the installation guide that mentions the requirement for a minimal config to start Frigate successfully.

+ Adds a warning not to proceed any further into the guide without this valid config

* Add spacing between Markdown title and text

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* Remove subsection in favour of exclusively adding a warning

* Adjust wording for the warning

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-05-20 07:55:25 -06:00
Meow
6e39d55dd3 cspell fixes (#11447) 2024-05-20 07:37:56 -06:00
Josh Hawkins
84e823c62f add padding to bottom of drawer for iOS PWA only (#11446) 2024-05-20 08:06:11 -05:00
Nicolas Mowen
2a16d5593a Fix timezone conversion logic (#11444)
* Fix timezone conversion logic

* Use function for consistency

* Cleanup
2024-05-20 07:02:19 -06:00
Josh Hawkins
82d4bf8ab5 Log warning for high detect fps (#11435)
* warn in log if detect fps > 10

* change message
2024-05-19 21:36:41 -06:00
Nicolas Mowen
4c87ef56c7 Support timezones (#11434)
* Handle offset timezones

* Fix previews loading

* Cleanup

* remove unused
2024-05-19 17:08:32 -06:00
Josh Hawkins
bca01cb43c guard clause for api error (#11436) 2024-05-19 17:08:05 -06:00
Nicolas Mowen
c1560308bf UI improvements (#11429)
* Respect classname when no preview is found

* Don't check for go2rtc info if camera is not restramed

* Show error banner when playback fails

* Add keyboard shortcut for fullscreen
2024-05-19 07:39:17 -05:00
Josh Hawkins
171a142adb optional env var for easier development (#11426) 2024-05-18 18:49:38 -06:00
Nicolas Mowen
0810873988 Fix broken links (#11425) 2024-05-18 18:09:55 -05:00
Nicolas Mowen
16f1c575d7 UI Fixes (#11423)
* Settings fixes

* Fix formatting
2024-05-18 14:19:32 -06:00
Blake Blackshear
402f5fa142 add setting for secure flag on cookie (#11422)
* add setting for secure flag on cookie

* docs fix
2024-05-18 13:53:49 -06:00
Nicolas Mowen
3ce8816b9a Update auth settings UI (#11421) 2024-05-18 14:05:28 -05:00
Josh Hawkins
5c609c7051 Bugfixes (#11420)
* mse and misc messages fixes

* clean up
2024-05-18 12:55:17 -06:00
Nicolas Mowen
8cddfc27fb UI fixes (#11417)
* Set max width on the problems area in status bar and use unique keys so they do not duplicate

* Fix possibly missing media info

* Show full row of items on tablet

* remove debugging logic
2024-05-18 11:54:46 -05:00
Blake Blackshear
1133202cbd Auth! (#11347)
* reload the window on 401

* backend apis for auth

* add login page

* re-enable web linter

* fix login page routing

* bypass csrf for internal auth endpoint

* disable healthcheck in devcontainer target

* include login page in vite build

* redirect to login page on 401

* implement config for users and settings

* implement JWT actual secret

* add brute force protection on login

* add support for redirecting from auth failures on api calls

* return location for redirect

* default cookie name should pass regex test

* set hash iterations to current OWASP recommendation

* move users to database instead of config

* config option to reset admin password on startup

* user management UI

* check for deleted user on refresh

* validate username and fixes

* remove password constraint

* cleanup

* fix user check on refresh

* web fixes

* implement auth via new external port

* use x-forwarded-for to rate limit login attempts by ip

* implement logout and profile

* fixes

* lint fixes

* add support for user passthru from upstream proxies

* add support for specifying a logout url

* add documentation

* Update docs/docs/configuration/authentication.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* Update docs/docs/configuration/authentication.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-05-18 10:36:13 -06:00
Marc Altmann
a70dd02788 Implement common post_processing (#11408)
* implement common post_processing

* fix formatting

* rename yolonas to post_process_yolonas
2024-05-17 10:50:45 -06:00
Nicolas Mowen
97f5ba0145 Update go2rtc and implement stream probe to only show 2 way talk when supported (#11407)
* Support two way talk validation

* Fix handling

* Use go2rtc stream info to infer audio output

* Update go2rtc

* Update bundle policy

* Formatting
2024-05-17 07:30:22 -06:00
Nicolas Mowen
07eef9b139 Recording fixes (#11406)
* Fix infinite review items when record is disabled

* Fix showing loading icon while continuing to scrub

* Fix recording layout previews
2024-05-17 07:26:42 -06:00
Josh Hawkins
ba03d3b3e4 Mobile/PWA spacing fixes (#11403)
* spacing on mobile landscape

* better icon placement when running as pwa

* better icon placement when running as pwa

* portrait padding only
2024-05-16 16:00:14 -06:00
Nicolas Mowen
76f822630d Fix preview saving for ffmpeg builds < 5 (#11400)
* Fix ffmpeg for rpi

* Fix character
2024-05-16 16:55:55 -05:00
Josh Hawkins
dd0dee620a spacing on mobile landscape (#11397) 2024-05-16 10:51:57 -06:00
Josh Hawkins
525de1a467 Add autotracking enable/disable button to live view (#11396) 2024-05-16 08:32:39 -06:00
Josh Hawkins
16ead917ea Preview bugfixes (#11384)
* memoize initial time range and check for window visibility

* assume window is visible with previewthumbnailplayer
2024-05-15 09:51:58 -06:00
Johann
46f68ccd73 Update to frigate+ documentation (#11371)
* Update to frigate+ documentation

Added shortcuts + advices for objects partly out of frame and the 'difficult' tag.

* Update docs/docs/plus/improving_model.md

* Update docs/docs/plus/improving_model.md

---------

Co-authored-by: Blake Blackshear <blake.blackshear@gmail.com>
2024-05-15 06:08:14 -05:00
Josh Hawkins
1757f4cb04 Use prettier-plugin-tailwindcss (#11373)
* use prettier-plugin-tailwindcss to keep class names organized

* use prettierrc file to ensure formatting on save works with vscode

* classname reorder with prettier-plugin-tailwindcss
2024-05-14 09:06:44 -06:00
Nicolas Mowen
b10ae68c1f Tweaks and fixes (#11372)
* Ensure camera activity is up to date

* Persist playback rate between cameras

* Add setting for default playback rate

* Fix audio events saving image

* Formatting

* Use select component
2024-05-14 08:38:03 -05:00
Nicolas Mowen
b451d0a4f1 Improve mask error (#11361)
* Don't apply masks / zones that are outside of the detect resolution

* formatting
2024-05-13 10:00:34 -05:00
Marc Altmann
67bff1e79e update FFmpeg for Rockchip (#11351) 2024-05-13 06:52:11 -06:00
Josh Hawkins
fbec08354c bugfixes and small UI tweaks (#11360) 2024-05-13 06:42:11 -06:00
Nicolas Mowen
9680f2a574 Bug fixes (#11332)
* Fix external events saving

* Only show relevant labels

* Set on recordings view too

* Fix video control width on motion page

* use overlay so player state is maintained between camera switches

* use overlay so player state is maintained between camera switches

* mobile only

* Formatting

* Use higher amount

* Only wrap when needed
2024-05-10 11:42:56 -06:00
Josh Hawkins
82e443a5c3 Camera group layout fixes (#11334)
* camera group layout changes and tweaks

* lock aspect ratio

* no compacting

* prevent collisions

* revert

* readd limit aspect
2024-05-10 11:54:37 -05:00
Josh Hawkins
386ffbf5a6 Tweak camera group layout editor buttons (#11317)
* tweak layout editor buttons

* remove bubble

* spacing

* button backgrounds
2024-05-09 15:08:22 -06:00
Nicolas Mowen
8b344cea81 Implement recordings fullscreen and rework recordings layout size calculation (#11318)
* Implement fullscreen button

* wrap items on mobile

* control based on width

* refresh

* Implement basic fullscreen

* Fix scrolling

* Add observer to detect of row overflows

* Use cn to simplify classnames

* dynamically respond to layout sizing

* Simplify listener

* Simplify layout

* Handle tall browser
2024-05-09 15:06:29 -06:00
Josh Hawkins
021ffb2437 fix nan check in system graphs (#11312) 2024-05-09 07:55:19 -06:00
Josh Hawkins
f8523d9ddf Icon picker component (#11310)
* icon picker component

* keep box the same size when filtering icons
2024-05-09 07:22:48 -06:00
Marc Altmann
50ee447e52 Fix aarch64 build (#11289)
* fix aarch64 build

* change order of packages
2024-05-09 07:22:34 -06:00
Nicolas Mowen
4216d08099 Backend and webui fixes (#11309)
* Ensure that items without end times are set to not have a snapshot

* Save full frame if no frame is currently saved

* Webui fixes

* Cleanup
2024-05-09 08:20:33 -05:00
Nicolas Mowen
4bcbf7435a Web Deps (#11304)
* Update easy web deps

* Update react

* Update final
2024-05-09 08:20:07 -05:00
Nicolas Mowen
e1cbefb692 Add link to system stats from status bar (#11303) 2024-05-09 08:19:41 -05:00
Josh Hawkins
2be15b6c01 Improve config validation error messages (#11292) 2024-05-08 08:46:31 -06:00
Nicolas Mowen
3ed89ec042 Simplify preview refreshing with custom hook (#11293) 2024-05-08 08:46:10 -06:00
Josh Hawkins
db8c820677 Draggable camera grid tweaks (#11291)
* better math and other tweaks

* change icon
2024-05-08 07:53:22 -05:00
Nicolas Mowen
e7ba556919 Fix setting manual event update time (#11290) 2024-05-08 07:34:22 -05:00
Josh Hawkins
ff2948a76b Drag to reorder/resize cameras in camera groups (#11279)
* draggable/resizable cameras in camera groups on desktop/tablets

* fix edit button location on tablets

* assume 1rem is 16px
2024-05-07 08:28:10 -06:00
Josh Hawkins
08e5c791c8 Use cn() for class names throughout (#11278)
* add scrollbar on ptz presets dropdown

* use cn function for class names throughout

* Revert "add scrollbar on ptz presets dropdown"

This reverts commit 2cee93dc3e.
2024-05-07 08:00:25 -06:00
Josh Hawkins
a0da5018bf add scrollbar on ptz presets dropdown (#11276) 2024-05-07 06:27:20 -06:00
Nicolas Mowen
fc0f6d6095 Implement infinite scrolling for frigate+ view (#11273)
* Implement infinite scrolling for frigate+ view

* Also fixes safari preview glitch

* Show sub label name in hover
2024-05-06 18:00:21 -05:00
Nicolas Mowen
e5e18a5026 UI Tweaks (#11263)
* Add icons for frigate+ items

* Fix bug where export didn't start

* Fix mobile overflow

* Capitalize first letter function
2024-05-06 15:18:13 -06:00
Josh Hawkins
c0073db859 fix touch events (#11265) 2024-05-06 12:35:18 -06:00
Josh Hawkins
306c11d730 use portal on all sidebar tooltips (#11267) 2024-05-06 11:18:28 -06:00
Josh Hawkins
ca8ef70096 Support desktop touchscreens for timelines (#11241)
* support desktop touchscreens

* remove placeholder select

* add max height to settings cameras dropdown
2024-05-04 21:00:33 -06:00
Josh Hawkins
ad87f5786e Misc UI fixes (#11237)
* add close button to all toasters

* check if persistent options are loaded

* add id to prevent message duplication in bottom bar
2024-05-04 14:54:50 -05:00
Nicolas Mowen
2dd5b893a0 Cleanup config validation (#11235)
* Fix reading model config dict

* Fix irrelevant warnings

* Fix tests
2024-05-04 10:15:03 -05:00
Josh Hawkins
51dcdd6f4b Zone/mask editor improvements (#11236)
* add points to completed polygons in zone/mask editor

* change line order so edges are more easily clickable
2024-05-04 08:37:35 -06:00
Nicolas Mowen
f0054ceba4 Adjust stationary reqs depending on state (#11226) 2024-05-03 17:28:06 -05:00
Nicolas Mowen
216e44bc34 Event cleanup (#11225)
* remove duplicate event purging

* Slightly increase stationary object sensitivity

* Add toast for export starting

* Increase stationary threshold as well

* Update message

* Make text consistent

* Update message
2024-05-03 08:03:41 -06:00
Nicolas Mowen
e7950abec3 Add ability to submit frames from recordings (#11212)
* add ability to parse and upload image from recording to frigate+

* Show dialog with current frame to be uploaded

* Implement uploading image in frontend

* Cleanup

* Update title
2024-05-03 09:00:19 -05:00
Josh Hawkins
b69c1828cb Fix overflowing portrait images in debug and motion tuner views (#11209)
* fix overflowing camera image and remove mse console debug

* move calc into onLoad

* check container aspect
2024-05-02 14:05:20 -06:00
Josh Hawkins
7a5df6045a make circle radius larger on mobile only (#11210) 2024-05-02 13:06:32 -06:00
Nicolas Mowen
a3267f7d44 Add more icons (#11204) 2024-05-02 07:52:44 -05:00
Nicolas Mowen
28dd871d44 Show motion playback on page initially (#11196)
* motion video controls handle current time better

* Make sure state is updated
2024-05-01 21:23:03 -05:00
Nicolas Mowen
2e63941598 Fix scroll back (#11192) 2024-05-01 09:24:19 -05:00
Nicolas Mowen
b5b819c866 Add severity filter (#11190)
* Allow viewing all types on single screen

* Implement for mobile as well

* fix import

* Show all is optional
2024-05-01 09:11:16 -05:00
Josh Hawkins
499f70cfd3 config validation fixes (#11191) 2024-05-01 08:08:10 -06:00
Josh Hawkins
6d2457ebad Revamp object debug view (#11186)
* revamp object debug view

* fix vite

* remove console log

* don't display empty fields

* clarify masks as motion masks

* add descriptions

* color and spacing

* add sub_label to camera activity

* add sub_label to type

* rename to debug
2024-05-01 08:07:56 -06:00
Josh Hawkins
bb335638a4 use alert/detection colors as background for motion segments (#11182) 2024-04-30 18:38:22 -06:00
Nicolas Mowen
297444375c UI Fixes (#11179)
* Better scaling for frigate+ dialog and thumbnails

* Always show live objects chip

* Handle sub labels

* Send sub label correctly

* Formatting

* Undo vite

* Update web/src/utils/iconUtil.tsx
2024-04-30 19:35:23 -05:00
Nicolas Mowen
90bdb07463 Simplify on connect (#11176) 2024-04-30 07:27:39 -06:00
Nicolas Mowen
461442b399 Save initial camera state to update when websocket connects (#11174)
* Send camera state to dispatcher

* Fix logic

* Cleanup

* Send camera activitiy in on connect

* Support reading initial camera state

* Fix key

* Formatting

* Sorting
2024-04-30 07:09:50 -06:00
Josh Hawkins
0080c28c4d fix crash for when group includes birdseye (#11175) 2024-04-30 06:59:45 -06:00
Josh Hawkins
11ff7cb2b7 Use full resolution aspect ratio when available (#11173)
* base recordings and live views off of actual video resolution

* don't set for jsmpeg

* reset when changing main cam

* rename

* Only use resolution for main camera

* fix lint

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-04-30 06:52:56 -06:00
Nicolas Mowen
1c9626ecff UI fixes (#11161)
* Don't save animated webp

* Fix bad export state

* Contain scroll for camera group

* Use dvh
2024-04-29 15:23:24 -06:00
Josh Hawkins
7745313cdc add chips for active objects on live dashboard (#11162) 2024-04-29 15:23:14 -06:00
Nicolas Mowen
f946cf55be Use pre buffer for other links (#11160) 2024-04-29 14:20:50 -05:00
Nicolas Mowen
c9246bd4ab Open to recordings with pre-buffer (#11143)
* Open to recordings with pre-buffer

* Reduce buffer

* Use variable for preview FPS
2024-04-29 11:12:57 -05:00
Nicolas Mowen
9117043adc UI tweaks for screen sizes (#11155)
* Make bottom bar items easier to tap

* Set max height on list of cameras and labels

* remove incorrect character

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2024-04-29 10:59:27 -05:00
Nicolas Mowen
0c8e155afa Fix handling mixed masks (#11157) 2024-04-29 10:58:53 -05:00
Sean Kelly
5bc9f9a388 [stats] Fix tooltip showing as undefined for first tick (#11150)
* Fix tooltip showing as undefined for first tick

* Rearrange to simplify diff

* Remove offset for mobile
2024-04-29 08:52:32 -06:00
Nicolas Mowen
5858eee1fe Explicitly set pandas dtype to reduce memory usage and fix warning (#11145)
* Explicitly set dtype to reduce memory usage and fix warning

* remove extra line
2024-04-29 06:23:08 -05:00
Sean Kelly
90468c8bf5 Force X axis labels to be rotated correctly (#11148)
* Adjust number of ticks to have consistent X axes

* Revert "Adjust number of ticks to have consistent X axes"

This reverts commit 941e296750.

* set rotate instead
2024-04-28 22:55:43 -06:00
Sean Kelly
1c90f62ea5 Fix rounding (#11147) 2024-04-28 22:00:57 -06:00
Nicolas Mowen
acf37f9920 Link to relevant page from status bar warnings / errors (#11140)
* Use hash state for system pages

* Add links to items

* Add stats to other types

* Link on mobile as well

* Use link

* Cleanup using util
2024-04-28 16:59:03 -06:00
leccelecce
c2c6113299 Live view not loading for MSE/JSMpeg if overriding live stream (#11141) 2024-04-28 16:28:19 -06:00
Nicolas Mowen
8c610bea49 Remove dev env var requirement and update docs for latest config (#10483)
* Update docs for alerts and event review

* Add docs for camera groups

* Update reference config with new config values

* Remove env variable requirement

* Add to sidebar

* Update snapshot docs

* add zones example to detection docs too

* Generalize the zone docs
2024-04-28 09:35:50 -05:00
Josh Hawkins
3348af1e6d add page titles for settings views (#11132) 2024-04-27 11:02:01 -06:00
Nicolas Mowen
cc851555e4 Security improvement: ensure user provided file names don't exceed max length (#11129)
* Security fixes

* formatting
2024-04-27 11:27:23 -05:00
Nicolas Mowen
f36e86feb6 Cleanup error gpu (#11130) 2024-04-27 11:26:51 -05:00
Josh Hawkins
ab032aa004 sane colors for themes (#11126) 2024-04-26 14:30:57 -06:00
Josh Hawkins
d0aefc2121 Camera group dialog changes and fixes (#11117)
* camera group dialog changes and fixes

* use drawer on mobile

* spacing
2024-04-25 17:19:31 -06:00
Nicolas Mowen
c035241b39 Clear ongoing reviews on startup (#11097)
* Add topic to clear ongoing review segments

* Clear ongoing review items on startup
2024-04-24 08:44:28 -05:00
Nicolas Mowen
313e7c016c fix motion updating (#11083) 2024-04-23 09:57:29 -05:00
Nicolas Mowen
647bcb2618 Add camera fps to graphs (#11080)
* Add camera fps to graphs

* Use more generic name
2024-04-23 09:32:46 -05:00
Nicolas Mowen
2d71cd7fe2 Improve review mqtt topic (#11072)
* Don't request preview for current hour and fix content type

* Send before / after on messages

* Send before / after for end

* Handle specific cases

* remove log

* Fix update type
2024-04-22 21:20:30 -05:00
Josh Hawkins
d6e93d039d Make all corners less rounded on mobile (#11068)
* make corners less rounded on mobile

* fix live dashboard classes
2024-04-22 09:12:45 -06:00
Josh Hawkins
ba3930ab02 Add status bar provider (#11066) 2024-04-22 08:20:23 -06:00
Josh Hawkins
acadfb6959 Fix array out of range error in reviews (#11059) 2024-04-21 19:03:43 -06:00
Nicolas Mowen
baf363fcb0 Make a backup DB before doing migrations (#11048) 2024-04-20 08:55:51 -05:00
Josh Hawkins
57800d3843 Use export name in export deletion dialog instead of file id (#11049)
* use export name in dialog instead of file id

* add type for deletion
2024-04-20 07:44:59 -06:00
dependabot[bot]
8092b28710 Bump docker/login-action from 3.0.0 to 3.1.0 (#10446)
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](343f7c4344...e92390c5fb)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-20 06:20:55 -06:00
Aida Syoko
3d612e510c chore: fix some typos in comments (#11028)
Signed-off-by: alongdate <alongyear@outlook.com>
2024-04-20 06:16:43 -05:00
Josh Hawkins
3ca2d599d3 fix logs scrolling on mobile (#11045) 2024-04-19 17:01:45 -06:00
Nicolas Mowen
c83c13938c Update deps (#11044)
* Update web deps

* Update docs deps

* Update python deps
2024-04-19 17:13:01 -05:00
Nicolas Mowen
bfefed4d6e Dynamically scale the slider height when hovering + other UI tweaks (#11042)
* Make no thumb slider height dynamic

* Use existing switch component

* Use existing switch component for general filter content

* Show message when no reordings found for time

* Don't show while scrubbing

* Fix key error

* Fix background color for controls on motion page
2024-04-19 17:12:03 -05:00
Nicolas Mowen
fe4fb645d3 Save exports to database (#11040)
* Save review thumbs in dedicated folder

* Create exports table

* Save exports to DB and save thumbnail for export

* Save full frame always

* Fix rounded corners

* Save exports that are in progress

* No need to remove spaces

* Reorganize apis to use IDs

* Use new apis for frontend

* Get video playback working

* Fix deleting and renaming

* Import existing exports to DB

* Implement downloading

* Formatting
2024-04-19 17:11:41 -05:00
Josh Hawkins
3b0f9988df UI tweaks (#11036)
* spacing, mobile navbar, and minor color updates

* tab scrolling behavior
2024-04-19 12:17:23 -05:00
Josh Hawkins
d6dfa596de undo points based on order added to polygon (#11035) 2024-04-19 07:59:28 -06:00
Josh Hawkins
5f15641b1b New mask/zone editor and motion tuner (#11020)
* initial working konva

* working multi polygons

* multi zones

* clean up

* new zone dialog

* clean up

* relative coordinates and colors

* fix color order

* better motion tuner

* objects for zones

* progress

* merge dev

* edit pane

* motion and object masks

* filtering

* add objects and unsaved to type

* motion tuner, edit controls, tooltips

* object and motion edit panes

* polygon item component, switch color, object form, hover cards

* working zone edit pane

* working motion masks

* object masks and deletion of all types

* use FilterSwitch

* motion tuner fixes and tweaks

* clean up

* tweaks

* spaces in camera name

* tweaks

* allow dragging of points while drawing polygon

* turn off editing mode when switching camera

* limit interpolated coordinates and use crosshair cursor

* padding

* fix tooltip trigger for icons

* konva tweaks

* consolidate

* fix top menu items on mobile
2024-04-19 05:34:07 -06:00
Nicolas Mowen
a1905f5604 Remove gifs and use existing views (#11027)
* Use existing components for preview filmstrip instead of gif

* Allow setting format
2024-04-18 22:34:57 -05:00
Nicolas Mowen
0bad001ac9 Show coral temps on system page if available (#11026) 2024-04-18 22:34:16 -05:00
Nicolas Mowen
03e25b3f94 Improve config validation for zones and object masks (#11022)
* Add verification for required zone names

* Make global object masks use relative coordinates as well

* Ensure event image cleanup doesn't fail

* Return passed value
2024-04-18 11:35:16 -05:00
Nicolas Mowen
fb721ad031 UI fixes (#11012)
* Get pip working correctly

* Fix system graphs click and hover states
2024-04-18 11:34:18 -05:00
Nicolas Mowen
8230813b79 Migrate export filenames (#11005)
* Migrate export filenames

* formatting

* Remove test.yaml saving
2024-04-17 16:26:16 -05:00
Nicolas Mowen
392ff1319d Remove use_experimental config as part of config migration (#11003)
* Remove experimental config as part of config migration

* Remove from config

* remove config from docs
2024-04-17 07:02:59 -05:00
Nicolas Mowen
a87cca23ea Add ability to link to review items directly (#11002)
* Fix action group icon colors

* Add ability to query specific review item

* Pull id search key and open recordings to review item
2024-04-17 07:02:03 -05:00
Nicolas Mowen
ff823b87c8 Add support for arbitrary sub labels in reviews (#10990)
* store arbitrary sub labels

* Include sub labels in tooltip

* Update tooltips on filmstrip

* Fix item display

* Fix bug with creating review segment
2024-04-16 15:56:28 -05:00
Nicolas Mowen
9be5951076 UI tweaks (#10998)
* Make buttons consistent and have hover state

* Use switch for camera to be consistent

* Use everywhere and remove unused

* Use green for normal stats color

* Fix logs copy icon

* Remove warnings from pydantic serialization

* Ignore warnings

* Fix wsdl resolution

* Fix loading on switch
2024-04-16 15:55:24 -05:00
Nicolas Mowen
a823a18496 Fix camera switching and loading position (#10982)
* Fix alignment

* Set loading when switching cameras
2024-04-16 15:21:52 -05:00
Nicolas Mowen
d7ae0eedf8 More UI tweaks (#10974)
* Show loading indicator when switching between preview and recording if it takes a while

* Scroll down to avoid automatic upscroll
2024-04-14 14:43:43 -06:00
Nicolas Mowen
7f424bb3f8 UI Improvements (#10972)
* Update web deps

* Fix tooltip on storage page

* Always show video controls even when zooming

* Get video controls working when video is paused

* Fix control hovering

* Add loading indicator to logs tab

* Show metrics correctly when hovering graph

* Show loading indicators for previews on recordings page

* Remove vitest update

* remove unused

* Make volume props optional
2024-04-14 10:14:10 -06:00
Nicolas Mowen
a3e2171675 Implement score filtering on Frigate+ Page (#10968)
* Fix portrait layout disappearing

* Refactor sliders

* Reuse camera filter

* Reuse label filter content

* Implement score slider including keyboard input

* Implement ability to sort frigate plus submissions
2024-04-14 10:06:11 -06:00
Martin Weinelt
b65656fa87 Make wsdl_dir path resolving more robust (#10967)
Relying on importlib to resolve the path to the wsdl directory is more
robust, since it traverses all site-packages directories, that are part
of the PYTHONPATH.
2024-04-13 12:25:58 -05:00
Nicolas Mowen
3788df5bc6 Implement config migration and restructure config for new review format (#10961)
* Update reference config to reflect new config

* Migrate 0.13 config to match 0.14 config style

* Overwrite existing config

* Adjust config schema to remove events required zones and include reviews

* Update object config to check correct required zones config

* Refactor reviews to remove motion and only create review segments in expected circumstances

* Cleanup

* Formatting

* Fix update ordering

* Update pydantic

* Remove rtmp references as part of migration

* Catch file not found for alert frame
2024-04-13 06:08:20 -06:00
Nicolas Mowen
11dc407b36 Further improve event loading (#10949)
* Further improve loading

* Add document titles to pages

* Cleanup
2024-04-12 07:31:30 -05:00
Nicolas Mowen
13cac082d5 UI tweaks (#10946)
* fix warning

* Improve event switching speed

* Fix icon colors

* Only show frigate+ page when frigate+ is enabled

* Add link from reecordings to live as well
2024-04-11 15:54:09 -05:00
Josh Hawkins
7a7ae81d50 always use full resolution time when dragging (#10939) 2024-04-11 07:29:34 -06:00
Nicolas Mowen
fb6f415b27 Fix build formatting (#10937) 2024-04-11 07:49:21 -05:00
Nicolas Mowen
049f27d710 Ongoing review segments (#10924)
* Update review maintainer to save events when ongoing

* Handle previews for in progress review items

* Reset DB items in app

* Handle in progress review items

* Scroll back down to selected event item

* Handle undefined end time

* Formatting

* remove unused

* Make export handles have full resolution

* reduce preview thumbnail props

* fix missing return

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2024-04-11 07:42:16 -05:00
Nicolas Mowen
cf7698e7e1 Fix vertical camera layout scaling (#10936) 2024-04-11 07:39:53 -05:00
Matt Brown
2d5a3c6963 Clarify Proxmox LXC instructions; reference #5773 instead of #1111 (#10759)
* Clarify Proxmox LXC instructions

There is a lot of confusing information online. This provides some
simple general guidelines to help people get started.

* Update docs/docs/frigate/installation.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* Reference #5773 instead of #1111

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-04-11 06:42:45 -05:00
Austin Kirsch
0c5aef0907 small docs typo fix for zones (#10549)
* Update zones.md

* Update zones.md round 2
2024-04-11 06:41:48 -05:00
Michal Vašíček
4a7a47a931 docker: modify listen directive in nginx.conf to listen on both IPv4&v6 (#10653) 2024-04-11 06:41:29 -05:00
Felix Zenk
5970aead0d Include leading slash of path in rewrite rule for frigate_api in nginx.conf (#10888)
Noticed the healthcheck curl requests were failing as they were routed to http://127.0.0.1:5001version instead of http://127.0.0.1:5001/version
2024-04-11 06:41:07 -05:00
Nicolas Mowen
3d43c5e811 Ui Tweaks (#10920)
* Cleanup live activity indicators for cameras

* Rename to reviews and redirect events to reviews

* Use reviews

* Remove plural

* Simplify recordings view

* Adjust icon
2024-04-10 08:40:17 -05:00
Nicolas Mowen
503dfba719 Fix button colors (#10915)
* Simplify button colors

* fix colors

* Add back in colors

* Fix color vars
2024-04-09 18:19:31 -05:00
Nicolas Mowen
524732ec73 Improve stats (#10911)
* Add overview stats for overall detection and skipped fps

* Fix intel memory stats

* Fix iOS image long pressing

* Cleanup
2024-04-09 17:08:11 -06:00
Nicolas Mowen
15e4f5c771 use relative coordinates for masks & zones (#10912)
* Handle zones and masks as relative coords

* Ensure that zone coords are saved as relative

* Get motion mask working with relative coordinates

* Rewrite object mask to use relative coordinates as well

* Formatting

* Fix always trying to convert

* fix mask logic
2024-04-09 17:51:38 -05:00
Josh Hawkins
ef52a1d6f0 Fix colors for default light mode theme (#10909)
* fix colors for default light mode theme

* remove redundancy

* fix export dialog

* don't use primary-foreground

* change secondary button variant to be default button

* change filters button to bg-selected when filtering

* slightly lighten secondary-foreground in light mode

* fix mobile motion only button
2024-04-09 17:49:14 -05:00
Nicolas Mowen
c08a198354 Always handle random lines on frigate logs (#10904) 2024-04-09 08:53:21 -05:00
Josh Hawkins
9281093740 fix export button colors (#10903) 2024-04-09 07:49:14 -06:00
Nicolas Mowen
8163c036ef Use zmq for event end queue and update python deps (#10886)
* Use zmq for events ended

* Cleanup

* Update deps

* formatting
2024-04-08 18:19:45 -05:00
Nicolas Mowen
c577361923 Fix frigate startup stats (#10887) 2024-04-08 18:19:00 -05:00
Josh Hawkins
55018372d4 Fix button color dark mode logic (#10884)
* fix button color dark mode logic

* make calendar use active color when not default
2024-04-08 11:34:15 -05:00
Josh Hawkins
f210c4b6f4 UI tweaks and bugfixes (#10882)
* small tweaks and bugfixes

* spacing

* simplify
2024-04-08 07:35:35 -06:00
Nicolas Mowen
73c093be43 Use fast start for exports (#10879) 2024-04-08 07:36:50 -05:00
Nicolas Mowen
8148a4f9d6 Update web deps (#10875) 2024-04-07 15:37:54 -05:00
Nicolas Mowen
25d81b5c6d Improve Landscape mobile views (#10873)
* Fix landscape live view

* Improve recording landscape view

* Fix height
2024-04-07 15:37:33 -05:00
Nicolas Mowen
f6ff1c84b8 Truncate write ahead log if it gets too big (#10866)
* Truncate write ahead log if it gets too big

* formatting

* Reduce size
2024-04-07 15:37:12 -05:00
Nicolas Mowen
12e6e43d6c Add y axis to camera stats graphs (#10854)
* Add y axis to camera stats graphs

* Add y axis to gneral graph too

* Improve data label distribution

* Cleanup
2024-04-07 15:36:28 -05:00
Nicolas Mowen
cf2dfd9a54 Redesign logs page (#10853)
* Adjust outline and structure to match designs

* More color changes to fit design

* Properly parse go2rtc severity

* Add ability to filter by clicking item

* Implement sheet / drawer for viewing full log

* Add toast and filtering

* Add links to docs when specific log items are selected

* Cleanup log seeking

* Use header in layout

* Fix mobile menus

* Fix safari theme

* Hide rings

* Theme adjustment
2024-04-07 15:36:08 -05:00
Nicolas Mowen
b26ceff44d Add ability to search exports (#10850)
* Add ability to search exports

* Fix export saving
2024-04-07 15:35:45 -05:00
dependabot[bot]
af320c8c09 Bump actions/setup-python from 5.0.0 to 5.1.0 (#10703)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.0.0...v5.1.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-07 06:13:26 -06:00
Josh Hawkins
5085fa7135 UI bugfixes and tweaks (#10848)
* fix ios z-index scrolling bug

* skeleton size
2024-04-05 08:44:00 -05:00
Nicolas Mowen
07ee39b9b8 Write default config if no config is saved (#10847) 2024-04-05 08:39:43 -05:00
Nicolas Mowen
2318e79502 Cleanup (#10846)
* Hide motion playback controls during scrubbing

* Fix portrait recordings on mobile

* Don't apply to desktop
2024-04-05 08:38:05 -05:00
Nicolas Mowen
fb7cfe5471 Implement camera stats graphs (#10831)
* Implement camera graphs

* Cleanup naming

* Cleanup rendering

* Cleanup spacing

* Fix audio name

* theme updates to match design corretly

* Mobile color fixes

* Mobile color fixes
2024-04-04 15:55:04 -05:00
Josh Hawkins
466a9104e5 Motion review improvements (#10833)
* render skeleton for preview player until motion data is loaded

* skeleton for timeline
2024-04-04 14:54:58 -06:00
Nicolas Mowen
42559fa55d Storage Graphs (#10826)
* Rename graph

* Use separate view for general metrics

* Get storage graph formatted

* Show camera storage usage

* Cleanup ticks

* Remove storage link

* Add icons and frigate logo

* Undo

* Use optimistic state for metrics toggle

* Use optimistic state and skeletons for loading
2024-04-04 10:24:23 -06:00
Josh Hawkins
46e3157c7f optimistic ui for mobile buttons too (#10827) 2024-04-04 09:46:19 -06:00
Nicolas Mowen
80e330594b Fix exports (#10824)
* Avoid crash from opening motion time right now

* Cleanup export margins

* Fix mobile filter

* Fix export

* Improve spacing
2024-04-04 10:43:54 -05:00
Josh Hawkins
fbc0da6016 Optimistic UI (#10825)
* debounce motion only button

* implement custom hook

* optimistic severity toggle

* optimistic reviewed switch
2024-04-04 09:09:19 -06:00
Nicolas Mowen
0096a6d778 Implement general page of system graphs (#10815)
* Reorganize stats and show graphs in system metrics

* Break apart all cpu / mem graphs

* Auto update stats

* Show camera graphs

* Get system graphs working for inference time

* Update stats every 10 seconds, keeping the last 10 minutes

* Use types for thresholds

* Use keys api

* Break system metrics into different pages

* Add dialog for viewing and copying vainfo

* remove unused for now

* Formatting

* Make tooltip match theme

* Make betters color in light mode

* Include gpu

* Make scaling consistent

* Fix name

* address feedback
2024-04-03 21:22:11 -06:00
Josh Hawkins
427c6a6afb Timeline tweaks (#10816)
* limit handles from overdragging when segments don't fill up timeline

* use separate state for switch

* add key
2024-04-03 19:20:47 -06:00
Nicolas Mowen
483d64e419 Don't show warning for disabled cameras (#10811) 2024-04-03 11:56:04 -05:00
Nicolas Mowen
59335c0628 Redesign log page and pull logs in chunks (#10809)
* Redesign log page to have formatting

* Support other log types as well

* fix border

* Support log data format

* Only load necessary logs

* Load incrementally

* Cleanup

* Cleanup

* Render all items

* avoid flashing scroll to bottom

* Fix not listening at first

* Always ensure logLine is defined

* Group logs based on timestamp

* Formatting

* remove scrollbar

* Don't repull when there are no items to pull

* Add newline to end

* Fix log lines missing

* typo
2024-04-03 11:55:13 -05:00
Nicolas Mowen
476a900708 Add ability to rename exports (#10791)
* Add ability to rename exports

* Address feedback
2024-04-03 09:02:07 -05:00
Nicolas Mowen
15dcf1fcc8 Don't stop mse in background when using pip (#10794)
* Don't stop mse when pip is enabled and not visible

* Cleanup visibility listener
2024-04-02 14:39:11 -05:00
Nicolas Mowen
759ad427d5 Link live recordings (#10799)
* Add button to link to recordings from camera live view

* Change name and show text on both

* Use history button next to back button

* Match designs better
2024-04-02 14:25:02 -05:00
Nicolas Mowen
d1082ec305 Support manual detections in review items (#10784)
* Only update frame time if it is older

* Support manual detections as review items

* Don't handle api detections in recordings

* Store recordings for manual events
2024-04-02 07:07:50 -06:00
Josh Hawkins
d7a87fff60 move span inside of content to fix crash (#10790) 2024-04-02 07:07:38 -06:00
Nicolas Mowen
4d8d3cd22e Live view improvements (#10781)
* Show frigate features in bottom sheet on mobile

* Use flex wrap on mobile so the ptz icons are not cutoff

* Support opening pip from live view

* Remove unused
2024-04-02 07:45:16 -05:00
faurel
a886b6a3e5 Support ONVIF exceptions when sending pan-tilt commands (#10777)
Co-authored-by: Aurel <me@home.com>
2024-04-01 13:19:24 -06:00
Josh Hawkins
bd70bf1c31 fix outlines (#10779) 2024-04-01 10:03:10 -06:00
Josh Hawkins
99878d9eee use single lookup for motion data (#10778) 2024-04-01 09:57:35 -06:00
Nicolas Mowen
52f65a4dc4 Use drawer instead of dropdown menu for mobile settings (#10761)
* Separate settings items so layout is more consistent

* Convert settings on mobile to drawer

* Fix sizing on mobile and make scrollable

* remove padding

* Use dialog instead of popover

* Don't focus on first item

* Simpler tab fix
2024-04-01 10:31:31 -05:00
Josh Hawkins
7fac91dce4 UI tweaks and bugfixes (#10775)
* fix wrong segments when changing filters in motion only mode

* pixel alignment, better outlines, and more figma matching

* fix stats from crashing the ui

* separate layout from aspect classes

* check for invalid value

* avoid undefined classnames
2024-04-01 08:23:57 -06:00
Nicolas Mowen
5853393396 Fix mobile playback (#10774) 2024-04-01 09:20:27 -05:00
Daniel
7e5eb82882 Delete download-models (#10755) 2024-03-30 13:23:32 -06:00
Nicolas Mowen
5b5606cb8a Make export date/time respect configured timezone in config (#10750)
* Make export page timezone aware

* Fix changeover
2024-03-30 14:07:30 -05:00
Nicolas Mowen
4d522be7fb Improve review book keeping (#10735)
* Improve review book keeping

* Cleanup

* Cleanup for new labels

* Final cleanup

* Fix sub label checking
2024-03-30 13:45:42 -05:00
Nicolas Mowen
89f843cf95 Implement alerts when a potential problem is detected (#10734)
* Implement alerts on statusbar when a potential problem is detected

* Add alert to mobile
2024-03-30 13:45:13 -05:00
Nicolas Mowen
190cdc471a Recording fixes (#10728)
* Use timerange everywhere and ensure recordings has last 24 hours

* Pause recording when selecting timeline

* Fix loading layout

* Fix updating current time not always working

* Simplify dynamic video player

* Clean up desktop sizing

* Fix current hour

* Make padding consistent

* Improve spacing for extra cameras

* Make back button consistent

* Fix preview player not jumping to correct time

* Dont use useEffect due to preview changing

* Simplify

* Fix transition
2024-03-30 13:44:12 -05:00
Josh Hawkins
7d3b481181 fix missing collapsed prop after refactor (#10751) 2024-03-30 09:51:03 -06:00
JohnEndson
37394fbe19 chore: fix some comments (#10729)
Signed-off-by: JohnEndson <jiayuzhen@outlook.com>
2024-03-30 05:51:41 -05:00
Blake Blackshear
14235c42b9 Remove all AGPL licensed YOLO references from Frigate (#10717)
* Remove yolov8 support from Frigate

* Remove yolov8 from dev

* Remove builds

* Formatting and remove yolov5

* Fix lint

* remove models download

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-03-30 05:46:17 -05:00
Blake Blackshear
b65aa640c9 Remove all AGPL licensed YOLO references from Frigate (#10716)
* Remove yolov8 support from Frigate

* Remove automatic build

* Formatting and remove yolov5

* Formatting

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-03-30 05:44:44 -05:00
Nicolas Mowen
0223d6df60 UI Tweaks (#10727)
* Fix drawer not being scrollable

* Fix margin

* Use 2 columns for large mobile devices

* Move padding

* Add review summary to mobile calendar

* Make header spacing consistent between pages

* remove red
2024-03-28 11:53:36 -06:00
Josh Hawkins
36d5e5b45f Timeline tweaks for mobile (#10726)
* add dense prop, combine duplicate code, fix mobile bug

* put segment height in hook

* playground
2024-03-28 10:03:06 -05:00
Nicolas Mowen
985b2d7b27 Cleanup event filters (#10724)
* Add specific button / switch for showing reviewed items and use intermediate drawer for mobile

* Match design for filters
2024-03-28 09:43:05 -05:00
Nicolas Mowen
35ecb342bb Fix inconsistent spacing (#10714)
* Fix inconsistent spacing

* Fix motion button alignment
2024-03-28 07:49:38 -05:00
Nicolas Mowen
f3abc590e7 Fix camera list not scrolling (#10713) 2024-03-27 18:24:41 -05:00
Nicolas Mowen
4e800e19ff Mobile recordings redesign (#10711)
* Only show back button text on desktop

* Add mobile camera drawer to separate component

* Use bottom sheet for export on mobile

* Add intermediary mobile bottom sheet

* fix filter

* Fix mobile layout jumping

* Fix desktop vertical camera view

* Fix horizontal camera list

* Add overlay instead of using same button for timeline exports

* Don't use native hls for now

* Fix export bottom sheet

* Fix scrolling

* Simplify checks

* Adjust hls compat approach

* Fix events shadow

* Make corners consistent

* Make corners consistent

* fix max drawer height

* Use separate buttons for export control

* Add icons

* Fix list views

* Fix new items to review

* bottom padding on bottom sheets

* bottom padding on bottom sheets
2024-03-27 18:03:05 -05:00
Nicolas Mowen
559e6910c4 Improve restart timing (#10709) 2024-03-27 10:03:13 -05:00
Nicolas Mowen
d5989c91a8 Make deleting review items delete recordings as well (#10707)
* Make deleting review items delete recordings as well

* Fix wrong camera bug
2024-03-27 08:22:28 -05:00
Josh Hawkins
98a1e6ee22 fix draggable element pixel alignment (#10708) 2024-03-27 07:21:38 -06:00
Nicolas Mowen
d945e77443 Quick UI fixes (#10695)
* Quick fixes

* remove log
2024-03-26 18:54:00 -06:00
Nicolas Mowen
8f69edeb33 Add ability to export from recordings page (#10692)
* Add dialog to export recordings

* Add export dialog functionality

* Add ability to name exports

* Add ability to choose custom time range on timeline

* Add ability to choose custom time range on timeline

* Add custom time selection

* Make hot keys optional for typing name of export

* Tweaks to dialog

* Tweaks to dialog

* round corners more

* Final tweaks
2024-03-26 15:37:45 -06:00
Josh Hawkins
c82ed43c13 Timeline tweaks (#10693)
* make segment height static

* fix timeline overscrolling

* better alignment of motion timeline segments
2024-03-26 15:36:28 -06:00
Nicolas Mowen
1377d33e25 Redesign Recordings View (#10690)
* Use full width top bar

* Make each item in review filter group optional

* Remove export creation from export page

* Consolidate packages and fix opening recording from event

* Use common type for time range

* Move timeline to separate component

* Add events list view to recordings view

* Fix loading of images

* Fix incorrect labels

* use overlay state for selected timeline type

* Fix up for mobile view for now

* replace overlay state

* fix comparison

* remove unused
2024-03-26 15:03:58 -06:00
Josh Hawkins
1cd374d3ad add option to only scrollintoview initially (#10689) 2024-03-26 10:29:07 -06:00
Josh Hawkins
6fbd272acf Add tooltips for review item chips (#10685)
* tooltips for review item chips

* use flexbox instead of margins
2024-03-26 07:07:49 -06:00
Josh Hawkins
bc6b4c38b8 improve timeline scrolling with dynamic speed (#10677) 2024-03-25 20:29:42 -06:00
Nicolas Mowen
30d93e1d90 Improve refreshing of review items (#10675) 2024-03-25 21:25:06 -05:00
dependabot[bot]
7b7d3c56cc Bump pytz from 2023.3.post1 to 2024.1 in /docker/main (#9592) 2024-03-25 18:08:31 -06:00
Josh Hawkins
71c7504de5 fix timeline upward scrolling limit (#10673) 2024-03-25 14:56:20 -06:00
Nicolas Mowen
6dd6ca5de5 Only allow visible cameras to go live on dashboard (#10671)
* Only show live cameras that are currently visible

* Add back black background

* fix
2024-03-25 15:56:13 -05:00
Josh Hawkins
51db63e42b Motion review changes (#10667)
* Add outlines in motion only mode

* fix playground
2024-03-25 10:19:55 -06:00
Nicolas Mowen
258cd5b6d7 Include which cameras detected motion during aggregated data (#10663) 2024-03-25 11:00:28 -05:00
Josh Hawkins
7b64091128 Motion review playback optimizations (#10659)
* handle motion timestamps with ranges

* check for overlaps when checking segment for events

* rename motion color vars to significant_motion for consistency

* safelist significant_motion

* rename vars for clarity and use timeout instead of interval
2024-03-24 20:37:44 -06:00
dependabot[bot]
24d29dd32c Bump dependabot/fetch-metadata from 1 to 2 (#10607)
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1 to 2.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v1...v2)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-24 19:55:15 -06:00
Josh Hawkins
37f60f7140 UI changes (#10651)
* Check if event time is in segment

* conditionally render minimap bounds for event segments
2024-03-24 11:39:28 -06:00
Nicolas Mowen
0fda7147be UI tweaks (#10645)
* Use green chip instead of dimming to show that item has been reviewed

* Redesign log page to use similar style to events

* Use icon only in mobile

* Remove unused
2024-03-24 12:23:39 -05:00
Josh Hawkins
f91dc37399 Add outline for alerts/detections in motion review (#10642) 2024-03-24 06:54:34 -06:00
Nicolas Mowen
d260c6926a Fix safari preview transition (#10638) 2024-03-23 18:47:25 -05:00
Nicolas Mowen
e3a7aa6b6c Smooth transitions between preview scrubbing (#10636)
* Use canvas to save video state before switching to smooth transitions between previews

* Smooth current hour as well
2024-03-23 17:11:35 -06:00
Nicolas Mowen
bb50b2b6f4 Respect motion only when playing back (#10632)
* Respect motion only when playing back motion

* Increase efficiency

* Fix import
2024-03-23 14:49:31 -05:00
Nicolas Mowen
c2a32bd6c1 Make saving preview frames on restart more reliable (#10630)
* increase priority of saving preview frames

* Improve checking for ended recording
2024-03-23 14:45:15 -05:00
Josh Hawkins
3a9607e59b Add relative movement by clicking on camera image for supported ptzs (#10629) 2024-03-23 10:53:33 -06:00
Nicolas Mowen
63bf986e08 Add ability to set playback speed on motion playback (#10628)
* Allow control of playback rate on motion page

* Apply playback rate
2024-03-23 11:24:57 -05:00
Nicolas Mowen
76a114a3cd Rewrite events communication to use zmq instead of mp.Queue (#10627)
* Move to using zmq for events updating

* Use event updater in manual events handler

* Formatting
2024-03-23 11:11:32 -05:00
Josh Hawkins
4159334520 option to show motion only on motion timeline (#10626) 2024-03-23 07:33:50 -06:00
Nicolas Mowen
8e1d18d06b Move keyboard controls to video controls (#10617) 2024-03-22 22:11:50 -05:00
Nicolas Mowen
4cf19458fe Only create docs dependabot PRs for docusaurus deps (#10593)
* Only create docs dependabot PRs for docusaurus deps

* Fix

* Update dependabot.yml
2024-03-22 20:39:30 -06:00
Nicolas Mowen
622dddd2c4 Motion playback (#10609)
* Move controls to separate component and make features configurable

* Allow playback on motion screen

* Simplify layout

* Fix seeking

* Fix playback

* fix preview scrubbing

* Fix player controls visibility

* Use opacity for both dark and light mode
2024-03-22 11:56:53 -05:00
Nicolas Mowen
83517f59b4 WebUI Fixes (#10608)
* Fix camera with -

* Fix not playing player after making slight adjustment

* Fix hovering getting stuck
2024-03-22 09:31:20 -05:00
Nicolas Mowen
df6c3b14dd Make stationary detection more resilient to inaccurate boxes (#10597) 2024-03-21 17:44:26 -05:00
Nicolas Mowen
e5595ebb2f Update docs deps (#10591)
* remove deprecated caution in facor of warning

* Update last dep
2024-03-21 12:52:45 -05:00
Josh Hawkins
0ac7aaabe3 Timeline minimap and scrolling changes (#10589)
* add function to get visible timeline duration

* Don't show minimap when minimap bounds exceed timeline area

* when minimap is hidden, only scroll timeline when needed

* observe only when not showing minimap

* no need to duplicate observer

* fix out of order param

* timeline utils hook props

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-03-21 11:49:04 -06:00
Nicolas Mowen
973275e163 Update rest of web deps (#10588)
* Update easy deps

* Update shadcn deps

* Update date functions and fix breaking change

* Remove unused
2024-03-21 09:26:13 -05:00
Josh Hawkins
4040191101 fixes and changes (#10587) 2024-03-21 08:00:04 -06:00
Nicolas Mowen
865c26ff18 Update recordings view (#10585)
* Update recordings view

* Fix opening recordings view from gif
2024-03-21 08:43:37 -05:00
Josh Hawkins
f113acee33 Summary timeline (#10569)
* implement summary timeline

* implement summary timeline

* merge dev

* conditionally attach listeners only when dragging

* set up listeners with a ref
2024-03-20 20:56:15 -06:00
Nicolas Mowen
c8fd23caa1 Update web deps (#10564) 2024-03-20 20:56:56 -05:00
Nicolas Mowen
8babe57d63 UI cleanup (#10567)
* Fix selected items text

* Use action icons from design and fix spacing

* Fix icons for live grid

* Fix viewed select api

* Setup default theme as system

* Make conig editor respect system theme
2024-03-20 20:46:45 -05:00
Nicolas Mowen
5af083cd8a Web deps again (#10562)
* Bump react-icons from 4.12.0 to 5.0.1 in /web

Bumps [react-icons](https://github.com/react-icons/react-icons) from 4.12.0 to 5.0.1.
- [Release notes](https://github.com/react-icons/react-icons/releases)
- [Commits](https://github.com/react-icons/react-icons/compare/v4.12.0...v5.0.1)

---
updated-dependencies:
- dependency-name: react-icons
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update jsdom

* Update drawer component

* Bump eslint

* Update more deps

* Fix lint

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-20 07:36:58 -06:00
Nicolas Mowen
f474bc4037 Always check previews when refocusing the page (#10546) 2024-03-19 22:16:22 -05:00
Nicolas Mowen
741f0a5115 Update Web deps (#10544)
* Bump react-icons from 4.12.0 to 5.0.1 in /web

Bumps [react-icons](https://github.com/react-icons/react-icons) from 4.12.0 to 5.0.1.
- [Release notes](https://github.com/react-icons/react-icons/releases)
- [Commits](https://github.com/react-icons/react-icons/compare/v4.12.0...v5.0.1)

---
updated-dependencies:
- dependency-name: react-icons
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update jsdom

* Update drawer component

* Bump eslint

* Update more deps

* Fix lint

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 22:06:00 -05:00
Nicolas Mowen
8589ef50a6 Ability to configure loitering time in a zone (#10543)
* Add loitering config

* Configure loitering

* simplify

* Add docs

* grammar

* Formatting
2024-03-19 15:58:04 -05:00
Nicolas Mowen
ab6bac1d2c Clean up selected data for recording (#10537) 2024-03-19 15:56:38 -05:00
Nicolas Mowen
f835e86df1 Don't use apple icon for android pwa (#10535)
* Don't use apple icon for android

* Fix dimensions

* fix icon name
2024-03-19 08:41:24 -05:00
Nicolas Mowen
ccdf9a2f0a Fix preview getting wrong update time (#10534)
* Fix preview getting wrong update time

* remove dead logic

* Cleanup

* Fix case where multiple previews play at the same time

* Fix typing
2024-03-19 08:34:49 -05:00
itsmesid
13b4e5ff41 Add C520WS to ONVIF PTZ camera recommendations. (#10466)
* Add C520WS to onvif supported camera list

* Spelling corrections

* Tapo C210 PTZ is working in version 1.3.11
2024-03-19 06:55:04 -05:00
Alex Yao
5c3925ab50 Add snapshot-clean.png API endpoint (#10510)
* Add snapshot-clean.png API endpoint

* fix lint

* enable on inprogress event
2024-03-19 06:54:25 -05:00
Josh Hawkins
3bd0ad63b4 ensure div by zero is replaced with 0 after normalization (#10528) 2024-03-18 21:21:09 -06:00
Josh Hawkins
d249e5b27f Timeline fixes and export handles (#10522)
* select an export range from timeline

* height tweak
2024-03-18 14:58:54 -06:00
Nicolas Mowen
880bae1eb2 Fix android/chrome seeking on previews (#10512) 2024-03-17 18:53:47 -06:00
Nicolas Mowen
bb6f153e2e Use preview quality setting to set image height and webp quality (#10502)
* Use preview quality setting to set image height and webp quality

* Increase keyframe interval as well with higher quality

* Don't use dynamic height
2024-03-17 18:30:14 -05:00
Josh Hawkins
e4d0e222e3 move handlebar timestamp outside of timeline on mobile (#10501) 2024-03-17 07:28:50 -06:00
Nicolas Mowen
4a360d8142 Fix thumbnails for panoramic cameras (#10499) 2024-03-17 07:31:02 -05:00
Nicolas Mowen
4e7808ac0c Normalize motion data in chunks (#10497) 2024-03-17 07:30:39 -05:00
Nicolas Mowen
1983de6528 Consolidate recordings view into one (#10496) 2024-03-17 07:30:19 -05:00
Nicolas Mowen
4e8600a0ef Maintain existing overlay state when setting hash (#10495) 2024-03-17 07:29:59 -05:00
Nicolas Mowen
cf6ef84271 Mark items as reviewed when manually seeking (#10494) 2024-03-17 07:29:41 -05:00
Josh Hawkins
89bd3867a9 Make all motion segments clickable (#10488) 2024-03-15 19:26:13 -06:00
Nicolas Mowen
c14f3c3902 Fix frigate+ submit and recordings layouts for portrait cameras (#10486)
* Fix plus submission dialog

* Different layout for portrait recordings

* Fix now preview found pulsing

* Fix bug with uneven milliseconds

* Improve consistency of video scaling
2024-03-15 18:28:57 -05:00
Nicolas Mowen
64763293a2 Add birdseye live view (#10485)
* Add birdseye viewer and make it linkable

* Add on click from main dashboard
2024-03-15 18:28:32 -05:00
Nicolas Mowen
657fab2787 Save motion as motion box count (#10484) 2024-03-15 13:13:40 -06:00
Nicolas Mowen
380b15b286 WebUI Fixes (#10481)
* Update previews on the hour

* Allow tap to toggle controls so zooming still works

* Use hash location insteaad of state for live camera view

* Add typing
2024-03-15 13:46:17 -05:00
Nicolas Mowen
93260f6cfd Add region count to database and use for motion activity (#10480)
* Add region count to database and use for motion activity

* Fix test
2024-03-15 09:29:22 -06:00
Josh Hawkins
c93b186eda Fix switching camera group bug (#10478)
* give default group a name

* use "default" as default value

* optional param

* fix string

* clean up
2024-03-15 08:59:41 -06:00
Nicolas Mowen
df0291db5c Fix zoom scaling for live view (#10479) 2024-03-15 09:57:58 -05:00
Nicolas Mowen
f5a26c5962 Add ability to zoom in to live and recordings views (#10475)
* Make live view zoomable

* Add zooming to full recordings
2024-03-15 07:03:14 -06:00
Nicolas Mowen
c66f552280 Improve Recordings loading (#10462)
* Show skeleton until video players finishes loading

* Clean up android logic

* Ensure mobile view video is consistent

* Cleanup

* Only show when not scrubbing

* Don't use loading

* Start preview at correct time too

* Fix react race condition

* Be wait for seek to show video player
2024-03-15 07:52:38 -05:00
Nicolas Mowen
d882cb0f63 Add skeleton for loading exports and improve spacing on bottom sheet (#10463)
* Add skeleton for loading exports and improve spacing on bottom sheet

* Hide non object frigate plus items
2024-03-15 05:59:03 -06:00
Nicolas Mowen
8d85a69203 Update UI and then run api call (#10460) 2024-03-14 15:49:03 -05:00
Nicolas Mowen
61c4ed9f12 Rework motion data calculation (#10459)
* Store motion data as a percent of total area

* Exclude historical data

* Use max so cameras without motion don't invlidate good data:
2024-03-14 13:57:14 -06:00
Josh Hawkins
6a02e65fc2 Use Inter webfont instead of ttf (#10456) 2024-03-14 09:50:06 -06:00
Josh Hawkins
98977f1ded dim motion segments for motion during alerts and detections (#10454) 2024-03-14 09:35:13 -06:00
Nicolas Mowen
45a318dfed Reduce outliers in motion data to ensure consistent scaling (#10452) 2024-03-14 09:31:33 -05:00
Josh Hawkins
39a29d148e Recording scrubbing fixes (#10439)
* use a single source of truth for scrubbing

* simplify controller state

* Cleanup scrubbing logic

* Apply same logic to mobile

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-03-14 08:28:06 -06:00
Nicolas Mowen
2decdeadb4 Persist selected camera group for live (#10448)
* Persist camera group selected

* Cleanup
2024-03-14 08:27:27 -06:00
Blake Blackshear
a660e3ae27 use credentials for webmanifest (#10447) 2024-03-14 06:36:56 -06:00
Nicolas Mowen
8937e3fd59 Mute video by default and allow control of volume (#10435)
* Mute video by default and allow control of volume

* Adjust volume behavior

* Adjust volume behavior

* Simplify more
2024-03-13 18:13:52 -05:00
Nicolas Mowen
c88a263a23 Cleanup gifs (#10434) 2024-03-13 17:37:15 -05:00
Nicolas Mowen
f9ed082e35 Use react lazy to break js files into smaller chunks & remove videojs in favor of hls.js (#10431)
* Use dynamic imports to reduce initial load times

Remove videojs

* Convert to using hls.js instead of videojs

* Improve mobile controls experience

* Cleanup

* Ensure playback rate stays teh same when source changes

* Use webp for latest camera image

* Switch to hls.js on error

* Don't rerun error if hls already tried

* Fix error checking

* also check for media decode error to fallback to HLS

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2024-03-13 15:24:24 -05:00
Nicolas Mowen
0e8350ea7f Fix jumping to segment in recordings view (#10424)
* Fix skeletons showing incorrectly

* Handle clicking segment from different time range
2024-03-13 09:05:01 -05:00
Nicolas Mowen
52ce6190ae Fix two way talk starting webrtc session (#10422)
* Fix two way talk starting webrtc session

* Remove logs
2024-03-13 09:04:11 -05:00
Josh Hawkins
79ca599ace Fix jsmpeg player component (#10425)
* fix jsmpeg component

* preserve aspect ratio

* remove forcing of jsmpeg

* full height only
2024-03-13 08:00:37 -06:00
Nicolas Mowen
9d01a7dc74 Fix gif layout (#10421) 2024-03-13 08:58:46 -05:00
Nicolas Mowen
b8e472643d Optimize web config to be installed as PWA (#10405)
* Update values and add site manifest

* Use appropriate icon types

* Add purpose to all

* Adjust dark theme color

* Remove unused
2024-03-12 19:58:29 -06:00
Nicolas Mowen
09cf54c731 Improve preview loading (#10406)
* Use skeleton for gif loading

* cache gifs as well

* Show skeleton when switching previews

* Fix touch controls for mobile

* Fix android mobile scrub logic

* Cleanup
2024-03-12 18:19:16 -05:00
Nicolas Mowen
92255f771b Add micropohone button for two way talk (#10408) 2024-03-12 18:19:02 -05:00
Josh Hawkins
9e10b914c9 Add ability to add legacy birdseye to camera groups (#10404)
* initial try

* add birdseye

* remove vite

* cleanup

* memoize

* remove console

* ensure birdseye is actually enabled in config

* birdseye first in select list and fix jsmpeg player size
2024-03-12 13:53:01 -06:00
Josh Hawkins
dce2e9b366 filter review items and motion to be main camera in recordings view only (#10403) 2024-03-12 11:08:31 -06:00
Nicolas Mowen
8c0275fe2f Add special casing for android preview scrubbing (#10398)
* Add special casing for android scrubbing

* Fix motion data
2024-03-12 09:24:18 -06:00
Nicolas Mowen
483a95b06b Override default player controls (#10401)
* Override default player controls

* Improve mouse behavior
2024-03-12 09:24:07 -06:00
Josh Hawkins
a2b0ca07cc UI tweaks (#10402)
* add minor ticks to timeline

* don't display motion events on veritcal bars on motion timeline

* color tweaks and spacing on config editor

* pad start and end of timeline to ensure handlebar is always visible
2024-03-12 09:23:54 -06:00
Nicolas Mowen
579a7c8900 Fix preview update (#10388) 2024-03-11 21:42:13 -05:00
Nicolas Mowen
1c5d6765a1 Preview improvements (#10384)
* Write preview frames as webp instead of jpg and ensure webp are cached in nginx

* Support preview player that shows current hour images

* Update to get preview player working

* Use timestamp based recordings check instead of calendar

* Start motion review from current time

* Adjust layout

* Use preview players for previews

* remove vite

* Cleanup

* Fix up the layout
2024-03-11 18:31:05 -05:00
Josh Hawkins
fa22f01f39 use flexbox for recordings view (#10385) 2024-03-11 17:07:56 -05:00
Nicolas Mowen
8d4b9bc7ed Indicate on calendar which days have unreviewed activity (#10381) 2024-03-11 10:14:41 -05:00
Nicolas Mowen
3515361320 refactor motion calculation (#10380)
* refactor motion calculation

* Use float
2024-03-11 08:53:13 -05:00
Nicolas Mowen
838ef636f8 Layout tweaks (#10365)
* Cleanup review items

* Fix spacing

* Fix -1 text

* Cleanup scroll

* Show activity indicator when review items are null

* Show no preview text when not found

* Add padding to buttons

* Simplify comparisons
2024-03-11 08:05:44 -05:00
Josh Hawkins
cac5bccbe7 Fix segments on motion review (#10370)
* fix segments on motion review

* remove unneeded data attribute
2024-03-11 06:56:36 -06:00
Daniel Harrelson
359e45a748 Update live.md (#10366)
Incorrectly stated tailscale used 100.0.0.0/8 CIDR block.

Correct CIDR block for tailscale in 100.64.0.0/10

RFC6598
2024-03-11 07:13:07 -05:00
Nicolas Mowen
020b09216b Fix image cleanup (#10364) 2024-03-10 14:18:44 -04:00
Nicolas Mowen
ee239744d8 Redesign exports page (#10359)
* Redesign exports page

* Cleanup

* fix overhange
2024-03-10 07:25:16 -06:00
Josh Hawkins
70825bc938 rename vars and change which div is absolutely positioned (#10358) 2024-03-10 07:23:36 -06:00
Nicolas Mowen
efaa95b742 Fix dst offset calculation (#10357) 2024-03-10 08:17:48 -05:00
Nicolas Mowen
b910db4f05 Fix handling of recordings and switching cameras (#10351)
* Fix handling of recordings and switching cameras

* mobile switch

* Cleanup

* Cleanup autoplay

* Remove vite
2024-03-10 08:17:09 -05:00
Kyler
e46b020395 Fix: rename docker images and tags in Jetson configuration docs (#10263)
* rename docker image tags in configuration docs for jetson, add correct image in sample codeblocks, fix typo in 'come'

The image names/tags for Jetson instructions were incorrect. I have updated the docs to point to the correct images.

* revert jetson docs phrasing to properly refer to Jetpack docker images
2024-03-09 15:01:09 +00:00
Josh Hawkins
9fc1286568 Don't check autotracking onvif requirements for users with autotracking disabled (#10350)
* separate autotracking onvif needs from standard ptz control setup

* try/except around GetServiceCapabilities call
2024-03-09 08:48:31 -06:00
Nicolas Mowen
62d13024f6 Adjustments and fixes (#10346)
* Increase duration of alerts and detections

* Add key

* Fix cancel button

* Fix motion review when switching days

* Add reset buttons and make calendar apply immediately

* Adjust apis for motion and audio activity

* Write review thumbs as webp and reduce size
2024-03-09 07:08:06 -07:00
Nicolas Mowen
eeb2187b97 Separate extra amd64 builds (#10319) 2024-03-09 06:04:57 -06:00
Nicolas Mowen
a50e955b3e Add job to delete old images (#10332) 2024-03-09 06:04:17 -06:00
Tacheev Alexey
034aaa7ef7 Fixed incorrect label link (#10342) 2024-03-09 06:03:40 -06:00
Nicolas Mowen
c721e7cfa9 fix preview comparison (#10338) 2024-03-08 17:45:42 -06:00
Nicolas Mowen
f7122a766e Ensure at least 2 frames are saved per minute in preview video (#10337)
* simplify

* Formatting
2024-03-08 17:24:47 -06:00
Nicolas Mowen
086eb37ece Cleanup to use new preview video player in dynamic player (#10335)
* Cleanup to use new preview video player

* Make it so motion persists the selected time

* Don't jump when player first starts

* Get autoplay working right
2024-03-08 17:24:12 -06:00
Josh Hawkins
05a66ce90d Timeline handlebar tweaks (#10336)
* initial offset click for desktop only

* align start timeline and update pixel math
2024-03-08 15:49:10 -07:00
Nicolas Mowen
3d539c93eb Fix motion review (#10329)
* Break preview only video player out

* Simplify

* Load after current preview changes

* Clear out waiting for seek state

* Start at correct time of hour

* Fix layout for tall video
2024-03-08 11:56:00 -06:00
Nicolas Mowen
ea5cb4fd8b Rework mobile drawers to have a max height (#10330) 2024-03-08 11:14:58 -06:00
Josh Hawkins
cb3045b424 Handlebar dragging fix (#10333)
* account for initial click position on handlebar when dragging

* fix wrong start time in playground
2024-03-08 09:13:42 -07:00
Josh Hawkins
dfab850b61 Better segment clicking (#10321)
* better segment clicking on motion segments

* move handlebar on click when handlebar is showing

* only scroll handlebar if needed
2024-03-07 21:02:29 -07:00
Nicolas Mowen
507c6afa2c Add filters to plus page and fix layout (#10320) 2024-03-07 18:32:26 -06:00
Nicolas Mowen
90a40d2509 Fix motion and recording views (#10318)
* Fix switching between different hours

* Simplify book keeping of different time ranges

* Rewrite player to handle changing of previews outside of video player

* Simplify switching between cameras

* Fix previews causing cameras to not load

* Simplify listeners

* Always clear existing listener
2024-03-07 18:31:43 -06:00
Nicolas Mowen
fc6d6a4e9a Fix layout shifting (#10313)
* Fix layout shifting

* Change value for current data

* Fix motion scrubbing lockout
2024-03-07 10:11:24 -06:00
Nicolas Mowen
8776cdfd5b Tweaks fixes (#10311)
* Save numbers as int instead of string

* Fix hover logic

* Fix delay for new alerts

* Fixup dialog and marking item as uploaded

* Make preview progress larger and easier to grab

* Allow hovering to control preview on desktop
2024-03-07 08:34:11 -06:00
Nicolas Mowen
b2931bcaa9 Remove paging (#10310)
* Remove paging and use reviewed as an internal filter

* Fix new reviews not going away
2024-03-07 08:33:36 -06:00
Nate Meyer
8bfc0c98dc Set Compute Level for CI build (#10276) 2024-03-07 05:59:33 -06:00
Nicolas Mowen
ccb5e05e3e Cleanup overlay state with types and use overlay for severity (#10299) 2024-03-06 19:17:35 -06:00
Nicolas Mowen
3d90f50d84 Ability to add, edit, and delete camera groups in the UI (#10296)
* Add dialog for creating new camera group

* Support adding of camera groups and dynamically updating the config

* Support deleting and edit existing camera groups

* Don't show separator if user has no groups

* Formatting

* fix background
2024-03-06 19:15:50 -06:00
Josh Hawkins
90db27e3c8 Scrolling fixes and motion timeline changes (#10295)
* scrolling updates

* only scroll by 1 segment on desktop
2024-03-06 14:35:10 -07:00
Nicolas Mowen
fb81e44283 UI Tweaks (#10289)
* Use different cursor for dragging preview

* Improve filters UI and add audio labels

* Use switch and adjust colors

* Disable chromecast button and remove dimming

* Change marked reviewed text
2024-03-06 14:49:51 -06:00
Nicolas Mowen
55077a0bc9 Add page for submitting to frigate+ (#10273)
* Add screen for submitting to frigate+

* Fix sizing
2024-03-06 06:24:21 -06:00
Nicolas Mowen
68ed18d3f4 Reviewed buttons (#10271)
* mark items as reviewed when they are opened

* Update api to use json and add button to mark all as reviewed

* fix api so last24 hours has its own review summary

* fix sidebar spacing

* formatting

* Bug fixes

* Make motion activity respect filters
2024-03-05 18:39:37 -06:00
Josh Hawkins
b5edcd2fae better timeline scrolling behavior when dragging (#10269) 2024-03-05 14:53:49 -07:00
Nicolas Mowen
ac9cd72f28 Organize api docs and add new review and preview apis (#10268)
* reorganize api docs into sections

* Add current apis to docs
2024-03-05 15:33:39 -06:00
Josh Hawkins
ed99be0856 Live camera aspect ratio fixes (#10266)
* dynamically manage aspect ratio

* full size

* always use camera aspect ratio for mobile

* no need for different handling for pano cams

* don't set aspect ratio on fullscreen
2024-03-05 13:19:56 -07:00
Nicolas Mowen
7be2923d2d Save previews when restarting (#10261) 2024-03-05 13:56:38 -06:00
Nicolas Mowen
a174d0000f Fix combined build (#10264) 2024-03-05 13:56:12 -06:00
Nicolas Mowen
9e8a42ca0e Motion timeline data (#10245)
* Refactor activity api to send motion and audio data

* Prepare for using motion data timeline

* Get working

* reduce to 0

* fix

* Formatting

* fix typing

* add motion data to timelines and allow motion cameas to be selectable

* Fix tests

* cleanup

* Fix not loading preview when changing hours
2024-03-05 13:55:44 -06:00
Nicolas Mowen
a174d82eb9 Disable hvc check (#10260) 2024-03-05 14:11:08 +00:00
Blake Blackshear
43c623be25 upgrade deps (#10257)
* upgrade web deps

* docs deps

* actions deps
2024-03-05 07:00:27 -06:00
Nate Meyer
390403d957 Pass computes value to libyolo_layer build (#10210) 2024-03-05 06:04:13 -06:00
Nicolas Mowen
30b68e59f2 Multi cam recording view (#10244)
* Split recording view for mobile and desktop and get desktop working

* Get stuff working well

* Handle onclick for video

* Fix camera grid

* set onclick
2024-03-05 06:03:10 -06:00
Nicolas Mowen
bbdb8d36ca Improve review data (#10246)
* Adjust remaining summary items when items are marked as reviewed

* Add api for filtering and show correct number when filtering

* Fix default group config

* Update review summary when data is reloaded

* Fix quick items not getting reviewed
2024-03-05 06:02:34 -06:00
Nicolas Mowen
b4b2162ada Camera groups (#10223)
* Add camera group config

* Add saving of camera group selection

* Implement camera groups in config and live view

* Fix warnings

* Add tooltips to camera group items on desktop

* Add camera groups to the filters for events

* Fix tooltips and group selection

* Cleanup
2024-03-04 16:18:30 -07:00
Josh Hawkins
38e76666e7 Motion timeline updates (#10242)
* adjust segment math

* simplify interp and fix math

* fix math and update dependency

* push debug

* Revert "push debug"

This reverts commit 07c171b341.
2024-03-04 15:18:27 -07:00
Josh Hawkins
282c92c9c8 Motion review timeline (#10235)
* initial motion and audio timeline with dummy data

* initial motion and audio timeline with dummy data
2024-03-04 09:42:51 -07:00
Josh Hawkins
0f168dfc1a fix overflowing review timeline on mobile (#10231) 2024-03-04 06:35:10 -07:00
Josh Hawkins
85ce672b53 add tooltip portal (#10233) 2024-03-04 06:34:23 -07:00
Nicolas Mowen
c2a537ce22 Motion review (#10221)
* Break detection grid into separate function

* Implement backward preview jump and jump lockout

* ensure lockout is engaged when starting

* Add preview only mode to make loading more efficeint

* remove scrollbar and match gaps/margins with live view

* Rewrite dynamic player to use html video for preview and fix grid gaps

* consistent check for aspect ratio for tall cameras

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2024-03-03 22:21:30 -06:00
Nicolas Mowen
d3f9fd1a60 Review summary (#10196)
* Create review summary api to get information about reviewed and unreviewed events on each day

* remove unused

* Fix tests

* Format tests

* Fix
2024-03-03 18:19:02 -06:00
Nicolas Mowen
fa0f509e18 Fix case where model path is set but not labelmap path (#10215) 2024-03-03 18:17:56 -06:00
Nicolas Mowen
1441a83151 Fix resolution of timeline dragging (#10219) 2024-03-03 18:17:24 -06:00
Josh Hawkins
a515697e08 Use touch events for mobile review timeline (#10212)
* mobile touch events

* rebase

* fix scroll mode

* clean up deps and remove unneeded useeffect

* remove vite
2024-03-03 12:50:38 -07:00
Josh Hawkins
c74eb75554 Update camera activity indicator (#10208)
* new indicator

* create indicators directory and update imports

* create indicators directory and update imports

* remove vite
2024-03-03 09:32:47 -07:00
Josh Hawkins
312dc95156 More intelligent timeline scrolling (#10209)
* more intelligent timeline scrolling

* keep as div
2024-03-03 09:32:35 -07:00
Nicolas Mowen
8645545ef4 Add support for live fullscreen mode (#10191)
* Fix timeline colors

* Add support for full screen mode

* Add support for live view full screen

* Cleanup

* Add border to sidebar and statusbar
2024-03-02 21:59:50 -06:00
Nicolas Mowen
3c4b1fb6f2 Update flask and restructure into api folder with apis put into separate folders (#10193)
* Update flask

* Update flask and break apart different sections into different files

* formatting

* Fix test and add safety check
2024-03-02 22:10:37 +00:00
dependabot[bot]
0022c1aad0 Bump @types/node from 20.11.19 to 20.11.24 in /web (#10168)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.19 to 20.11.24.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-02 13:37:12 -07:00
dependabot[bot]
d008dd0e27 Bump autoprefixer from 10.4.16 to 10.4.17 in /web (#10129)
Bumps [autoprefixer](https://github.com/postcss/autoprefixer) from 10.4.16 to 10.4.17.
- [Release notes](https://github.com/postcss/autoprefixer/releases)
- [Changelog](https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/autoprefixer/compare/10.4.16...10.4.17)

---
updated-dependencies:
- dependency-name: autoprefixer
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-02 13:36:17 -07:00
dependabot[bot]
41da8e8b25 Bump react-router-dom from 6.20.1 to 6.22.2 in /web (#10148)
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.20.1 to 6.22.2.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.22.2/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-02 13:35:34 -07:00
Nicolas Mowen
837f30cbf0 Update frontend colors to match style guide (#10188)
* Get main background colors going

* Finish sidebar

* Get light mode colors working

* Adjust icons

* Adjust icons

* remove unused

* Fix mobile colors
2024-03-02 09:00:50 -06:00
vanseforge
64f142a5dd Endpoint for last clip (#9710)
* Added endpoint for last clip

* Update frigate/http.py

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* Update docs/docs/integrations/api.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* Update frigate/http.py

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* Update frigate/http.py

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* Formatted with ruff

---------

Co-authored-by: Vader <info@vanse.de>
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-03-02 08:36:12 -06:00
Nicolas Mowen
5028a9632e Individual live view (#10178)
* Get live camera view working

* Get ptz working

* Add button for ptz presets

* Add camera feature buttons

* Add button for camera audio

* Cleanup

* Cleanup mobile live

* Only use landscape check on mobile
2024-03-01 18:43:02 -06:00
Nicolas Mowen
a67e970fca Implement scroll lock for previews (#10180)
* Implement scroll lock

* Fix seekbar not working
2024-03-01 17:34:41 -07:00
Nicolas Mowen
ebf34ce378 Revamp multiselect (#10172)
* Just use multiselect for mobile

* Update revamped design and add export to values

* Get actions looking good on mobile and desktop
2024-03-01 11:56:45 -06:00
Josh Hawkins
a49e1bbc64 Timeline handlebar changes (#10170)
* auto scrolling handlebar with preview time

* tablets can show 2 columns on the event view grid

* font sizes

* hide minimap when previewing
2024-03-01 08:36:13 -07:00
Nicolas Mowen
49530dc2e4 Handle case where review spans across two hours (#10169) 2024-03-01 07:19:26 -07:00
Nicolas Mowen
96bf06a7d8 update paho requirement (#10166) 2024-03-01 05:50:57 -07:00
Nicolas Mowen
63d8c3662a Add multiselect and batch actions to review items (#10161)
* Implement context menu for batch operations and implement apis

* reduce preview calculations on rerenders

* Add button to mark above items as reviewed

* Use context menu for mark as reviewed

* Cleanup
2024-02-29 19:53:29 -07:00
Nicolas Mowen
ea9316e770 Update and migrate mqtt to v2 (#10160) 2024-03-01 00:59:47 +00:00
Nicolas Mowen
dcc0886305 Fix tooltips (#10154)
* use portal for tooltips

* Fix tooltips for desktop and mobile nav bars

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2024-03-01 00:59:26 +00:00
Nicolas Mowen
e7f8bca2c3 Preview player upgrades (#10152)
* Implement manual slider control for previews

* Automatically end preview video on mobile

* Show current time on timeline

* remove z height
2024-03-01 00:58:50 +00:00
Nicolas Mowen
cb30450060 Migrate pydantic to V2 (#10142)
* Run pydantic migration tool

* Finish removing deprecated functions

* Formatting

* Fix movement weights type

* Fix movement weight test

* Fix config checks

* formatting

* fix typing

* formatting

* Fix

* Fix serialization issues

* Formatting

* fix model namespace warnings

* Update formatting

* Format go2rtc file

* Cleanup migrations

* Fix warnings

* Don't include null values in config json

* Formatting

* Fix test

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2024-02-29 16:10:13 -07:00
Andrew Jackson
a1424bad6c Fix permission error accessing /run/secrets (#10097)
Checks that the service has read access to the directory before trying
to read it
2024-02-28 17:18:34 -06:00
Nicolas Mowen
3bf2a496e1 Fix linter and fix lint issues (#10141) 2024-02-28 16:23:56 -06:00
Nicolas Mowen
b6ef1e4330 Fix reload spamming (#10139) 2024-02-28 14:25:02 -06:00
Nicolas Mowen
d416ae86d7 Fix tall cameras not fitting in current hour frame (#10136) 2024-02-28 14:24:49 -06:00
Nicolas Mowen
b5becad63f Use alerts for live page gifs and allow opening recordings directly from them (#10135)
* Use alerts for gifs at top instead of events

* Add ability to open to recordings from event gif

* cleanup

* Formatting

* Add padding
2024-02-28 14:24:34 -06:00
Josh Hawkins
dce4e3fb0b Make full recordings view usable on mobile (#10134)
* adapt timeline to mobile

* remove unused

* tweaks

* pointer cursor on segments

* make full recordings view look better on mobile

* explicitly set timeline width for md

* button positioning
2024-02-28 08:57:56 -07:00
Nicolas Mowen
a978adc5a9 Fix reload (#10109)
* Fix reloading data

* Don't show new review data when not looking at last 24 hours

* Fix refresh button and no items text

* Cleanup
2024-02-28 08:16:32 -06:00
Nicolas Mowen
8072ce25c6 Use persistence for live layout (#10114)
* Use persistence for live layout

* Fix typing

* Fix persistence typing

* remove type

* More type fixing
2024-02-28 08:16:16 -06:00
Josh Hawkins
485057abc1 Adapt review timeline for mobile devices (#10120)
* adapt timeline to mobile

* remove unused

* tweaks

* pointer cursor on segments
2024-02-28 06:18:08 -07:00
Sjoerd Oostdijck
8034613beb Update cameras.md add tapo C225 camera (#10101) 2024-02-28 03:41:56 +00:00
Andrew Reiter
5edaaceaf2 Fix iOS playback of H.265 clips (#10105)
* Fix iOS playback of H.265 clips

* CI
2024-02-28 03:41:36 +00:00
Nicolas Mowen
9893741990 Update tailwind css and cleanup classNames (#10107)
* Bump tailwindcss from 3.3.5 to 3.4.1 in /web

Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.3.5 to 3.4.1.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.3.5...v3.4.1)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update tailwind css and cleanup

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-28 03:40:57 +00:00
Nicolas Mowen
7fa9a3df42 Update web deps (#10108)
* Bump vitest from 1.0.0 to 1.3.1 in /web

Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 1.0.0 to 1.3.1.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.3.1/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump clsx from 2.0.0 to 2.1.0 in /web

Bumps [clsx](https://github.com/lukeed/clsx) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/lukeed/clsx/releases)
- [Commits](https://github.com/lukeed/clsx/compare/v2.0.0...v2.1.0)

---
updated-dependencies:
- dependency-name: clsx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @vitejs/plugin-react-swc from 3.5.0 to 3.6.0 in /web

Bumps [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/vitejs/vite-plugin-react-swc/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react-swc/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react-swc/compare/v3.5.0...v3.6.0)

---
updated-dependencies:
- dependency-name: "@vitejs/plugin-react-swc"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump react-use-websocket from 4.5.0 to 4.7.0 in /web

Bumps [react-use-websocket](https://github.com/robtaussig/react-use-websocket) from 4.5.0 to 4.7.0.
- [Release notes](https://github.com/robtaussig/react-use-websocket/releases)
- [Commits](https://github.com/robtaussig/react-use-websocket/commits)

---
updated-dependencies:
- dependency-name: react-use-websocket
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-28 03:40:08 +00:00
Nicolas Mowen
3fed6a0ab3 Implement swipe gesture instead of autoplay for mobile (#10110)
* Implement swipe gesture instead of autoplay

* Cleanup
2024-02-28 03:39:06 +00:00
Nicolas Mowen
fd24007618 Revamp mobile UI (#10103)
* Simplify nav components

* Allow ability to choose live layout on mobile

* Combine event views

* Undo vite

* Fix autoplay

* Remove import

* Show filters on mobile view

* Spacing

* Don't separate properties
2024-02-27 15:39:05 -06:00
Josh Hawkins
622e9741c0 Review timeline improvements (#10102)
* make event bars clickable

* outline and scroll when segment is clicked

* match outline colors to event type

* hover thumbnails

* make event bars clickable

* outline and scroll when segment is clicked

* match outline colors to event type

* hover thumbnails

* fix merge from rebase

* remove minimap opacity classes

* live player outline colors

* safelist shadow classes
2024-02-27 12:41:26 -07:00
Nicolas Mowen
8663fbba01 Fix autoplay (#10099) 2024-02-27 12:24:15 -06:00
Nicolas Mowen
d94710171d Don't lazy load on iOS and don't use skeleton (#10096)
* Don't lazy load on iOS and don't use skeleton

* Cleanup banner

* All safari
2024-02-27 10:55:14 -06:00
Nicolas Mowen
21defbea9d Rewrite websocket to use tracked state instead of context (#10091)
* Rewrite websocket to use tracked state instead of context

* Cleanup

* Use component for updating items

* Fix scroll update

* Don't save vite
2024-02-27 09:05:28 -07:00
Nicolas Mowen
f95ce913b1 Publish finished reviews to mqtt / ws and use that for source of update banner (#10072)
* Add reviews to frontend

* Update ready when new review is saved

* fix

* Formatting
2024-02-27 06:37:39 -07:00
Florisz
57cddc5372 Update installation.md (#10020)
* Update installation.md

According to the v13 release the config.yml mapping needs to be the entire directory and not only the config.yml file

* Update docs/docs/frigate/installation.md

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2024-02-27 06:08:30 -07:00
Andrew Reiter
00c2caa1b7 Fix erroneous warning (#10070)
Customizing only the detector model path results in the warning
"Customizing more than a detector model path is unsupported." because
`{} is not {}` evaluates to True
2024-02-27 06:48:56 -06:00
JC
7eb89ca67c Add missing frame_time argument to ObjectTracker.match_and_update() (#10079)
And some little type hints
2024-02-27 06:48:01 -06:00
Nicolas Mowen
849f343b25 Reduce rerenders on some components (#10068)
* Remove direct callback

* don't rerender for callback

* Move websocket to top level events

* Be smarter about updating timeago

* Cleanup
2024-02-26 16:08:55 -06:00
Nicolas Mowen
e9076c0213 Show correct time range when time filter is active (#10066)
* Show correct time range when time filter is active

* remove console
2024-02-26 14:47:44 -06:00
Nicolas Mowen
20578de9d0 Conditionally show no items (#10065)
* Conditionally show no items

* Clean up view
2024-02-26 14:47:20 -06:00
Nicolas Mowen
3c5ed474af Add message when there are no items to review (#10064) 2024-02-26 12:00:49 -07:00
Josh Hawkins
93bd9ded88 Faster skeleton with refs (#10063)
* don't load metadata until image has loaded

* correct class name and remove lazy loading pkg

* try refs

* hook

* don't load metadata until image has loaded

* correct class name and remove lazy loading pkg

* try refs

* hook
2024-02-26 11:34:52 -07:00
Nicolas Mowen
1dd904d89a Don't show minimap when view is not scrollable (#10062) 2024-02-26 12:31:21 -06:00
Nicolas Mowen
76ad91f9b5 remove vis timeline (#10059)
* remove vis timeline

* Cleanup playground

* Cleanup

* fix
2024-02-26 12:00:53 -06:00
Josh Hawkins
da04dc0918 Skeleton fixes (#10060)
* don't load metadata until image has loaded

* correct class name and remove lazy loading pkg
2024-02-26 10:55:44 -07:00
Nicolas Mowen
2fd7fe7928 Update web deps (#10058)
* Bump follow-redirects from 1.15.3 to 1.15.5 in /web

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.5.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.3...v1.15.5)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump prettier from 3.1.0 to 3.2.5 in /web

Bumps [prettier](https://github.com/prettier/prettier) from 3.1.0 to 3.2.5.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.1.0...3.2.5)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump monaco-yaml from 4.0.4 to 5.1.1 in /web

Bumps [monaco-yaml](https://github.com/remcohaszing/monaco-yaml) from 4.0.4 to 5.1.1.
- [Release notes](https://github.com/remcohaszing/monaco-yaml/releases)
- [Commits](https://github.com/remcohaszing/monaco-yaml/compare/v4.0.4...v5.1.1)

---
updated-dependencies:
- dependency-name: monaco-yaml
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump swr from 2.2.4 to 2.2.5 in /web

Bumps [swr](https://github.com/vercel/swr) from 2.2.4 to 2.2.5.
- [Release notes](https://github.com/vercel/swr/releases)
- [Commits](https://github.com/vercel/swr/compare/v2.2.4...v2.2.5)

---
updated-dependencies:
- dependency-name: swr
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump msw from 2.0.10 to 2.2.1 in /web

Bumps [msw](https://github.com/mswjs/msw) from 2.0.10 to 2.2.1.
- [Release notes](https://github.com/mswjs/msw/releases)
- [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mswjs/msw/compare/v2.0.10...v2.2.1)

---
updated-dependencies:
- dependency-name: msw
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump vite from 5.0.5 to 5.1.4 in /web

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.5 to 5.1.4.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.1.4/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 10:21:21 -06:00
Josh Hawkins
8d96111184 Use skeleton for review image loading (#10040)
* don't show chips and date when image is loading

* add skeleton and change observer threshold

* remove debug

* use skeleton for live view too

* old activity indicator looks better on live

* fix gradients and lazy load with skeleton

* fading effects
2024-02-26 09:07:54 -07:00
Nicolas Mowen
4061be602d Automatically skip to next preview / clip when watching full recordings (#10055)
* Fix useEffect and try to load next clip for preview

* Get scrubbing to next preview working

* Handle skipping to next preview
2024-02-26 10:04:56 -06:00
Nicolas Mowen
41194966c7 Delete web-old directory (#10053) 2024-02-26 08:48:04 -07:00
Nicolas Mowen
3f1bd891e4 Use a rolling average of iou to determine if an object is no longer stationary (#9381)
* Use a rolling average of iou to determine if an object is no longer stationary

* Use different box variation to designate when an object is stationary on debug

* In progress

* Use average of boxes instead of average of iou

* Update frigate/track/norfair_tracker.py

Co-authored-by: Blake Blackshear <blake@frigate.video>

---------

Co-authored-by: Blake Blackshear <blake@frigate.video>
2024-02-26 07:37:56 -06:00
Chamila
0a15ef022b Add a section to dev guide on non-local development (#10049)
This adds a section with instructions on editing the source to run the
Web UI against a non-local backend server.

This resolves #10048
2024-02-26 12:15:32 +00:00
f1d094
e9d4e81f77 Updated troubleshooting per request: blakeblackshear#5392 (comment) (#10021)
* Update recordings.md

Updated troubleshooting per request: https://github.com/blakeblackshear/frigate/discussions/5392#discussioncomment-8571128

* Update recordings.md

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2024-02-26 12:15:14 +00:00
Andreas Ehn
b9c0e345e9 Update cameras.md (#10030)
Document Hanwha XNP-6550RH capabilities
2024-02-26 12:14:19 +00:00
Marc Altmann
2aee974e11 Update FFmpeg presets for Rockchip (#10034)
* update Rockchip FFmpeg presets

* disable afbc for rockchip ffmpeg presets

* allow changing aspect ratio
2024-02-26 12:13:42 +00:00
Nicolas Mowen
7b11ff1af6 Fix reviewed filter (#10039) 2024-02-25 15:36:18 -07:00
Nicolas Mowen
4e5546cc78 Fix reviewed filter (#10038) 2024-02-25 15:49:08 -06:00
Nicolas Mowen
9801534f11 Implement Review Filters (#10031)
* Get cameras filter working

* Implement label and review filters

* Fix

* Add time selection

* Cleanup

* Cleanup

* cleanup

* remove commented code

* Fix
2024-02-25 13:04:44 -06:00
Nicolas Mowen
4a7c159a44 Convert preview player to use html5 video (#10016)
* Convert preview player to use html5

* Cleanup

* Increase padding and use constant

* Firefox doesn't support high fps either

* Cleanup

* no need to special case firefox
2024-02-25 12:37:53 -06:00
Jeppe Stærk
47fba0d553 Update onvif table with tapo c220 (#9905)
* Update cameras.md

Tapo C220 added to ONVIF PTZ camera recommendations

* Update docs/docs/configuration/cameras.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-02-25 06:35:32 -06:00
Nicolas Mowen
7ccc7fb393 Allow 2 fps for previews where active fast objects are detected (#10025)
* Allow 2 fps for previews where active fast objects are detected

* Cleanup
2024-02-25 06:35:11 -06:00
Nicolas Mowen
c7e9fe7234 Live preview gifs should be updated on refocus (#10007) 2024-02-24 07:50:33 -06:00
Josh Hawkins
824e5ec3a3 Use first onvif profile with ptz config (#10012)
* Use zoom space id in Onvif RelativeMove setup (#9859)

* use zoom space id in onvif relativemove setup

* better handle cases when zooming is disabled

* Fix birdseye camera comparison (#9887)

* Format (#9889)

* use first onvif profile with ptz config

* Use zoom space id in Onvif RelativeMove setup (#9859)

* use zoom space id in onvif relativemove setup

* better handle cases when zooming is disabled

* use first onvif profile with ptz config

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-02-24 06:49:34 -07:00
Nicolas Mowen
d73c8bb90c Fix overlay in safari and firefox (#10015) 2024-02-24 07:48:18 -06:00
Nicolas Mowen
02dfa1222e Fix cross contaimation of labels (#10009) 2024-02-23 19:15:08 -06:00
Nicolas Mowen
318cdeb005 Fade (#10010) 2024-02-23 18:38:57 -06:00
Nicolas Mowen
3621f93d40 Review items right click menu (#10002)
* Add custom context menu for review items

* Only show mark as reviewed when it has not been reviewed

* Fix float comparison
2024-02-23 17:26:26 -07:00
Nicolas Mowen
50ab988d81 Add button to scroll to bottom of logs (#10006)
* Add button to scroll to bottom of logs

* Cleanup
2024-02-23 18:25:00 -06:00
Nicolas Mowen
74a8fee69c Use manual jpg when preview is not finished yet (#9997)
* Use manual jpg when preview is not finished yet

* Ensure safe filename and improve sorting

* Ensure name is correct

* Formatting
2024-02-23 14:38:11 -06:00
Josh Hawkins
64eaf60b24 remove overflow and scrollbar classes from grid (#10000) 2024-02-23 09:39:19 -07:00
Josh Hawkins
de3a6a8738 fix pointer events on review grid (#9998) 2024-02-23 08:30:18 -07:00
Josh Hawkins
7d18c2c03d UI tweaks (#9996)
* various tweaks

* update debounce time

* scroll to top with new events
2024-02-23 06:52:54 -07:00
JC
fc94fcb2ac Setting motion masks to zero, rather than 255, will speed up calibration, as the average frame starts out at zero (#9992) 2024-02-23 06:08:05 -06:00
Josh Hawkins
a6aa5328aa UI fixes (#9986)
* scroll minimap to keep it in view

* remove console log

* change ref

* rebase to dev

* rebase to dev

* rebase to dev

* fix history flexbox and live extra scrollbar

* remove extra class
2024-02-22 20:15:50 -07:00
Nicolas Mowen
f84d2db406 Recordings viewer (#9985)
* Reduce redundant code and don't pull new items when marking as reviewed

* Chunk recording times and run playback

* fix overwriting existing data

* Implement scrubbing

* Show refresh button

* Remove old history

* Fix race condition

* Cleanup handling

* Remove console
2024-02-22 18:03:34 -06:00
Nicolas Mowen
fa57a3db28 No reviews for objects without position changes, create frame initially for detection / alert (#9984) 2024-02-22 18:03:13 -06:00
Josh Hawkins
9d8b568438 timeline zooming demo (#9980) 2024-02-22 09:28:05 -06:00
Josh Hawkins
a5a1a54c55 Expose setter for review timeline handlebar (#9978)
* expose setter for handlebar

* use as much resolution as possible
2024-02-22 08:16:37 -06:00
Nicolas Mowen
746939ed4f Fix safari preview speed and other cleanup (#9976)
* Cleanups and fix safari preview speed on iOS

* Clarifying comment

* Update paging when loading page with no items

* Use chip for detections and show all the time

* make time ago dense

* Be smarter about paging empty

* Fix elevation
2024-02-22 07:08:55 -07:00
Nicolas Mowen
6626b8d758 Show statusbar with cpu and gpu stats (#9968)
* Show statusbar with cpu and gpu stats

* fix gif logic
2024-02-21 20:27:02 -06:00
Nicolas Mowen
33c77d03c7 Reorganize stats (#9960)
* Reorganize stats

* Fix tests
2024-02-21 14:10:28 -06:00
Nicolas Mowen
509e46adc8 Review segment UI (#9945)
* Add ui for events

* Display data for review items

* Use preview thumbnails

* Implement paging

* Show icons for what was detected

* Show progress bar on preview thumbnail

* Hide the overlays on hover and update reviewed status

* Dim previews that have been reviewed

* Show audio icons

* Cleanup preview thumb player

* initial implementation of review timeline

* Use timeout for hover playback

* Break apart mobile and desktop views

* Show icons for sub labels

* autoplay first video on mobile

* Only show the last 24 hours by default

* Rework scrolling to fix nested scrolling

* Final scroll cleanups

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
2024-02-21 13:07:32 -07:00
Josh Hawkins
be4b570346 Review timeline bugfixes (#9962)
* fix severity logic

* timestamp line height

* use timestamp for end of timeline instead of duration
2024-02-21 10:58:41 -07:00
Nicolas Mowen
e608297c31 quick db fix (#9946) 2024-02-20 18:53:56 -07:00
Nicolas Mowen
940be5dc6f Create ReviewSegment table in DB for organizing detections to be reviewed (#9918)
* Add review to database

* Create main manager for review segments

* Upsert and maintain review segments

* Update logic for adding new segments

* Add api

* Support deleting review segments on recording cleanup

* Add field for alert labels

* Formatting

* Logic fixes

* Save 16:9 thumbnail for review segment

* Ensure that crop is 16:9

* Fix non detected objects being added

* Only include true positives

* Add sub labels to data
2024-02-20 16:26:09 -07:00
Josh Hawkins
cdd6ac9071 Implement event review timeline (#9941)
* initial implementation of review timeline

* hooks

* clean up and comments

* reorganize components

* colors and tweaks

* remove touch events for now

* remove touch events for now

* fix vite config

* use unix timestamps everywhere

* fix corner rounding

* comparison

* use ReviewSegment type

* update mock review event generator

* severity type enum

* remove testing code
2024-02-20 23:22:59 +00:00
Rob Arnold
aa99e11e1a Autodetect AMD GPUs for VAAPI GPU stats (#9898)
* Add autodetection logic

* Fix formatting

* Add some explanatory comments

* Actually fix lint
2024-02-20 23:21:54 +00:00
Marc Altmann
299511cd9d Update FFmpeg for Rockchip image (#9912)
* update build files

* update ffmpeg presets

* remove fix for HA add-on
2024-02-20 23:21:24 +00:00
Nicolas Mowen
f64ffa3a56 Fix black bar at bottom of previews (#9923) 2024-02-20 23:20:56 +00:00
Nicolas Mowen
dba21b606d Convert config updating and video/audio queues to use zmq (#9893)
* Add config pub / sub pattern

* remove recording from feature metrics

* remove audio and feature metrics

* Check for updates from all cameras

* remove birdseye from camera metrics

* remove motion and detection camera metrics

* Ensure that all processes are stopped

* Stop communicators

* Detections

* Cleanup video output queue

* Use select for time sensitive polls

* Use ipc instead of tcp
2024-02-19 07:26:59 -06:00
John Vandenberg
3cff3a086b fix typos (#9895) 2024-02-17 16:01:50 -06:00
Nicolas Mowen
6476f8ade7 Format (#9889) 2024-02-16 09:35:21 -06:00
Nicolas Mowen
42bf614131 Fix birdseye camera comparison (#9887) 2024-02-16 08:43:46 -06:00
Blake Blackshear
617c728a88 another name fix (#9886) 2024-02-16 06:51:19 -06:00
Blake Blackshear
d1bc90b225 Rename Camera Support.yml to camera-support.yml 2024-02-16 06:48:23 -06:00
Blake Blackshear
170f2ac27f Rename camera support.yml to Camera Support.yml 2024-02-16 06:45:20 -06:00
Blake Blackshear
68e1f4670b Update question.yml 2024-02-16 06:43:32 -06:00
Blake Blackshear
57eed11f39 fix names (#9885) 2024-02-16 06:31:37 -06:00
Blake Blackshear
d38a9f7c6d remove invalid keys (#9884) 2024-02-16 06:18:20 -06:00
Nicolas Mowen
a1b5fb81fd Issue -> discussion (#9830)
* Link to discussions for support

* Move camera support

* Delete .github/ISSUE_TEMPLATE/camera_support_request.yml

* Create config_support.yml

* Delete .github/ISSUE_TEMPLATE/config_support_request.yml

* Delete .github/ISSUE_TEMPLATE/detector_support_request.yml

* Create detector_support.yml

* Move remaining items

* Create question.yml
2024-02-16 06:12:40 -06:00
Josh Hawkins
616eb5f96a Use zoom space id in Onvif RelativeMove setup (#9859)
* use zoom space id in onvif relativemove setup

* better handle cases when zooming is disabled
2024-02-16 06:09:30 -06:00
Martin Weinelt
5720b63d70 Import escape function directly from markupsafe (#9858)
Adds a direct dependency on markupsafe, instead of relying on the
implicit dependency via Flask.

This is in preparation of Flask 3.0 support, which will drop compat for
importing escape indirectly.
2024-02-16 06:08:44 -06:00
Nicolas Mowen
dd3dc7949a Use zmq for inter process communication (#9309)
* Use zmq for inter process communication

* Use localhost for reply and request

* Use pyobj instead of json and Need to use separate requestors for each audio listener

* Cleanup port defining
2024-02-14 18:24:36 -06:00
Blake Blackshear
198dbbdff1 Merge remote-tracking branch 'origin/master' into dev 2024-02-14 18:20:55 -06:00
Nicolas Mowen
8c4811ed69 Use webrtc for safari live view (#9839)
* Move safari function

* Use webrtc for safari

* Use taller aspect ratio for tall thumbnails

* Simplify thumbnail sizing

* Use correct aspect ratio on all devices
2024-02-14 18:19:55 -06:00
Blake Blackshear
bad80a64ef Fix builds (#9852)
* show images for troubleshooting

* more debug and try max space action

* fixes

* oops

* maximize first

* mount build volume for docker use

* moved to shared setup and cleanup

* remove temp branch

* remove rocm for master
2024-02-14 18:16:53 -06:00
Josh Hawkins
764736b223 update dev builds message (#9853) 2024-02-14 18:12:33 -06:00
Josh Hawkins
fa384a7f9d ensure jsmpeg canvas is rounded and clipped (#9842) 2024-02-13 23:25:28 +00:00
Nicolas Mowen
ac0059cc1a Make default region multiplier consistent (#9685)
* Make default region multiplier consistent

* Adjust tests
2024-02-13 23:25:00 +00:00
Nicolas Mowen
63bc1b1582 Improve thumbnails and live player (#9828)
* Don't show gif until event is over and fix aspect

* Be more efficient about updating events

* ensure previews are sorted

* Don't show live view when window is not visible

* Move debug camera to separate view

* Improve jpg loading

* Ensure still is updated on player live finish

* Don't reload when window not visible

* Only disconnect instead of full remove

* Use start time instead of event over to determine gif
2024-02-13 01:28:36 +00:00
lawm
e93e5ed931 docs: fix links to full configuration reference (#9808) 2024-02-12 17:38:55 -06:00
Josh Hawkins
f54cb21bd0 UI changes (#9823)
* fix button within button

* add subtle overlay gradient

* try disconnecting to improve memory usage

* rounded corners on gradients
2024-02-12 17:34:45 -06:00
harakas
09153a154a ci: rocm builds (#9796) 2024-02-12 06:24:02 -06:00
Michael Scheiffler
77e77775b2 Added documentation for time-lapse export (master) (#9804)
* Added documentation for time-lapse export (master)

* Changed accoring to review comments

* Update docs/docs/configuration/record.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* Update docs/docs/configuration/record.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-02-12 06:23:48 -06:00
Blake Blackshear
f4a44fd93c remove reference to the term credit (#9799) 2024-02-11 16:40:35 +00:00
Nicolas Mowen
b9e20fc833 Fix gif creation and add better error handling (#9797)
* Add better error handling

* Fix end_ts logic

* Formatting
2024-02-11 08:06:16 -06:00
Nicolas Mowen
bcbea8da7d Create API to create gif from previews and show instead of still thumbnails (#9786)
* Start working on animation

* Change output file

* Create preview gif

* Show animated gif for event thumb

* Remove favorite

* Cleanup
2024-02-11 07:23:45 -06:00
Josh Hawkins
9de09f6cdf fix tooltips on mobile and make 2-row cameras full height (#9787) 2024-02-11 06:30:52 -06:00
Matt Brown
89f4db617a Docs: Fix and clarify which /dev/video devices to use with Raspberry Pi (#9509)
* Docs: Fix and clarify which /dev/video devices to use with Raspberry Pi

* Update docs/docs/configuration/hardware_acceleration.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* Update docs/docs/configuration/hardware_acceleration.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-02-10 13:44:52 -06:00
printplaatreparatie
b5aaa6759a Revise VSCode hostname info in docs (#9709)
* Revise VSCode hostname info in docs

* Fix misplaced backtick

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-02-10 13:43:24 -06:00
Sven-Hendrik Haase
54bbad12f8 Mention that AMD CPUs work just fine with OpenVINO (#9740)
* Mention that AMD CPUs work just fine with OpenVINO

* Doc consistency fixes
2024-02-10 13:42:32 -06:00
Josh Hawkins
dc2e8f7f70 Onvif: skip non-video profiles in setup (#9708)
* use first h264 onvif profile

* error if profile remains unset

* move create_ptz_service call

* add profile logger debug
2024-02-10 13:41:24 -06:00
harakas
cd5f4b1534 detectors/edgetpu: yolov8 support (#9782)
* detectors/edgetpu: add support for yolov8 models

* docs: edgetpu yolov8 running

* docs: edgetpu yolov8 attribution and language

* Update docs/docs/configuration/object_detectors.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-02-10 13:39:28 -06:00
Maximo Guk
86341c3172 Add error handling for unsupported label uploading to frigate+ (#9775) 2024-02-10 13:35:17 -06:00
Nicolas Mowen
91cdf64602 Birdseye enhancements (#9778)
* Center single camera view

* Implement scaling factor

* Add config for maximum number of cameras

* Add config for inactivity threshold

* update docs
2024-02-10 11:55:13 -06:00
harakas
cad7cdfb7e download-models: fix startup failure caused by unset variable (#9781) 2024-02-10 11:54:18 -06:00
Josh Hawkins
2d22800a3d Set aspect ratios on live display (#9780)
* set aspect ratios on live display

* try 8/9
2024-02-10 16:28:23 +00:00
harakas
44d8cdbba1 AMD GPU support with the rocm detector and YOLOv8 pretrained model download (#9762)
* ROCm AMD/GPU based build and detector, WIP

* detectors/rocm: separate yolov8 postprocessing into own function; fix box scaling; use cv2.dnn.blobForImage for preprocessing; assert on required model parameters

* AMD/ROCm: add couple of more ultralytics models; comments

* docker/rocm: make imported model files readable by all

* docker/rocm: readme about running on AMD GPUs

* docker/rocm: updated README

* docker/rocm: updated README

* docker/rocm: updated README

* detectors/rocm: separated preprocessing functions into yolo_utils.py

* detector/plugins: added onnx cpu plugin

* docker/rocm: updated container with limite label sets

* example detectors view

* docker/rocm: updated README.md

* docker/rocm: update README.md

* docker/rocm: do not set HSA_OVERRIDE_GFX_VERSION at all for the general version as the empty value broke rocm

* detectors: simplified/optimized yolov8_postprocess

* detector/yolo_utils: indentation, remove unused variable

* detectors/rocm: default option to conserve cpu usage at the expense of latency

* detectors/yolo_utils: use nms to prefilter overlapping boxes if too many detected

* detectors/edgetpu_tfl: add support for yolov8

* util/download_models: script to download yolov8 model files

* docker/main: add download-models overlay into s6 startup

* detectors/rocm: assume models are in /config/model_cache/yolov8/

* docker/rocm: compile onnx files into mxr files at startup

* switch model download into bash script

* detectors/rocm: automatically override HSA_OVERRIDE_GFX_VERSION for couple of known chipsets

* docs: rocm detector first notes

* typos

* describe builds (harakas temporary)

* docker/rocm: also build a version for gfx1100

* docker/rocm: use cp instead of tar

* docker.rocm: remove README as it is now in detector config

* frigate/detectors: renamed yolov8_preprocess->preprocess, pass input tensor element type

* docker/main: use newer openvino (2023.3.0)

* detectors: implement class aggregation

* update yolov8 model

* add openvino/yolov8 support for label aggregation

* docker: remove pointless s6/timeout-up files

* Revert "detectors: implement class aggregation"

This reverts commit dcfe6bbf6f.

* detectors/openvino: remove class aggregation

* detectors: increase yolov8 postprocessing score trershold to 0.5

* docker/rocm: separate rocm distributed files into its own build stage

* Update object_detectors.md

* updated CODEOWNERS file for rocm

* updated build names for documentation

* Revert "docker/main: use newer openvino (2023.3.0)"

This reverts commit dee95de908.

* reverrted openvino detector

* reverted edgetpu detector

* scratched rocm docs from any mention of edgetpu or openvino

* Update docs/docs/configuration/object_detectors.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* renamed frigate.detectors.yolo_utils.py -> frigate.detectors.util.py

* clarified rocm example performance

* Improved wording and clarified text

* Mentioned rocm detector for AMD GPUs

* applied ruff formating

* applied ruff suggested fixes

* docker/rocm: fix missing argument resulting in larger docker image sizes

* docs/configuration/object_detectors: fix links to yolov8 release files

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-02-10 06:41:46 -06:00
Nicolas Mowen
64988c9be0 Streamline live view (#9772)
* Break out live page

* Improving layouts and add chip component

* Improve default camera player sizing

* Improve live updating

* Cleanup and fit figma

* Use fixed height

* Masonry layout

* Fix stuff

* Don't force heights

* Adjust scaling

* Cleanup

* remove sidebar (#9731)

* remove sidebar

* keep sidebar on mobile for now and add icons

* Fix revalidation

* Cleanup

* Cleanup width

* Add chips for activity on cameras

* Remove dashboard from header

* Use Inter font (#9735)

* Show still image when no activity is occurring

* remove unused search params

* add playing check for webrtc

* Don't use grid at all for single column

* Fix height on mobile

* a few style updates to better match figma (#9745)

* Remove active objects when they become stationary

* Move to sidebar only and make settings separate component

* Fix layout

* Animate visibility of chips

* Sidebar is full screen

* Fix tall aspect ratio cameras

* Fix complicated aspect logic

* remove

* Adjust thumbnail aspect and add text

* margin on single column layout

* Smaller event thumb text

* Simplify basic image view

* Only show the red dot when camera is recording

* Improve typing for camera toggles

* animate chips with react-transition-group (#9763)

* don't flash when going to still image

* revalidate

* tooltips and active tracking outline (#9766)

* tooltips

* fix tooltip provider and add active tracking outline

* remove unused icon

* remove figma comment

* Get live mode working for jsmpeg

* add small gradient below timeago on event thumbnails (#9767)

* Create live mode hook and make sure jsmpeg can be used

* Enforce env var

* Use print

* Remove unstable

* Add tooltips to thumbnails

* Put back vite

* Format

* Update web/src/components/player/JSMpegPlayer.tsx

---------

Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
Co-authored-by: Blake Blackshear <blake@frigate.video>
2024-02-10 05:30:53 -07:00
Stephen Advincula
f6a4c2a7b3 bump go2rtc to 1.8.5 (#9487) 2024-02-06 06:52:20 -06:00
Josh Hawkins
92a0705b03 show version in production builds (#9602) 2024-02-05 17:55:08 -06:00
Nicolas Mowen
f4310862aa WebUI Improvements and fixes (#9613)
* Show toast instead of text for success and errors

* Show correct times

* Start playing next hour when current hour ends

* Fix refreshing camera image

* Fix timeline
2024-02-05 17:54:08 -06:00
Nicolas Mowen
00804a0f81 Don't fail if message is received before websocket start (#9634) 2024-02-05 17:53:16 -06:00
Josh Hawkins
a33f2f117e more robust onvif checks (#9635) 2024-02-05 17:52:47 -06:00
Nicolas Mowen
50563eef8d Nms optimize for stationary cars (#9684)
* Use different nms values for different object types

* Add tests

* Format tests
2024-02-05 17:52:06 -06:00
Nicolas Mowen
97a619eaf0 Update Makefile for 0.13.2 (#9687) 2024-02-05 17:50:35 -06:00
Josh Hawkins
3df8b5829c Small autotracking changes (#9571)
* ignore web-new

* remove web-new

* catch exceptions for unsupported cameras

* don't split up large ptz movements

* fix ruff
2024-02-02 06:23:14 -06:00
Nicolas Mowen
2d0864c723 Adjust kalman filter used for norfair tracker (#9538)
* Adjust kalman filter

* Add comment

* Formatting
2024-02-02 06:22:56 -06:00
Nicolas Mowen
c5819478d3 Web & ffmpeg bug fixes (#9525)
* Fix scaling for long timeline lists

* Better handle taller video in player

* Fix birdseye options

* Fix ffmpeg auto detect
2024-02-01 06:44:10 -06:00
Nicolas Mowen
af3f6dadcb Improve graph using pandas (#9234)
* Ensure viewport is always full screen

* Protect against hour with no cards and ensure data is consistent

* Reduce grouped up image refreshes

* Include current hour and fix scrubbing bugginess

* Scroll initially selected timeline in to view

* Expand timelne class type

* Use poster image for preview on video player instead of using separate image view

* Fix available streaming modes

* Incrase timing for grouping timline items

* Fix audio activity listener

* Fix player not switching views correctly

* Use player time to convert to timeline time

* Update sub labels for previous timeline items

* Show mini timeline bar for non selected items

* Rewrite desktop timeline to use separate dynamic video player component

* Extend improvements to mobile as well

* Improve time formatting

* Fix scroll

* Fix no preview case

* Mobile fixes

* Audio toggle fixes

* More fixes for mobile

* Improve scaling of graph motion activity

* Add keyboard shortcut hook and support shortcuts for playback page

* Fix sizing of dialog

* Improve height scaling of dialog

* simplify and fix layout system for timeline

* Fix timeilne items not working

* Implement basic Frigate+ submitting from timeline
2024-01-31 12:56:11 +00:00
Nicolas Mowen
9c4b69191b Add graph showing motion and object activity to history timeline desktop view (#9184)
* Add timeline graph component

* Add more custom colors and improve graph

* Add api and data

* Fix data sorting

* Add graph to timeline

* Only show timeline for selected hour

* Make data full range
2024-01-31 12:56:11 +00:00
Nicolas Mowen
6dd9d54f70 UI Fixes (#9177)
* Fix mobile crash

* Reduce tap timeout

* Fix selection

* Try to fix safari empty frame

* Fix config editor
2024-01-31 12:56:11 +00:00
Josh Hawkins
d2ab44ce72 Reactify MSE player component (#9163)
* make mse a functional component with react hooks

* iOS 17 fixes

* birdseye mse

* remove debug

* fix test
2024-01-31 12:56:11 +00:00
Nicolas Mowen
160e331035 Improve desktop timeline view (#9150)
* Break apart mobile and desktop timeline views

* Set aspect ratio for player correctly

* more modest default width

* Add timeline item card

* Get video player to fit

* get layout going

* More work on youtube view

* Get video scaling working

* Better dialog sizes

* Show all timelines for day

* Add full day of timelines

* Improve hooks

* Fix previews

* Separate mobile and desktop views and don't rerender

* cleanup

* Optimizations and improvements

* make preview dates more efficient

* Remove seekbar and use timeline as seekbar

* Improve background and scrubbing
2024-01-31 12:56:11 +00:00
Nicolas Mowen
0ee81c7526 Automatically detect hwaccel args (#9142)
* Automatically detect nvidia / vaapi hwaccel args

* Update docs

* Use auto for hwaccel args

* Formatting
2024-01-31 12:56:11 +00:00
Nicolas Mowen
a946a8f099 Refactor history viewer to show player / timeline for full hour and use preview while scrubbing timeline (#9051)
* Move history card view to separate view and create timeline view

* Get custom time scrubber working

* Add back nav

* Show timeline bounding boxes

* Implement seeking limiter

* Use browser history to allow back button to close timeline viewer

* Fix mobile timeline and add more icons for detections

* Play when item is initially visible
2024-01-31 12:56:11 +00:00
Nicolas Mowen
9a0dfa723a Add logs to new webui (#9118)
* Add logs to new webui

* Automatically refresh logs while viewing

* Clean up hooks
2024-01-31 12:56:11 +00:00
Nicolas Mowen
9efb6b1caf Add mse live view (#9117) 2024-01-31 12:56:11 +00:00
Pierre Belanger
15f79d91e3 Remove deprecated RTMP port 1935 (#9137) 2024-01-31 12:56:11 +00:00
Nicolas Mowen
928dbd8335 Update dashboard cameras dynamically (#9100)
* Automatically update camera image when detecting objects and show activity indicators

* Update ws typing

* Cleanup type
2024-01-31 12:56:11 +00:00
Josh Hawkins
d430b99562 Autotracking: better handle objects that touch frame edges (#9062)
* handle edge cases better

* don't lowercase status strings

* ruff formatting
2024-01-31 12:56:11 +00:00
Nicolas Mowen
a1e5c658d5 Add support for filtering history page and add support for creating timeline entries for audio / custom events (#9034)
* Add filter popover

* Add api filter hook and use UI with filtering

* Get history filtering working for cameras and labels

* Allow filtering on detail level

* Save timeline entries for api events

* reset

* fix width
2024-01-31 12:56:11 +00:00
Nicolas Mowen
feb3ee0703 Allow deletion of history items (#9030)
* Allow deletion of history items

* Remove type
2024-01-31 12:56:11 +00:00
Josh Hawkins
7bec162353 Scrubber UI component (#9036)
* add scrubber and ui playground when running dev

* fix mobile dropdown menu width

* timeline scrubber and revamp for all event handlers
2024-01-31 12:56:11 +00:00
Nicolas Mowen
2236ae5d3b Add jsmpeg support to new webUI and make birdseye default for live page (#8995)
* Add jsmpeg and make birdseye default for live view

* Fix jsmpeg

* Fix
2024-01-31 12:56:11 +00:00
Nicolas Mowen
1a27c7db29 Fix birdseye memory leak (#8992) 2024-01-31 12:56:11 +00:00
Nicolas Mowen
f8d114cd33 Webui cleanups (#8991)
* Fix mobile event timeago

* Reduce preview playback rate for safari browser

* Fix dashboard buttons

* Update recent events correctly

* Fix opening page on icon toggle

* Fix video player remote playback check

* fix history image

* Add sticky headers to history page

* Fix iOS empty frame

* reduce duplicate items and improve time format

* Organize data more effictively and ensure data is not overwritten

* Use icon to indicate preview
2024-01-31 12:56:11 +00:00
Blake Blackshear
bdebb99b5a Use new UI (#8983)
* fixup build

* swap frontends
2024-01-31 12:56:11 +00:00
Nicolas Mowen
a2c6f45454 Camera dashboard (#8981)
* Show camera dashboard

* Cleanup

* Cleanup

* Cleanup

* Cleanup

* fix

* Fix input color

* Show recent events on dashboard
2024-01-31 12:56:11 +00:00
Nicolas Mowen
3a33090984 Review grid playback (#8971)
* Playback recording when clicking on review item

* Add timeline overlay selector

* Lint fixes

* Lint fixes

* Set video plays inline

* Stop autoplay on open

* Reverse order

* Improve autoplay performance

* Remove chromecast icon by default

* Improve margin and remove lazy image loading to reduce jumping

* Fix root margin for mobile

* Fix scrolling behavior

* Fix width
2024-01-31 12:56:11 +00:00
Nicolas Mowen
e3387de48f Add live views to new webui (#8970)
* Add support for live views

* Lint fixes

* Fix width

* Fix lint

* Cleanup hooks
2024-01-31 12:56:11 +00:00
Nicolas Mowen
fbe58652d5 Improve review grid (#8953)
* Use constant aspect ratio for review grid

* Add infinite scrolling

* Don't have horizontal scrolling

* Handle autoplay for mobile

* Load more efficiently
2024-01-31 12:56:11 +00:00
Nicolas Mowen
1961a0afc1 Support storage page in new ui (#8948)
* Add table and oveview components

* Add toooltips for cards

* Add storage

* Undo
2024-01-31 12:56:11 +00:00
Nicolas Mowen
4524d9440c Add initial implementation of history view in new webui framework (#8895)
* Add support for review grid

* Cleanup reloading on focus

* Adjust timeline api to include metadata and before

* Be more efficient about getting info

* Adjust to new data format

* Cleanup types

* Cleanup text

* Transition to history

* Cleanup

* remove old web implementations

* Cleanup
2024-01-31 12:56:11 +00:00
Nicolas Mowen
c1f14e2d87 Support config editor in new webUI (#8928)
* Add config editor to new webUI and fix double scroll

* Address review comments and enable light theme for vscode
2024-01-31 12:56:11 +00:00
Nicolas Mowen
0e6528a989 Add export page in to new web UI (#8929) 2024-01-31 12:56:11 +00:00
Nicolas Mowen
d2d1278a4d Remove rtmp (#8941)
* remove rtmp from python

* remove rtmp from nginx

* remove rtmp from docs

* fix test for missing role
2024-01-31 12:56:11 +00:00
Josh Hawkins
696434b36d Initial framework for new UI with React/Typescript (#8885)
* Write a low resolution low fps stream from decoded frames (#8673)

* Generate low res low fps previews for recordings viewer

* Make sure previews end on the hour

* Fix durations and decrase keyframe interval to ensure smooth scrubbing

* Ensure minimized resolution is compatible with yuv

* Add ability to configure preview quality

* Fix

* Clean up previews more efficiently

* Use iterator

* Ensure final frame in preview is not duplicated

* initial react/ts framework

* fix gitignore glob excluding ts files

* ignore folders in web-new

* SWRConfig changes for swr 2.x

* use frigateConfig type in websocket handlers

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-01-31 12:56:11 +00:00
Nicolas Mowen
b1cd5f0926 Add external sub label as timeline entry (#8855)
* Add external sub label to timeline

* Include icon

* Update timeline.py

Co-authored-by: Sergey Krashevich <svk@svk.su>

* Formatting

---------

Co-authored-by: Sergey Krashevich <svk@svk.su>
2024-01-31 12:56:11 +00:00
Nicolas Mowen
c716e4b1cb Ensure final frame in preview is not duplicated 2024-01-31 12:56:11 +00:00
Nicolas Mowen
cfda531f5a Write a low resolution low fps stream from decoded frames (#8673)
* Generate low res low fps previews for recordings viewer

* Make sure previews end on the hour

* Fix durations and decrase keyframe interval to ensure smooth scrubbing

* Ensure minimized resolution is compatible with yuv

* Add ability to configure preview quality

* Fix

* Clean up previews more efficiently

* Use iterator
2024-01-31 12:56:11 +00:00
Blake Blackshear
c80b8140b8 increment version 2024-01-31 06:23:54 -06:00
Blake Blackshear
34fb1c2ef5 Increase hash map size (#9515)
* bump version

* increase map hash size
2024-01-31 05:53:59 -06:00
Nicolas Mowen
bf23a21486 Quick fix docs (#9506)
fixes https://github.com/blakeblackshear/frigate/issues/9505
2024-01-30 12:11:43 -06:00
Blake Blackshear
01e2d209d0 Merge pull request #6262 from blakeblackshear/dev
0.13.0 Release
2024-01-30 07:30:11 -06:00
Nicolas Mowen
27567b49db Update go2rtc debug tip (#9463)
closes https://github.com/blakeblackshear/frigate/issues/9187
2024-01-30 06:14:53 -06:00
Blake Blackshear
d15ab0922b Docs updates (#9476)
* revamp plus docs

* consolidate label guidance

* add some common complete config examples

* clarify zone presence

* bottom center example of mask

* update recommended hardware

* update nav

* update getting started

* add openvino example

* explain why we track stationary objects

* move false positive guide to config folder

* fix link

* update record and parked car guide

* tweaks
2024-01-30 06:14:16 -06:00
leccelecce
64a91f552f Add info logging at startup if vacuuming database (#9432) 2024-01-26 07:18:29 -06:00
Kevin David
b1a034fbd4 false_positives.md: expand definition of ratios (#9332)
I found this thread pretty helpful: https://github.com/blakeblackshear/frigate/issues/8350#issuecomment-1782863838

I figured it'd be worth including in the docs themselves.

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2024-01-26 07:17:50 -06:00
Blake Blackshear
61d285ba13 Merge remote-tracking branch 'origin/master' into dev 2024-01-26 07:09:28 -06:00
Nicolas Mowen
65c47531f6 Update record docs to mention UTC (#9248)
* Update record docs to mention UTC

* Update docs/docs/configuration/record.md

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2024-01-26 06:02:26 -07:00
Nicolas Mowen
393f44aac6 Use continuous instead of 24/7 (#9329) 2024-01-26 06:47:02 -06:00
Nicolas Mowen
700c0fb410 Create glossary for commonly used frigate terms (#9356)
* Add glossary with commonly used terms for frigate

* Link back to full docs pages

* Add glossary to sidebar

* Clarifications and grammar fixes

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2024-01-26 12:13:39 +00:00
Alex Errant
346524c660 Add ghcr.io/blakeblackshear/frigate:stable-tensorrt example (#9383) 2024-01-22 05:08:31 +00:00
danielszilagyi
487c626e00 Mention NVR setup (#9404) 2024-01-22 05:07:38 +00:00
Andreas Lindhé
c5ccc0fb08 Fix typo: an environment variables (#9157) 2024-01-03 17:58:40 -06:00
Nicolas Mowen
66701b9cf9 note that only 5MP reolink cameras support the recommended config (#9190)
* Make note that only 5MP and lower reolink cameras support the recommended config

* clarify
2024-01-03 17:40:43 -06:00
Hydromel Victor Doledji
4c1d34f0e9 update docs to clarify variable substitution in go2rtc (#9181)
* update docs to clarify variable substitution in go2rtc

* update to complet

* cleanup spacing

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2024-01-03 17:39:51 -06:00
Nicolas Mowen
86cd97609d Remove mention of restream role from docs (#9176) 2024-01-03 17:39:30 -06:00
Nicolas Mowen
8e419132ea Clean user / pass from stats command line (#9189) 2024-01-03 07:30:25 -06:00
Nicholas Page
49814b34d3 Update Jetson ffmpeg patch for Jetpack 5.1.2 compatibility (#8914) 2023-12-31 07:38:29 -06:00
kaydee123
7b71c21c12 Update reverse_proxy.md (#9070)
Spelling mistake
2023-12-24 19:55:07 +00:00
Nicolas Mowen
c35c7da82a Don't fail if deepstack detector times out (#8979) 2023-12-15 23:25:21 +00:00
Nicolas Mowen
e390533760 Make recording docs more clear about 24/7 recording (#8931)
* Make recording docs more clear about 24/7 recording

* Add note about partial days

* remove `X`
2023-12-12 23:21:06 +00:00
FinnakaLite
64bee7a64f Included caution about Snapcraft docker issues. (#8925)
* Included caution about Snapcraft docker issues.

* Accepted format suggestion from NickM-27

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2023-12-12 10:48:42 +00:00
Nicolas Mowen
ca4e0dbc75 Fix ffmpeg input arg parsing (#8924) 2023-12-12 10:48:09 +00:00
Nicolas Mowen
ee7eaff965 Don't fail if NaN is returned for segment duration (#8923) 2023-12-12 10:47:40 +00:00
Matti Hiljanen
e512406764 Fix inertia calculation check (#8890) 2023-12-08 07:30:22 -06:00
Josh Hawkins
a4f5ad3a94 Proxy websockets in devcontainers (#8886)
* proxy websockets

* remove whitespace
2023-12-08 01:08:35 +00:00
Blake Blackshear
a47068922f Update deps (#8872)
* update web deps

* update docs deps

* update gh actions
2023-12-07 06:09:20 -06:00
Nicolas Mowen
f8153bdacc Add docs specifically for reolink doorbell (#8851)
* Add docs specifically for reolink doorbell

* Update docs/docs/configuration/camera_specific.md
2023-12-04 18:46:54 -06:00
Nicolas Mowen
0de800a8e5 don't fail on empty producers (#8854) 2023-12-04 18:46:26 -06:00
Nicolas Mowen
ebcf25741b Fix timeline overlay for in progress events (#8852) 2023-12-04 13:43:23 -07:00
Eric M
eed08f534f Update output.py with NTSC DVT, Amcrest DV1 aspect ratio 704x480 (#8835)
* Update output.py with NTSC DVT, Amcrest DV1 aspect ratio 704x480

* linter fix
2023-12-03 03:22:50 +00:00
Nicolas Mowen
da5cf1867b Clarify radeon env variable (#8809)
* Clarify radeon env variable

* Make note consistent for intel as well
2023-12-03 03:15:43 +00:00
Josh Hawkins
cc5297f180 handle onvif connection failure in autotrack init (#8838)
* handle onvif connection failure in autotrack init

* remove whitespace and add consistency

* error message consistency

* more consistency
2023-12-03 03:14:52 +00:00
Nicolas Mowen
f27025aef3 don't fail on go2rtc stream with no url (#8839) 2023-12-03 03:14:30 +00:00
Nicolas Mowen
595fa3d111 Re-add support for go2rtc webrtc api (#8828) 2023-12-01 06:47:09 -07:00
Nicolas Mowen
89051c1b90 Create Edgetpu troubleshooting docs (#8827)
* Link to edgetpu troublehsooting

* Add troubleshooting docs for edgetpu

* Add to sidebar

* Add section about dual edge tpu
2023-12-01 07:41:30 -06:00
Blake Blackshear
f00ced5a33 Show bbox on in_progress events (#8785)
* fix default value in docs

* use default snapshot config for in progress
2023-11-29 23:37:53 +00:00
Nicolas Mowen
9b003e175d Don't incorrectly overwrite score history (#8795) 2023-11-29 23:37:28 +00:00
Blake Blackshear
a490c375f4 Limit exposed go2rtc api to bare minimum (#8762)
* only permit GET requests to go2rtc

* bare minimum go2rtc passthrough

* support frigate card

* expose go2rtc streams data only
2023-11-27 18:25:47 -06:00
Nicolas Mowen
15644a2b0c Fix dark color scheme for exports (#8770) 2023-11-27 18:13:41 -06:00
Marc Altmann
27cf1cdf15 Fix path of device tree on HassOS add on (#8764)
* fix device tree path for HassOS

* fix symlink call

* fix formatting
2023-11-27 18:13:12 -06:00
Jennifer
fef6a7ca74 Update reverse_proxy.md (#8763)
Thhe
2023-11-27 18:12:57 -06:00
Blake Blackshear
5c4501efbc remove mqtt password from config api (#8757) 2023-11-26 15:45:16 -06:00
Justin Dhillon
614a36af9f Fix Broken Links (#8711)
* fixed broken link https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile/

* fixed broken link https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile/

* fixed broken link https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ignore_headers

* fixed broken link https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ignore_headers
2023-11-24 07:33:50 -06:00
Blake Blackshear
a0bc3a3626 clarifications to guide based on feedback (#8727) 2023-11-24 07:33:30 -06:00
Nicolas Mowen
18062eca06 Don't fail when tz is incorrect (#8723)
* Don't fail when tz is incorrect

* Fix import
2023-11-23 11:43:02 +00:00
Marc Altmann
1dc42d2904 update github links (#8705) 2023-11-21 23:20:26 +00:00
Sergey Krashevich
500d369c50 Fix: workaround for drawing non-latin characters (#7686)
* Add transliteration support to draw_box_with_label function

* isort
2023-11-21 02:05:51 +00:00
tpjanssen
3dd0192fe6 Add rename exports function to API (#8687)
* Add rename exports function to API

* Update http.py

* Feedback
* Formatting fixes

* Update http.py

Formatting fix

* Update http.py

Lint fix
2023-11-20 19:11:18 -06:00
Marc Altmann
1eb5105b24 Adding go2rtc presets for Rockchip hardware acceleration (#8686)
* add go2rtc presets for rk hw accel

* code formatting

* add docs about go2rtc presets

* Update comment
2023-11-20 19:10:44 -06:00
Sergey Krashevich
463865db55 fix go2rtc run (#8692) 2023-11-20 19:09:40 -06:00
Sergey Krashevich
ea247ca816 go2rtc 1.8.4 (#8691) 2023-11-21 01:07:54 +00:00
tpjanssen
8864e33d1c Customize regions grid overlay API (#8668)
* Customize regions grid overlay

* Update http.py

Fix
2023-11-19 14:51:54 +00:00
trademark789
934b16723b make go2rtc always rebuild config at startup (#8664)
* make go2rtc always rebuild config at startup

/dev/shm can be left mounted (in fact im pretty sure it's always left mounted) on the docker host after shutting down the frigate container.
If we only check that the file doesn't exist, stale data gets re-read every startup 
This will make troubleshooting a nightmare for the average user.

I had given up troubleshooting go2rtc several times because of this.

* generate config after supervisor data is loaded

* Fix fi

* fix fi

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2023-11-19 07:08:42 -06:00
Blake Blackshear
fc186e4d5f update web deps (#8663) 2023-11-19 05:24:52 -06:00
Nicolas Mowen
7d157dfeb0 Set max value for pre_capture (#8656) 2023-11-18 15:37:06 -06:00
Marc Altmann
977eef9138 fix chrash after restart (#8661) 2023-11-18 15:36:24 -06:00
Josh Hawkins
678f1201c6 use timeout for move queues (#8662) 2023-11-18 15:36:13 -06:00
Blake Blackshear
4879de263b Docs improvements (#8641)
* go all in on ruff

* upgrade docusaurus

* add netlify toml

* broken link

* fix netlify toml

* start filling out guide

* add debian setup detail

* simplify bash command
2023-11-18 08:04:43 -06:00
Marc Altmann
c6208b266b Include libraries and .rknn models for other Rockchip SoCs (#8649)
* support for other yolov models and config checks

* apply code formatting

* Information about core mask and inference speed

* update rknn postprocess and remove params

* update model selection

* Apply suggestions from code review

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* support rknn on all socs

* apply changes from review and fix post process bug

* apply code formatting

* update tip in object_detectors docs

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2023-11-18 07:53:49 -06:00
Nicolas Mowen
2da99c2308 Improve periodic sync reliability and make it optional (#8647)
* Improve recordings sync reliability

* Cleanup

* Formatting

* Make logs consistent

* Make syncing optional
2023-11-18 06:06:00 -06:00
Tibladar
9ac40cd953 Add H265 preset for Raspberry Pi (#8640)
* Add h265 pi preset to preset docs

* Add h265 pi preset to hardware acceleration docs

* Add preset for raspberry pi h265
2023-11-17 01:09:15 +00:00
Marc Altmann
7522bb6fab Add features to rknn detector (#8631)
* support for other yolov models and config checks

* apply code formatting

* Information about core mask and inference speed

* update rknn postprocess and remove params

* update model selection

* Apply suggestions from code review

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2023-11-17 01:08:41 +00:00
Josh Hawkins
7b520e8a9d use enabled_in_config for switch in HA integration (#8630) 2023-11-16 01:25:48 +00:00
Nicolas Mowen
cadb1a6a5b Fix reolink link in recommended hardware (#8628) 2023-11-16 01:25:16 +00:00
Nicolas Mowen
97c15f7ef3 Update go2rtc to 1.8.3 (#8627) 2023-11-16 01:24:26 +00:00
Francisco Matias Cuenca-Acuna
9fa70c3455 Add vision pipeline diagram to documentation (#7689)
* Add vision pipeline diagram

* Moved pipeline to the Guides section

* Fixing segment storage and other flows

* Added text

* Update docs/docs/guides/video_pipeline.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* Keeping case as other pages

* Changing sections to ##

* Update docs/docs/guides/video_pipeline.md

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>

* Update docs/docs/guides/video_pipeline.md

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>

---------

Co-authored-by: cat101 <cat101@nowhere.com>
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2023-11-16 01:23:44 +00:00
Marc Altmann
8c7f6d4a76 Add static FFmpeg with rockchip hardware acceleration to rk- image (#8599)
* add static ffmpeg with rockchip hw accel

* add ffmpeg presets

* fix scaling preset and update docs for rk hwaccel

* update usage info in ffmpeg_presets docs

* Add note about hardware acceleration support

---------

Co-authored-by: MarcA711 <>
2023-11-15 05:41:55 -06:00
Josh Hawkins
266b4099b5 a few small onvif fixes and relativemove debug (#8583) 2023-11-15 05:41:41 -06:00
Sch0field9
a1e68a62d0 Update cameras.md (#8556)
Added Reolink RLC-823A 16x
2023-11-15 05:41:25 -06:00
Nicolas Mowen
8a010fc1f5 Fix vaapi color mapping (#8604) 2023-11-14 00:35:29 +00:00
Nicolas Mowen
563fdec211 Fix safari timezone (#8574)
* Fix safari bad time format

* Fix processing
2023-11-10 18:12:48 -06:00
Nicolas Mowen
3457dcddfe Don't run forever in autotracking (#8579) 2023-11-10 18:12:20 -06:00
Blake Blackshear
57a06d2220 fix image tag (#8560) 2023-11-09 19:02:16 -06:00
Nicolas Mowen
aa93d4fbdd Fix nginx cache (#8558) 2023-11-09 16:09:25 -06:00
Nicolas Mowen
d0036b2f77 Update go2rtc to 1.8.2 (#8459)
* Update go2rtc to 1.8.2

* Update docs for 1.8.2
2023-11-09 06:43:06 -06:00
Nicolas Mowen
1b57f8c7e2 Show error when clicking on image before mask (#8547) 2023-11-09 06:42:19 -06:00
Nicolas Mowen
fa96ec64e4 Detect Resolution Docs (#8542) 2023-11-09 06:41:50 -06:00
Josh Hawkins
e89db13282 fix restart from webui (#8541) 2023-11-08 09:37:54 -07:00
Nicolas Mowen
fe6577736e Tuning Motion guide (#6877)
* start working on motion guide

* Update motion_detection.md

* Add to sidebar

* Add title / ID

* Fix typos

* Fix typos and clarify

* Formatting

* Add default values from reference config for each section

* Small grammar fix

* Move to cameras section

* Updates

* Clarify and improve wording

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2023-11-08 14:04:27 +00:00
Blake Blackshear
64537672e6 use skopeo to copy images (#8539) 2023-11-08 07:22:23 -06:00
Nicolas Mowen
ef36aabd30 Make output writing asynchronous (#8530)
* Don't wait for frame write in output process

* Formatting

* Handle websocket exception

* Limit camera queeue size to 1 second
2023-11-07 16:24:56 -07:00
Nicolas Mowen
ca84732574 Ensure storage cleanup doesn't fail (#8531) 2023-11-07 23:21:43 +00:00
Nicolas Mowen
0b828ef1ec Only cache json requests with nginx (#8529)
* Only cache json requests

* Use map instead
2023-11-07 23:18:58 +00:00
tpjanssen
3359123364 Performance increase with lots of recordings (#8525)
* Performance increase with lots of recordings

* Formatting + review

* Update 020_update_index_recordings.py

Formatting

* Feedback + check fix

* Update 020_update_index_recordings.py
2023-11-07 23:18:26 +00:00
Nicolas Mowen
cc5357a31a Remove iterator from recordings events (#8522) 2023-11-07 07:02:02 -07:00
Nicolas Mowen
f1b60f76eb Fix go2rtc UDP port default config (#8469)
* Fix go2rtc UDP port

* fix

* Use correct port

* fix comment

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2023-11-07 11:33:33 +00:00
Nicolas Mowen
f29e152619 Revert TRT class id filtering (#8497) 2023-11-07 11:32:52 +00:00
Nicolas Mowen
92906a500a Fix event only datetime check (#8500) 2023-11-07 11:32:31 +00:00
Nicolas Mowen
257bd89733 Reduce recording info timeout (#8506)
* Decrease timeout

* Use const for queue timeout
2023-11-07 11:32:11 +00:00
Josh Hawkins
1d99bb908d only use max target box for relative zoom limiter (#8509) 2023-11-07 11:31:39 +00:00
Nicolas Mowen
591b91194a Cleanup existing timeline entries (#8495)
* Cleanup existing timeline entries for beta users

* Formatting
2023-11-06 06:43:26 -07:00
Nicolas Mowen
2b2c831253 Set the min region size as the model size (#8486) 2023-11-06 06:45:37 -06:00
tpjanssen
08777100b5 Add /vod and /exports to Vite proxy config (#8490) 2023-11-06 06:44:53 -06:00
Nicolas Mowen
a482160691 Cleanup timeline entries (#8489) 2023-11-06 06:42:10 -06:00
Nicolas Mowen
89dd114da1 Write recording segments to cache with timezone info (#8468)
* Store recording segments with timezone info

* Don't use _

* Use different separator due to timezone
2023-11-05 14:30:29 -06:00
Nicolas Mowen
4c05ef48a7 Add dependabot to tensorrt python deps (#8455) 2023-11-05 14:29:06 -06:00
Nicolas Mowen
14c89c9b63 Fix periodic sync check (#8472)
* Fix periodic sync

* Formatting
2023-11-05 09:28:40 -07:00
Blake Blackshear
65e3e67a83 avoid import error for non-rk builds (#8454)
* avoid import error for non-rk builds

* linter
2023-11-04 07:56:35 -05:00
Nicolas Mowen
63233a5830 Periodically sync for stale recordings (#8433)
* Periodically cleanup recordings files / DB

* Make automatic sync limited ot last 36 hours
2023-11-04 02:21:29 +00:00
Nicolas Mowen
4f7b710112 Don't fail on invalid class IDs for TensorRT detector (#8438)
* Don't fail on invalid class IDs

* Fix whitespace

* Make log warning
2023-11-04 02:19:58 +00:00
coperni
ac53993f70 Add endpoint to restart Frigate (#8440)
* Add endpoint to restart Frigate

The only means of restarting Frigate remotely is to issue
a restart topic on the server's websocket. It's
convenient to also expose this capability via HTTP endpoint.

* Add new section to API docs

* Remove extra line
2023-11-04 02:19:29 +00:00
Josh Hawkins
ef750e73a2 add motion mask recommendation (#8448) 2023-11-04 02:18:43 +00:00
Nicolas Mowen
7270eef6bf Don't fail on 0 rms (#8447) 2023-11-04 02:18:23 +00:00
Marc Altmann
b54aaad382 fix rknn.py (#8434)
Co-authored-by: MarcA711 <>
2023-11-03 00:12:54 +00:00
Josh Hawkins
fc36be4f88 suppress error by overriding class func (#8431) 2023-11-02 23:24:14 +00:00
Blake Blackshear
aefecad4c0 Update deps (#8426)
* update web deps

* other deps
2023-11-02 13:36:49 +00:00
Nicolas Mowen
c57528cbcf Fix rk build (#8430) 2023-11-02 13:36:34 +00:00
Marc Altmann
090294e89b Initial support for rockchip boards (#8382)
* initial support for rockchip boards

* Apply suggestions from code review

apply requested changes

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* requested changes

* rewrite dockerfile

* adjust targets

* Update .github/workflows/ci.yml

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* Update docs/docs/configuration/object_detectors.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* Update docs/docs/configuration/object_detectors.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* add information to docs

* Update docs/docs/configuration/object_detectors.md

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>

* format rknn.py

* apply changes from isort and ruff

---------

Co-authored-by: MarcA711 <>
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2023-11-02 12:55:24 +00:00
Nicolas Mowen
a6279a0337 Clean up RPi ffmpeg presets (#8428)
* Clean up rpi ffmpeg presets

* Remove from docs

* Put back encoding
2023-11-02 12:54:51 +00:00
wbradmoore
37b82c0d60 Update getting_started.md (#8420)
fix configuring_go2rtc link
2023-11-02 06:20:19 -05:00
Blake Blackshear
0dd3dd23aa add support for docker secrets (#8409)
* add support for docker secrets

* check for directory first
2023-11-02 05:35:30 -05:00
Blake Blackshear
4bd29b2ee8 fix build tag (#8408) 2023-11-02 05:35:19 -05:00
Nicolas Mowen
cc79cbcadc Improve robustness of storage maintenance (#8411)
* Improve robustness of storage maintenance

* Fix tests

* Fix test
2023-11-01 23:21:59 +00:00
Nicolas Mowen
89366d7b12 Add endpoint to return camera frame with regions grid overlaid (#8413)
* Add endpoint to view grid overload on camera frame

* Add api to docs

* Formatting
2023-11-01 23:21:30 +00:00
Josh Hawkins
6eff08eb2d Add MQTT topic for active autotracking (#8419)
* prevent estimate clipping when autotracking

* use unclipped estimate in distance function only

* remove autotracking velocity changes

* publish on init
2023-11-01 23:20:26 +00:00
tpjanssen
8b6b83bd62 Filtering on Frigate+ submits in frontend (#8344)
* Initial draft for filtering Frigate+ submits in frontend

* Hide filter when Frigate+ is not enabled

* Update http.py

* Revert "Update http.py"

This reverts commit fa292682d6.
2023-11-01 23:19:46 +00:00
Nicolas Mowen
8b6e3a0d37 Fix region when no data in grid (#8415)
* Fix region when no data in grid

* Make comment more clear
2023-11-01 23:19:17 +00:00
tpjanssen
8a9b26df4e Visit camera directly from system page (#8405)
* Visit camera directly from system page

* Processed all feedback

* Changed button caption
2023-11-01 07:08:59 -06:00
tpjanssen
fd6a3bd5d2 API recordings snapsnot PNG fix (#8401)
* Update http.py

* Update http.py

Limit query results
2023-11-01 06:14:51 -05:00
Nicolas Mowen
8085ad4b4c Ensure that birdseye error correction uses a resolution that is divisible by 4 (#8398) 2023-11-01 06:13:12 -05:00
Josh Hawkins
af24eb7dbf Autotracking tweaks (#8400)
* optimize motion and velocity estimation

* change recommended fps and fix config validate

* remove unneeded var

* process at most 3 objects per second

* fix test
2023-11-01 06:12:43 -05:00
Blake Blackshear
d1620b4e39 clean passwords when both rtsp and http present (#8399) 2023-10-31 08:04:42 -05:00
Nicolas Mowen
ba603c1937 Make initialization configurable (#8392) 2023-10-30 20:26:31 -04:00
Nicolas Mowen
e89dafa82e Handle recording checks in utc (#8379)
* Handle recording checks in utc

* Formatting
2023-10-30 20:25:21 -04:00
Nicolas Mowen
9d717b371c Improve logic of birdseye (#8375)
* Improve logic of birdseye

* Formatting
2023-10-30 20:24:42 -04:00
Nicolas Mowen
3d70d29672 Delete export if it fails (#8381)
* Delete export if it fails

* Fix import
2023-10-30 20:24:11 -04:00
Nicolas Mowen
f1efd8dbe2 Use int for drawing box (#8388) 2023-10-30 19:53:29 -04:00
Blake Blackshear
159fb51518 implement nginx caching (#8333)
* implement nginx caching

* bypass cache from frigate frontend, reduce to 5s

* set cache time to 2s

* cache 200s for 5s

* exclude vod endpoints from cache
2023-10-29 06:47:24 -05:00
Blake Blackshear
cd64399fe5 add release workflow for images (#8362) 2023-10-28 10:08:53 -04:00
Blake Blackshear
d72e1c38ae plus docs clarification (#8352) 2023-10-28 10:08:29 -04:00
Sergey Krashevich
979c49fd35 Update build_nginx.sh (#8361) 2023-10-28 06:35:11 -05:00
Miguel Valenzuela
ac41b6e181 Update Output Args Presets AAC (#8161)
* Update Output Args Presets AAC

Upon researching the nuances of preset-record-generic-audio-copy & preset-record-generic-audio-aac

4c7ea01137/frigate/ffmpeg_presets.py (L341)
https://ffmpeg.org/ffmpeg.html#Main-options
https://stackoverflow.com/questions/70148683/will-ffmpeg-try-to-transcode-to-same-encoding

I'd suggest to disambiguate what these two do

* fix: lowercase
2023-10-19 17:14:56 -05:00
606 changed files with 57787 additions and 42193 deletions

View File

@@ -0,0 +1,168 @@
rtmp
edgetpu
labelmap
rockchip
jetson
rocm
vaapi
CUDA
hwaccel
RTSP
Hikvision
Dahua
Amcrest
Reolink
Loryta
Beelink
Celeron
vaapi
blakeblackshear
workdir
onvif
autotracking
openvino
tflite
deepstack
codeproject
udev
tailscale
restream
restreaming
webrtc
ssdlite
mobilenet
mosquitto
datasheet
Jellyfin
Radeon
libva
Ubiquiti
Unifi
Tapo
Annke
autotracker
autotracked
variations
ONVIF
traefik
devcontainer
rootfs
ffprobe
autotrack
logpipe
imread
imwrite
imencode
imutils
thresholded
timelapse
ultrafast
sleeptime
radeontop
vainfo
tmpfs
homography
websockets
LIBAVFORMAT
NTSC
onnxruntime
fourcc
radeonsi
paho
imagestream
jsonify
cgroups
sysconf
memlimit
gpuload
nvml
setproctitle
psutil
Kalman
frontdoor
namedtuples
zeep
fflags
probesize
wallclock
rknn
socs
pydantic
shms
imdecode
colormap
webui
mse
jsmpeg
unreviewed
Chromecast
Swipeable
flac
scroller
cmdline
toggleable
bottombar
opencv
apexcharts
buildx
mqtt
rawvideo
defragment
Norfair
subclassing
yolo
tensorrt
blackshear
stylelint
HACS
homeassistant
hass
castable
mobiledet
framebuffer
mjpeg
substream
codeowner
noninteractive
restreamed
mountpoint
fstype
OWASP
iotop
letsencrypt
fullchain
lsusb
iostat
usermod
balena
passwordless
debconf
dpkg
poweroff
surveillance
qnap
homekit
colorspace
quantisation
skylake
Cuvid
foscam
onnx
numpy
protobuf
aarch
amdgpu
chipset
referer
mpegts
webp
authelia
authentik
unichip
rebranded
udevadm
automations
unraid
hideable
healthcheck
keepalive

View File

@@ -10,10 +10,14 @@
"features": {
"ghcr.io/devcontainers/features/common-utils:1": {}
},
"forwardPorts": [5000, 5001, 5173, 1935, 8554, 8555],
"forwardPorts": [8080, 5000, 5001, 5173, 8554, 8555],
"portsAttributes": {
"8080": {
"label": "External NGINX",
"onAutoForward": "silent"
},
"5000": {
"label": "NGINX",
"label": "Internal NGINX",
"onAutoForward": "silent"
},
"5001": {
@@ -24,10 +28,6 @@
"label": "Vite Server",
"onAutoForward": "silent"
},
"1935": {
"label": "RTMP",
"onAutoForward": "silent"
},
"8554": {
"label": "gortc RTSP",
"onAutoForward": "silent"
@@ -42,7 +42,6 @@
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.black-formatter",
"visualstudioexptteam.vscodeintellicode",
"mhutchie.git-graph",
"ms-azuretools.vscode-docker",
@@ -53,13 +52,10 @@
"csstools.postcss",
"blanu.vscode-styled-jsx",
"bradlc.vscode-tailwindcss",
"ms-python.isort",
"charliermarsh.ruff"
],
"settings": {
"remote.autoForwardPorts": false,
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "none",
"python.languageServer": "Pylance",
"editor.formatOnPaste": false,
@@ -72,7 +68,7 @@
"eslint.workingDirectories": ["./web"],
"isort.args": ["--settings-path=./pyproject.toml"],
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,

View File

@@ -1,8 +1,5 @@
name: Camera Support Request
description: Support for setting up cameras in Frigate
title: "[Camera Support]: "
labels: ["support", "triage"]
assignees: []
body:
- type: textarea
id: description
@@ -14,7 +11,7 @@ body:
id: version
attributes:
label: Version
description: Visible on the Debug page in the Web UI
description: Visible on the System page in the Web UI
validations:
required: true
- type: textarea

View File

@@ -1,8 +1,5 @@
name: Config Support Request
description: Support for Frigate configuration
title: "[Config Support]: "
labels: ["support", "triage"]
assignees: []
body:
- type: textarea
id: description
@@ -14,7 +11,7 @@ body:
id: version
attributes:
label: Version
description: Visible on the Debug page in the Web UI
description: Visible on the System page in the Web UI
validations:
required: true
- type: textarea

View File

@@ -1,8 +1,5 @@
name: Detector Support Request
description: Support for setting up object detector in Frigate (Coral, OpenVINO, TensorRT, etc.)
title: "[Detector Support]: "
labels: ["support", "triage"]
assignees: []
body:
- type: textarea
id: description
@@ -14,7 +11,7 @@ body:
id: version
attributes:
label: Version
description: Visible on the Debug page in the Web UI
description: Visible on the System page in the Web UI
validations:
required: true
- type: textarea

View File

@@ -1,8 +1,5 @@
name: General Support Request
description: General support request for Frigate
title: "[Support]: "
labels: ["support", "triage"]
assignees: []
body:
- type: textarea
id: description
@@ -14,7 +11,7 @@ body:
id: version
attributes:
label: Version
description: Visible on the Debug page in the Web UI
description: Visible on the System page in the Web UI
validations:
required: true
- type: textarea

View File

@@ -1,8 +1,5 @@
name: Hardware Acceleration Support Request
description: Support for setting up GPU hardware acceleration in Frigate
title: "[HW Accel Support]: "
labels: ["support", "triage"]
assignees: []
body:
- type: textarea
id: description
@@ -14,7 +11,7 @@ body:
id: version
attributes:
label: Version
description: Visible on the Debug page in the Web UI
description: Visible on the System page in the Web UI
validations:
required: true
- type: textarea

View File

@@ -0,0 +1,9 @@
title: "[Question]: "
labels: ["question"]
body:
- type: textarea
id: description
attributes:
label: "What is your question:"
validations:
required: true

View File

@@ -1 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Frigate Support
url: https://github.com/blakeblackshear/frigate/discussions/new/choose
about: Get support for setting up or troubelshooting Frigate.

View File

@@ -11,11 +11,22 @@ outputs:
runs:
using: "composite"
steps:
- name: Remove unnecessary files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
# Stop docker so we can mount more space at /var/lib/docker
- name: Stop docker
run: sudo systemctl stop docker
shell: bash
# This creates a virtual volume at /var/lib/docker to maximize the size
# As of 2/14/2024, this results in 97G for docker images
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
build-mount-path: '/var/lib/docker'
- name: Start docker
run: sudo systemctl start docker
shell: bash
- id: lowercaseRepo
uses: ASzc/change-string-case-action@v5

View File

@@ -18,6 +18,12 @@ updates:
interval: daily
open-pull-requests-limit: 10
target-branch: dev
- package-ecosystem: "pip"
directory: "/docker/tensorrt"
schedule:
interval: daily
open-pull-requests-limit: 10
target-branch: dev
- package-ecosystem: "npm"
directory: "/web"
schedule:
@@ -28,5 +34,7 @@ updates:
directory: "/docs"
schedule:
interval: daily
allow:
- dependency-name: "@docusaurus/*"
open-pull-requests-limit: 10
target-branch: dev

View File

@@ -37,16 +37,6 @@ jobs:
target: frigate
tags: ${{ steps.setup.outputs.image-name }}-amd64
cache-from: type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64
- name: Build and push TensorRT (x86 GPU)
uses: docker/bake-action@v4
with:
push: true
targets: tensorrt
files: docker/tensorrt/trt.hcl
set: |
tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64,mode=max
arm64_build:
runs-on: ubuntu-latest
name: ARM Build
@@ -79,6 +69,15 @@ jobs:
rpi.tags=${{ steps.setup.outputs.image-name }}-rpi
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64,mode=max
- name: Build and push Rockchip build
uses: docker/bake-action@v3
with:
push: true
targets: rk
files: docker/rockchip/rk.hcl
set: |
rk.tags=${{ steps.setup.outputs.image-name }}-rk
*.cache-from=type=gha
jetson_jp4_build:
runs-on: ubuntu-latest
name: Jetson Jetpack 4
@@ -131,6 +130,82 @@ jobs:
tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt-jp5
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-jp5
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-jp5,mode=max
amd64_extra_builds:
runs-on: ubuntu-latest
name: AMD64 Extra Build
needs:
- amd64_build
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up QEMU and Buildx
id: setup
uses: ./.github/actions/setup
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push TensorRT (x86 GPU)
env:
COMPUTE_LEVEL: "50 60 70 80 90"
uses: docker/bake-action@v4
with:
push: true
targets: tensorrt
files: docker/tensorrt/trt.hcl
set: |
tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64,mode=max
#- name: AMD/ROCm general build
# env:
# AMDGPU: gfx
# HSA_OVERRIDE: 0
# uses: docker/bake-action@v3
# with:
# push: true
# targets: rocm
# files: docker/rocm/rocm.hcl
# set: |
# rocm.tags=${{ steps.setup.outputs.image-name }}-rocm
# *.cache-from=type=gha
#- name: AMD/ROCm gfx900
# env:
# AMDGPU: gfx900
# HSA_OVERRIDE: 1
# HSA_OVERRIDE_GFX_VERSION: 9.0.0
# uses: docker/bake-action@v3
# with:
# push: true
# targets: rocm
# files: docker/rocm/rocm.hcl
# set: |
# rocm.tags=${{ steps.setup.outputs.image-name }}-rocm-gfx900
# *.cache-from=type=gha
#- name: AMD/ROCm gfx1030
# env:
# AMDGPU: gfx1030
# HSA_OVERRIDE: 1
# HSA_OVERRIDE_GFX_VERSION: 10.3.0
# uses: docker/bake-action@v3
# with:
# push: true
# targets: rocm
# files: docker/rocm/rocm.hcl
# set: |
# rocm.tags=${{ steps.setup.outputs.image-name }}-rocm-gfx1030
# *.cache-from=type=gha
#- name: AMD/ROCm gfx1100
# env:
# AMDGPU: gfx1100
# HSA_OVERRIDE: 1
# HSA_OVERRIDE_GFX_VERSION: 11.0.0
# uses: docker/bake-action@v3
# with:
# push: true
# targets: rocm
# files: docker/rocm/rocm.hcl
# set: |
# rocm.tags=${{ steps.setup.outputs.image-name }}-rocm-gfx1100
# *.cache-from=type=gha
# The majority of users running arm64 are rpi users, so the rpi
# build should be the primary arm64 image
assemble_default_build:
@@ -141,20 +216,20 @@ jobs:
- arm64_build
steps:
- id: lowercaseRepo
uses: ASzc/change-string-case-action@v5
uses: ASzc/change-string-case-action@v6
with:
string: ${{ github.repository }}
- name: Log in to the Container registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create short sha
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
- uses: int128/docker-manifest-create-action@v1
- uses: int128/docker-manifest-create-action@v2
with:
tags: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}
suffixes: |
-amd64
-rpi
sources: |
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-amd64
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-rpi

View File

@@ -11,7 +11,7 @@ jobs:
steps:
- name: Get Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
uses: dependabot/fetch-metadata@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge for Dependabot PRs

View File

@@ -51,12 +51,12 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@master
with:
node-version: 16.x
node-version: 20.x
- run: npm install
working-directory: ./web
- name: Test
run: npm run test
working-directory: ./web
# - name: Test
# run: npm run test
# working-directory: ./web
python_checks:
runs-on: ubuntu-latest
@@ -65,20 +65,17 @@ jobs:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v4.7.1
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Install requirements
run: |
python3 -m pip install -U pip
python3 -m pip install -r docker/main/requirements-dev.txt
- name: Check black
- name: Check formatting
run: |
black --check --diff frigate migrations docker *.py
- name: Check isort
run: |
isort --check --diff frigate migrations docker *.py
- name: Check ruff
ruff format --check --diff frigate migrations docker *.py
- name: Check lint
run: |
ruff check frigate migrations docker *.py

37
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: On release
on:
workflow_dispatch:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: lowercaseRepo
uses: ASzc/change-string-case-action@v6
with:
string: ${{ github.repository }}
- name: Log in to the Container registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create tag variables
run: |
BRANCH=$([[ "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "master" || echo "dev")
echo "BASE=ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}" >> $GITHUB_ENV
echo "BUILD_TAG=${BRANCH}-${GITHUB_SHA::7}" >> $GITHUB_ENV
echo "CLEAN_VERSION=$(echo ${GITHUB_REF##*/} | tr '[:upper:]' '[:lower:]' | sed 's/^[v]//')" >> $GITHUB_ENV
- name: Tag and push the main image
run: |
VERSION_TAG=${BASE}:${CLEAN_VERSION}
PULL_TAG=${BASE}:${BUILD_TAG}
docker run --rm -v $HOME/.docker/config.json:/config.json quay.io/skopeo/stable:latest copy --authfile /config.json --multi-arch all docker://${PULL_TAG} docker://${VERSION_TAG}
for variant in standard-arm64 tensorrt tensorrt-jp4 tensorrt-jp5 rk; do
docker run --rm -v $HOME/.docker/config.json:/config.json quay.io/skopeo/stable:latest copy --authfile /config.json --multi-arch all docker://${PULL_TAG}-${variant} docker://${VERSION_TAG}-${variant}
done

View File

@@ -24,3 +24,18 @@ jobs:
operations-per-run: 120
- name: Print outputs
run: echo ${{ join(steps.stale.outputs.*, ',') }}
clean_ghcr:
name: Delete outdated dev container images
runs-on: ubuntu-latest
steps:
- name: Delete old images
uses: snok/container-retention-policy@v2
with:
image-names: dev-*
cut-off: 60 days ago UTC
keep-at-least: 5
account-type: personal
token: ${{ secrets.GITHUB_TOKEN }}
token-type: github-token

1
.gitignore vendored
View File

@@ -8,7 +8,6 @@ config/*
!config/*.example
models
*.mp4
*.ts
*.db
*.csv
frigate/version.py

View File

@@ -2,3 +2,5 @@
/docker/tensorrt/ @madsciencetist @NateMeyer
/docker/tensorrt/*arm64* @madsciencetist
/docker/tensorrt/*jetson* @madsciencetist
/docker/rockchip/ @MarcA711
/docker/rocm/ @harakas

View File

@@ -1,7 +1,7 @@
default_target: local
COMMIT_HASH := $(shell git log -1 --pretty=format:"%h"|tail -1)
VERSION = 0.13.0
VERSION = 0.14.0
IMAGE_REPO ?= ghcr.io/blakeblackshear/frigate
GITHUB_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
CURRENT_UID := $(shell id -u)

21
cspell.json Normal file
View File

@@ -0,0 +1,21 @@
{
"version": "0.2",
"ignorePaths": [
"Dockerfile",
"Dockerfile.*",
"CMakeLists.txt",
"*.db",
"node_modules",
"__pycache__",
"dist"
],
"language": "en",
"dictionaryDefinitions": [
{
"name": "frigate-dictionary",
"path": "./.cspell/frigate-dictionary.txt",
"addWords": true
}
],
"dictionaries": ["frigate-dictionary"]
}

View File

@@ -14,13 +14,14 @@ services:
dockerfile: docker/main/Dockerfile
# Use target devcontainer-trt for TensorRT dev
target: devcontainer
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
## Uncomment this block for nvidia gpu support
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
environment:
YOLO_MODELS: yolov7-320
devices:

View File

@@ -33,7 +33,7 @@ RUN --mount=type=tmpfs,target=/tmp --mount=type=tmpfs,target=/var/cache/apt \
FROM scratch AS go2rtc
ARG TARGETARCH
WORKDIR /rootfs/usr/local/go2rtc/bin
ADD --link --chmod=755 "https://github.com/AlexxIT/go2rtc/releases/download/v1.8.1/go2rtc_linux_${TARGETARCH}" go2rtc
ADD --link --chmod=755 "https://github.com/AlexxIT/go2rtc/releases/download/v1.9.2/go2rtc_linux_${TARGETARCH}" go2rtc
####
@@ -51,7 +51,7 @@ ARG DEBIAN_FRONTEND
# Install OpenVino Runtime and Dev library
COPY docker/main/requirements-ov.txt /requirements-ov.txt
RUN apt-get -qq update \
&& apt-get -qq install -y wget python3 python3-distutils \
&& apt-get -qq install -y wget python3 python3-dev python3-distutils gcc pkg-config libhdf5-dev \
&& wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
&& python3 get-pip.py "pip" \
&& pip install -r /requirements-ov.txt
@@ -191,12 +191,13 @@ COPY --from=deps-rootfs / /
RUN ldconfig
EXPOSE 5000
EXPOSE 1935
EXPOSE 8554
EXPOSE 8555/tcp 8555/udp
# Configure logging to prepend timestamps, log to stdout, keep 0 archives and rotate on 10MB
ENV S6_LOGGING_SCRIPT="T 1 n0 s10000000 T"
# Do not fail on long-running download scripts
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
ENTRYPOINT ["/init"]
CMD []
@@ -215,13 +216,13 @@ COPY docker/main/fake_frigate_run /etc/s6-overlay/s6-rc.d/frigate/run
RUN mkdir -p /opt/frigate \
&& ln -svf /workspace/frigate/frigate /opt/frigate/frigate
# Install Node 16
RUN apt-get update \
&& apt-get install wget -y \
&& wget -qO- https://deb.nodesource.com/setup_16.x | bash - \
&& apt-get install -y nodejs \
# Install Node 20
RUN curl -SLO https://deb.nodesource.com/nsolid_setup_deb.sh && \
chmod 500 nsolid_setup_deb.sh && \
./nsolid_setup_deb.sh 20 && \
apt-get install nodejs -y \
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g npm@9
&& npm install -g npm@10
WORKDIR /workspace/frigate
@@ -232,12 +233,14 @@ RUN apt-get update \
RUN --mount=type=bind,source=./docker/main/requirements-dev.txt,target=/workspace/frigate/requirements-dev.txt \
pip3 install -r requirements-dev.txt
HEALTHCHECK NONE
CMD ["sleep", "infinity"]
# Frigate web build
# This should be architecture agnostic, so speed up the build on multiarch by not using QEMU.
FROM --platform=$BUILDPLATFORM node:16 AS web-build
FROM --platform=$BUILDPLATFORM node:20 AS web-build
WORKDIR /work
COPY web/package.json web/package-lock.json ./

View File

@@ -2,10 +2,11 @@
set -euxo pipefail
NGINX_VERSION="1.25.2"
NGINX_VERSION="1.25.3"
VOD_MODULE_VERSION="1.31"
SECURE_TOKEN_MODULE_VERSION="1.5"
RTMP_MODULE_VERSION="1.2.2"
SET_MISC_MODULE_VERSION="v0.33"
NGX_DEVEL_KIT_VERSION="v0.3.3"
cp /etc/apt/sources.list /etc/apt/sources.list.d/sources-src.list
sed -i 's|deb http|deb-src http|g' /etc/apt/sources.list.d/sources-src.list
@@ -49,10 +50,16 @@ mkdir /tmp/nginx-secure-token-module
wget https://github.com/kaltura/nginx-secure-token-module/archive/refs/tags/${SECURE_TOKEN_MODULE_VERSION}.tar.gz
tar -zxf ${SECURE_TOKEN_MODULE_VERSION}.tar.gz -C /tmp/nginx-secure-token-module --strip-components=1
rm ${SECURE_TOKEN_MODULE_VERSION}.tar.gz
mkdir /tmp/nginx-rtmp-module
wget -nv https://github.com/arut/nginx-rtmp-module/archive/refs/tags/v${RTMP_MODULE_VERSION}.tar.gz
tar -zxf v${RTMP_MODULE_VERSION}.tar.gz -C /tmp/nginx-rtmp-module --strip-components=1
rm v${RTMP_MODULE_VERSION}.tar.gz
mkdir /tmp/ngx_devel_kit
wget https://github.com/vision5/ngx_devel_kit/archive/refs/tags/${NGX_DEVEL_KIT_VERSION}.tar.gz
tar -zxf ${NGX_DEVEL_KIT_VERSION}.tar.gz -C /tmp/ngx_devel_kit --strip-components=1
rm ${NGX_DEVEL_KIT_VERSION}.tar.gz
mkdir /tmp/nginx-set-misc-module
wget https://github.com/openresty/set-misc-nginx-module/archive/refs/tags/${SET_MISC_MODULE_VERSION}.tar.gz
tar -zxf ${SET_MISC_MODULE_VERSION}.tar.gz -C /tmp/nginx-set-misc-module --strip-components=1
rm ${SET_MISC_MODULE_VERSION}.tar.gz
cd /tmp/nginx
@@ -60,10 +67,13 @@ cd /tmp/nginx
--with-file-aio \
--with-http_sub_module \
--with-http_ssl_module \
--with-http_auth_request_module \
--with-http_realip_module \
--with-threads \
--add-module=../ngx_devel_kit \
--add-module=../nginx-set-misc-module \
--add-module=../nginx-vod-module \
--add-module=../nginx-secure-token-module \
--add-module=../nginx-rtmp-module \
--with-cc-opt="-O3 -Wno-error=implicit-fallthrough"
make CC="ccache gcc" -j$(nproc) && make install

View File

@@ -1,3 +1 @@
black == 23.10.*
isort
ruff

View File

@@ -1,28 +1,35 @@
click == 8.1.*
Flask == 2.3.*
Flask == 3.0.*
Flask_Limiter == 3.7.*
imutils == 0.5.*
matplotlib == 3.7.*
joserfc == 0.10.*
markupsafe == 2.1.*
matplotlib == 3.8.*
mypy == 1.6.1
numpy == 1.23.*
numpy == 1.26.*
onvif_zeep == 0.2.12
opencv-python-headless == 4.7.0.*
paho-mqtt == 1.6.*
opencv-python-headless == 4.9.0.*
paho-mqtt == 2.1.*
pandas == 2.2.*
peewee == 3.17.*
peewee_migrate == 1.12.*
psutil == 5.9.*
pydantic == 1.10.*
pydantic == 2.7.*
git+https://github.com/fbcotter/py3nvml#egg=py3nvml
PyYAML == 6.0.*
pytz == 2023.3
ruamel.yaml == 0.17.*
tzlocal == 5.1
pytz == 2024.1
pyzmq == 26.0.*
ruamel.yaml == 0.18.*
tzlocal == 5.2
types-PyYAML == 6.0.*
requests == 2.31.*
types-requests == 2.31.*
scipy == 1.11.*
requests == 2.32.*
types-requests == 2.32.*
scipy == 1.13.*
norfair == 2.2.*
setproctitle == 1.3.*
ws4py == 0.5.*
unidecode == 1.3.*
onnxruntime == 1.16.*
# Openvino Library - Custom built with MYRIAD support
openvino @ https://github.com/NateMeyer/openvino-wheels/releases/download/multi-arch_2022.3.1/openvino-2022.3.1-1-cp39-cp39-manylinux_2_31_x86_64.whl; platform_machine == 'x86_64'
openvino @ https://github.com/NateMeyer/openvino-wheels/releases/download/multi-arch_2022.3.1/openvino-2022.3.1-1-cp39-cp39-linux_aarch64.whl; platform_machine == 'aarch64'

View File

@@ -45,8 +45,13 @@ function get_ip_and_port_from_supervisor() {
export LIBAVFORMAT_VERSION_MAJOR=$(ffmpeg -version | grep -Po 'libavformat\W+\K\d+')
if [[ -f "/dev/shm/go2rtc.yaml" ]]; then
echo "[INFO] Removing stale config from last run..."
rm /dev/shm/go2rtc.yaml
fi
if [[ ! -f "/dev/shm/go2rtc.yaml" ]]; then
echo "[INFO] Preparing go2rtc config..."
echo "[INFO] Preparing new go2rtc config..."
if [[ -n "${SUPERVISOR_TOKEN:-}" ]]; then
# Running as a Home Assistant add-on, infer the IP address and port
@@ -54,6 +59,8 @@ if [[ ! -f "/dev/shm/go2rtc.yaml" ]]; then
fi
python3 /usr/local/go2rtc/create_config.py
else
echo "[WARNING] Unable to remove existing go2rtc config. Changes made to your frigate config file may not be recognized. Please remove the /dev/shm/go2rtc.yaml from your docker host manually."
fi
readonly config_path="/config"

View File

@@ -3,6 +3,7 @@
import json
import os
import sys
from pathlib import Path
import yaml
@@ -16,6 +17,14 @@ sys.path.remove("/opt/frigate")
FRIGATE_ENV_VARS = {k: v for k, v in os.environ.items() if k.startswith("FRIGATE_")}
# read docker secret files as env vars too
if os.path.isdir("/run/secrets"):
for secret_file in os.listdir("/run/secrets"):
if secret_file.startswith("FRIGATE_"):
FRIGATE_ENV_VARS[secret_file] = Path(
os.path.join("/run/secrets", secret_file)
).read_text()
config_file = os.environ.get("CONFIG_FILE", "/config/config.yml")
# Check if we can use .yaml instead of .yml
@@ -23,13 +32,16 @@ config_file_yaml = config_file.replace(".yml", ".yaml")
if os.path.isfile(config_file_yaml):
config_file = config_file_yaml
with open(config_file) as f:
raw_config = f.read()
try:
with open(config_file) as f:
raw_config = f.read()
if config_file.endswith((".yaml", ".yml")):
config: dict[str, any] = yaml.safe_load(raw_config)
elif config_file.endswith(".json"):
config: dict[str, any] = json.loads(raw_config)
if config_file.endswith((".yaml", ".yml")):
config: dict[str, any] = yaml.safe_load(raw_config)
elif config_file.endswith(".json"):
config: dict[str, any] = json.loads(raw_config)
except FileNotFoundError:
config: dict[str, any] = {}
go2rtc_config: dict[str, any] = config.get("go2rtc", {})
@@ -49,7 +61,15 @@ if go2rtc_config.get("log") is None:
elif go2rtc_config["log"].get("format") is None:
go2rtc_config["log"]["format"] = "text"
if not go2rtc_config.get("webrtc", {}).get("candidates", []):
# ensure there is a default webrtc config
if not go2rtc_config.get("webrtc"):
go2rtc_config["webrtc"] = {}
# go2rtc should listen on 8555 tcp & udp by default
if not go2rtc_config["webrtc"].get("listen"):
go2rtc_config["webrtc"]["listen"] = ":8555"
if not go2rtc_config["webrtc"].get("candidates", []):
default_candidates = []
# use internal candidate if it was discovered when running through the add-on
internal_candidate = os.environ.get(
@@ -92,9 +112,9 @@ if int(os.environ["LIBAVFORMAT_VERSION_MAJOR"]) < 59:
"rtsp": "-fflags nobuffer -flags low_delay -stimeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i {input}"
}
elif go2rtc_config["ffmpeg"].get("rtsp") is None:
go2rtc_config["ffmpeg"][
"rtsp"
] = "-fflags nobuffer -flags low_delay -stimeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i {input}"
go2rtc_config["ffmpeg"]["rtsp"] = (
"-fflags nobuffer -flags low_delay -stimeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i {input}"
)
for name in go2rtc_config.get("streams", {}):
stream = go2rtc_config["streams"][name]

View File

@@ -0,0 +1,43 @@
set $upstream_auth http://127.0.0.1:5001/auth;
## Virtual endpoint created by nginx to forward auth requests.
location /auth {
## Essential Proxy Configuration
internal;
proxy_pass $upstream_auth;
## Headers
# First strip out all the request headers
# Note: This is important to ensure that upgrade requests for secure
# websockets dont cause the backend to fail
proxy_pass_request_headers off;
# Pass info about the request
proxy_set_header X-Original-Method $request_method;
proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
proxy_set_header X-Server-Port $server_port;
proxy_set_header Content-Length "";
# Pass along auth related info
proxy_set_header Authorization $http_authorization;
proxy_set_header Cookie $http_cookie;
proxy_set_header X-CSRF-TOKEN "1";
# include headers from common auth proxies
include proxy_trusted_headers.conf;
## Basic Proxy Configuration
proxy_pass_request_body off;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; # Timeout if the real server is dead
proxy_redirect http:// $scheme://;
proxy_http_version 1.1;
proxy_cache_bypass $cookie_session;
proxy_no_cache $cookie_session;
proxy_buffers 4 32k;
client_body_buffer_size 128k;
## Advanced Proxy Configuration
send_timeout 5m;
proxy_read_timeout 240;
proxy_send_timeout 240;
proxy_connect_timeout 240;
}

View File

@@ -0,0 +1,22 @@
## Send a subrequest to verify if the user is authenticated and has permission to access the resource.
auth_request /auth;
## Save the upstream metadata response headers from Authelia to variables.
auth_request_set $user $upstream_http_remote_user;
auth_request_set $groups $upstream_http_remote_groups;
auth_request_set $name $upstream_http_remote_name;
auth_request_set $email $upstream_http_remote_email;
## Inject the metadata response headers from the variables into the request made to the backend.
proxy_set_header Remote-User $user;
proxy_set_header Remote-Groups $groups;
proxy_set_header Remote-Email $email;
proxy_set_header Remote-Name $name;
## Refresh the cookie as needed
auth_request_set $auth_cookie $upstream_http_set_cookie;
add_header Set-Cookie $auth_cookie;
## Pass the location header back up if it exists
auth_request_set $redirection_url $upstream_http_location;
add_header Location $redirection_url;

View File

@@ -10,6 +10,8 @@ events {
}
http {
map_hash_bucket_size 256;
include mime.types;
default_type application/octet-stream;
@@ -32,6 +34,13 @@ http {
gzip_proxied no-cache no-store private expired auth;
gzip_vary on;
proxy_cache_path /dev/shm/nginx_cache levels=1:2 keys_zone=api_cache:10m max_size=10m inactive=1m use_temp_path=off;
map $sent_http_content_type $should_not_cache {
'application/json' 0;
default 1;
}
upstream frigate_api {
server 127.0.0.1:5001;
keepalive 1024;
@@ -53,7 +62,10 @@ http {
}
server {
listen 5000;
# intended for external traffic, protected by auth
listen [::]:8080 ipv6only=off;
# intended for internal traffic, not protected by auth
listen [::]:5000 ipv6only=off;
# vod settings
vod_base_url '';
@@ -86,7 +98,10 @@ http {
gzip on;
gzip_types application/vnd.apple.mpegurl;
include auth_location.conf;
location /vod/ {
include auth_request.conf;
aio threads;
vod hls;
@@ -98,6 +113,7 @@ http {
}
location /stream/ {
include auth_request.conf;
add_header Cache-Control "no-store";
expires off;
@@ -112,7 +128,7 @@ http {
}
location /clips/ {
include auth_request.conf;
types {
video/mp4 mp4;
image/jpeg jpg;
@@ -128,6 +144,7 @@ http {
}
location /recordings/ {
include auth_request.conf;
types {
video/mp4 mp4;
}
@@ -138,6 +155,7 @@ http {
}
location /exports/ {
include auth_request.conf;
types {
video/mp4 mp4;
}
@@ -148,59 +166,121 @@ http {
}
location /ws {
include auth_request.conf;
proxy_pass http://mqtt_ws/;
include proxy.conf;
}
location /live/jsmpeg/ {
include auth_request.conf;
proxy_pass http://jsmpeg/;
include proxy.conf;
}
location /live/mse/ {
proxy_pass http://go2rtc/;
# frigate lovelace card uses this path
location /live/mse/api/ws {
include auth_request.conf;
limit_except GET {
deny all;
}
proxy_pass http://go2rtc/api/ws;
include proxy.conf;
}
location /live/webrtc/ {
proxy_pass http://go2rtc/;
location /live/webrtc/api/ws {
include auth_request.conf;
limit_except GET {
deny all;
}
proxy_pass http://go2rtc/api/ws;
include proxy.conf;
}
location ~* /api/go2rtc([/]?.*)$ {
proxy_pass http://go2rtc;
rewrite ^/api/go2rtc(.*)$ /api$1 break;
# pass through go2rtc player
location /live/webrtc/webrtc.html {
include auth_request.conf;
limit_except GET {
deny all;
}
proxy_pass http://go2rtc/webrtc.html;
include proxy.conf;
}
location ~* /api/.*\.(jpg|jpeg|png)$ {
# frontend uses this to fetch the version
location /api/go2rtc/api {
include auth_request.conf;
limit_except GET {
deny all;
}
proxy_pass http://go2rtc/api;
include proxy.conf;
}
# integration uses this to add webrtc candidate
location /api/go2rtc/webrtc {
include auth_request.conf;
limit_except POST {
deny all;
}
proxy_pass http://go2rtc/api/webrtc;
include proxy.conf;
}
location ~* /api/.*\.(jpg|jpeg|png|webp|gif)$ {
include auth_request.conf;
rewrite ^/api/(.*)$ $1 break;
proxy_pass http://frigate_api;
include proxy.conf;
}
location /api/ {
include auth_request.conf;
add_header Cache-Control "no-store";
expires off;
proxy_pass http://frigate_api/;
include proxy.conf;
proxy_cache api_cache;
proxy_cache_lock on;
proxy_cache_use_stale updating;
proxy_cache_valid 200 5s;
proxy_cache_bypass $http_x_cache_bypass;
proxy_no_cache $should_not_cache;
add_header X-Cache-Status $upstream_cache_status;
location /api/vod/ {
include auth_request.conf;
proxy_pass http://frigate_api/vod/;
include proxy.conf;
proxy_cache off;
}
location /api/login {
auth_request off;
rewrite ^/api(/.*)$ $1 break;
proxy_pass http://frigate_api;
include proxy.conf;
}
location /api/stats {
include auth_request.conf;
access_log off;
rewrite ^/api/(.*)$ $1 break;
rewrite ^/api(/.*)$ $1 break;
proxy_pass http://frigate_api;
include proxy.conf;
}
location /api/version {
include auth_request.conf;
access_log off;
rewrite ^/api/(.*)$ $1 break;
rewrite ^/api(/.*)$ $1 break;
proxy_pass http://frigate_api;
include proxy.conf;
}
}
location / {
# do not require auth for static assets
add_header Cache-Control "no-store";
expires off;
@@ -222,22 +302,7 @@ http {
sub_filter_once off;
root /opt/frigate/web;
try_files $uri $uri/ /index.html;
try_files $uri $uri.html $uri/ /index.html;
}
}
}
rtmp {
server {
listen 1935;
chunk_size 4096;
allow publish 127.0.0.1;
deny publish all;
allow play all;
application live {
live on;
record off;
meta copy;
}
}
}

View File

@@ -1,4 +1,26 @@
proxy_http_version 1.1;
## Headers
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-URI $request_uri;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
## Basic Proxy Configuration
client_body_buffer_size 128k;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; ## Timeout if the real server is dead.
proxy_redirect http:// $scheme://;
proxy_http_version 1.1;
proxy_cache_bypass $cookie_session;
proxy_no_cache $cookie_session;
proxy_buffers 64 256k;
## Advanced Proxy Configuration
send_timeout 5m;
proxy_read_timeout 360;
proxy_send_timeout 360;
proxy_connect_timeout 360;

View File

@@ -0,0 +1,22 @@
# these headers will be copied to the /auth request and are available
# to be mapped in the config to Frigate's remote-user header
# List of headers sent by common authentication proxies:
# - Authelia
# - Traefik forward auth
# - oauth2_proxy
# - Authentik
proxy_set_header Remote-User $http_remote_user;
proxy_set_header Remote-Groups $http_remote_groups;
proxy_set_header Remote-Email $http_remote_email;
proxy_set_header Remote-Name $http_remote_name;
proxy_set_header X-Forwarded-User $http_x_forwarded_user;
proxy_set_header X-Forwarded-Groups $http_x_forwarded_groups;
proxy_set_header X-Forwarded-Email $http_x_forwarded_email;
proxy_set_header X-Forwarded-Preferred-Username $http_x_forwarded_preferred_username;
proxy_set_header X-authentik-username $http_x_authentik_username;
proxy_set_header X-authentik-groups $http_x_authentik_groups;
proxy_set_header X-authentik-email $http_x_authentik_email;
proxy_set_header X-authentik-name $http_x_authentik_name;
proxy_set_header X-authentik-uid $http_x_authentik_uid;

View File

@@ -0,0 +1,26 @@
# syntax=docker/dockerfile:1.6
# https://askubuntu.com/questions/972516/debian-frontend-environment-variable
ARG DEBIAN_FRONTEND=noninteractive
FROM wheels as rk-wheels
COPY docker/main/requirements-wheels.txt /requirements-wheels.txt
COPY docker/rockchip/requirements-wheels-rk.txt /requirements-wheels-rk.txt
RUN sed -i "/https:\/\//d" /requirements-wheels.txt
RUN pip3 wheel --wheel-dir=/rk-wheels -c /requirements-wheels.txt -r /requirements-wheels-rk.txt
FROM deps AS rk-frigate
ARG TARGETARCH
RUN --mount=type=bind,from=rk-wheels,source=/rk-wheels,target=/deps/rk-wheels \
pip3 install -U /deps/rk-wheels/*.whl
WORKDIR /opt/frigate/
COPY --from=rootfs / /
ADD https://github.com/MarcA711/rknn-toolkit2/releases/download/v2.0.0/librknnrt.so /usr/lib/
RUN rm -rf /usr/lib/btbn-ffmpeg/bin/ffmpeg
RUN rm -rf /usr/lib/btbn-ffmpeg/bin/ffprobe
ADD --chmod=111 https://github.com/MarcA711/Rockchip-FFmpeg-Builds/releases/download/6.1-3/ffmpeg /usr/lib/btbn-ffmpeg/bin/
ADD --chmod=111 https://github.com/MarcA711/Rockchip-FFmpeg-Builds/releases/download/6.1-3/ffprobe /usr/lib/btbn-ffmpeg/bin/

View File

@@ -0,0 +1 @@
rknn-toolkit-lite2 @ https://github.com/MarcA711/rknn-toolkit2/releases/download/v2.0.0/rknn_toolkit_lite2-2.0.0b0-cp39-cp39-linux_aarch64.whl

27
docker/rockchip/rk.hcl Normal file
View File

@@ -0,0 +1,27 @@
target wheels {
dockerfile = "docker/main/Dockerfile"
platforms = ["linux/arm64"]
target = "wheels"
}
target deps {
dockerfile = "docker/main/Dockerfile"
platforms = ["linux/arm64"]
target = "deps"
}
target rootfs {
dockerfile = "docker/main/Dockerfile"
platforms = ["linux/arm64"]
target = "rootfs"
}
target rk {
dockerfile = "docker/rockchip/Dockerfile"
contexts = {
wheels = "target:wheels",
deps = "target:deps",
rootfs = "target:rootfs"
}
platforms = ["linux/arm64"]
}

10
docker/rockchip/rk.mk Normal file
View File

@@ -0,0 +1,10 @@
BOARDS += rk
local-rk: version
docker buildx bake --load --file=docker/rockchip/rk.hcl --set rk.tags=frigate:latest-rk rk
build-rk: version
docker buildx bake --file=docker/rockchip/rk.hcl --set rk.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-rk rk
push-rk: build-rk
docker buildx bake --push --file=docker/rockchip/rk.hcl --set rk.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-rk rk

106
docker/rocm/Dockerfile Normal file
View File

@@ -0,0 +1,106 @@
# syntax=docker/dockerfile:1.4
# https://askubuntu.com/questions/972516/debian-frontend-environment-variable
ARG DEBIAN_FRONTEND=noninteractive
ARG ROCM=5.7.3
ARG AMDGPU=gfx900
ARG HSA_OVERRIDE_GFX_VERSION
ARG HSA_OVERRIDE
#######################################################################
FROM ubuntu:focal as rocm
ARG ROCM
RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install gnupg wget
RUN mkdir --parents --mode=0755 /etc/apt/keyrings
RUN wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | tee /etc/apt/keyrings/rocm.gpg > /dev/null
COPY docker/rocm/rocm.list /etc/apt/sources.list.d/
COPY docker/rocm/rocm-pin-600 /etc/apt/preferences.d/
RUN apt-get update
RUN apt-get -y install --no-install-recommends migraphx
RUN apt-get -y install --no-install-recommends migraphx-dev
RUN mkdir -p /opt/rocm-dist/opt/rocm-$ROCM/lib
RUN cd /opt/rocm-$ROCM/lib && cp -dpr libMIOpen*.so* libamd*.so* libhip*.so* libhsa*.so* libmigraphx*.so* librocm*.so* librocblas*.so* /opt/rocm-dist/opt/rocm-$ROCM/lib/
RUN cd /opt/rocm-dist/opt/ && ln -s rocm-$ROCM rocm
RUN mkdir -p /opt/rocm-dist/etc/ld.so.conf.d/
RUN echo /opt/rocm/lib|tee /opt/rocm-dist/etc/ld.so.conf.d/rocm.conf
#######################################################################
FROM --platform=linux/amd64 debian:11 as debian-base
RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install --no-install-recommends libelf1 libdrm2 libdrm-amdgpu1 libnuma1 kmod
RUN apt-get -y install python3
#######################################################################
# ROCm does not come with migraphx wrappers for python 3.9, so we build it here
FROM debian-base as debian-build
ARG ROCM
COPY --from=rocm /opt/rocm-$ROCM /opt/rocm-$ROCM
RUN ln -s /opt/rocm-$ROCM /opt/rocm
RUN apt-get -y install g++ cmake
RUN apt-get -y install python3-pybind11 python3.9-distutils python3-dev
WORKDIR /opt/build
COPY docker/rocm/migraphx .
RUN mkdir build && cd build && cmake .. && make install
#######################################################################
FROM deps AS deps-prelim
# need this to install libnuma1
RUN apt-get update
# no ugprade?!?!
RUN apt-get -y install libnuma1
WORKDIR /opt/frigate/
COPY --from=rootfs / /
COPY docker/rocm/rootfs/ /
#######################################################################
FROM scratch AS rocm-dist
ARG ROCM
ARG AMDGPU
COPY --from=rocm /opt/rocm-$ROCM/bin/rocminfo /opt/rocm-$ROCM/bin/migraphx-driver /opt/rocm-$ROCM/bin/
COPY --from=rocm /opt/rocm-$ROCM/share/miopen/db/*$AMDGPU* /opt/rocm-$ROCM/share/miopen/db/
COPY --from=rocm /opt/rocm-$ROCM/lib/rocblas/library/*$AMDGPU* /opt/rocm-$ROCM/lib/rocblas/library/
COPY --from=rocm /opt/rocm-dist/ /
COPY --from=debian-build /opt/rocm/lib/migraphx.cpython-39-x86_64-linux-gnu.so /opt/rocm-$ROCM/lib/
#######################################################################
FROM deps-prelim AS rocm-prelim-hsa-override0
ENV HSA_ENABLE_SDMA=0
COPY --from=rocm-dist / /
RUN ldconfig
#######################################################################
FROM rocm-prelim-hsa-override0 as rocm-prelim-hsa-override1
ARG HSA_OVERRIDE_GFX_VERSION
ENV HSA_OVERRIDE_GFX_VERSION=$HSA_OVERRIDE_GFX_VERSION
#######################################################################
FROM rocm-prelim-hsa-override$HSA_OVERRIDE as rocm-deps
# Request yolov8 download at startup
ENV DOWNLOAD_YOLOV8=1

View File

@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
project(migraphx_py)
include_directories(/opt/rocm/include)
find_package(pybind11 REQUIRED)
pybind11_add_module(migraphx migraphx_py.cpp)
target_link_libraries(migraphx PRIVATE /opt/rocm/lib/libmigraphx.so /opt/rocm/lib/libmigraphx_tf.so /opt/rocm/lib/libmigraphx_onnx.so)
install(TARGETS migraphx
COMPONENT python
LIBRARY DESTINATION /opt/rocm/lib
)

View File

@@ -0,0 +1,582 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <pybind11/numpy.h>
#include <migraphx/program.hpp>
#include <migraphx/instruction_ref.hpp>
#include <migraphx/operation.hpp>
#include <migraphx/quantization.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/ref/target.hpp>
#include <migraphx/stringutils.hpp>
#include <migraphx/tf.hpp>
#include <migraphx/onnx.hpp>
#include <migraphx/load_save.hpp>
#include <migraphx/register_target.hpp>
#include <migraphx/json.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/op/common.hpp>
#ifdef HAVE_GPU
#include <migraphx/gpu/hip.hpp>
#endif
using half = half_float::half;
namespace py = pybind11;
#ifdef __clang__
#define MIGRAPHX_PUSH_UNUSED_WARNING \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wused-but-marked-unused\"")
#define MIGRAPHX_POP_WARNING _Pragma("clang diagnostic pop")
#else
#define MIGRAPHX_PUSH_UNUSED_WARNING
#define MIGRAPHX_POP_WARNING
#endif
#define MIGRAPHX_PYBIND11_MODULE(...) \
MIGRAPHX_PUSH_UNUSED_WARNING \
PYBIND11_MODULE(__VA_ARGS__) \
MIGRAPHX_POP_WARNING
#define MIGRAPHX_PYTHON_GENERATE_SHAPE_ENUM(x, t) .value(#x, migraphx::shape::type_t::x)
namespace migraphx {
migraphx::value to_value(py::kwargs kwargs);
migraphx::value to_value(py::list lst);
template <class T, class F>
void visit_py(T x, F f)
{
if(py::isinstance<py::kwargs>(x))
{
f(to_value(x.template cast<py::kwargs>()));
}
else if(py::isinstance<py::list>(x))
{
f(to_value(x.template cast<py::list>()));
}
else if(py::isinstance<py::bool_>(x))
{
f(x.template cast<bool>());
}
else if(py::isinstance<py::int_>(x) or py::hasattr(x, "__index__"))
{
f(x.template cast<int>());
}
else if(py::isinstance<py::float_>(x))
{
f(x.template cast<float>());
}
else if(py::isinstance<py::str>(x))
{
f(x.template cast<std::string>());
}
else if(py::isinstance<migraphx::shape::dynamic_dimension>(x))
{
f(migraphx::to_value(x.template cast<migraphx::shape::dynamic_dimension>()));
}
else
{
MIGRAPHX_THROW("VISIT_PY: Unsupported data type!");
}
}
migraphx::value to_value(py::list lst)
{
migraphx::value v = migraphx::value::array{};
for(auto val : lst)
{
visit_py(val, [&](auto py_val) { v.push_back(py_val); });
}
return v;
}
migraphx::value to_value(py::kwargs kwargs)
{
migraphx::value v = migraphx::value::object{};
for(auto arg : kwargs)
{
auto&& key = py::str(arg.first);
auto&& val = arg.second;
visit_py(val, [&](auto py_val) { v[key] = py_val; });
}
return v;
}
} // namespace migraphx
namespace pybind11 {
namespace detail {
template <>
struct npy_format_descriptor<half>
{
static std::string format()
{
// following: https://docs.python.org/3/library/struct.html#format-characters
return "e";
}
static constexpr auto name() { return _("half"); }
};
} // namespace detail
} // namespace pybind11
template <class F>
void visit_type(const migraphx::shape& s, F f)
{
s.visit_type(f);
}
template <class T, class F>
void visit(const migraphx::raw_data<T>& x, F f)
{
x.visit(f);
}
template <class F>
void visit_types(F f)
{
migraphx::shape::visit_types(f);
}
template <class T>
py::buffer_info to_buffer_info(T& x)
{
migraphx::shape s = x.get_shape();
assert(s.type() != migraphx::shape::tuple_type);
if(s.dynamic())
MIGRAPHX_THROW("MIGRAPHX PYTHON: dynamic shape argument passed to to_buffer_info");
auto strides = s.strides();
std::transform(
strides.begin(), strides.end(), strides.begin(), [&](auto i) { return i * s.type_size(); });
py::buffer_info b;
visit_type(s, [&](auto as) {
// migraphx use int8_t data to store bool type, we need to
// explicitly specify the data type as bool for python
if(s.type() == migraphx::shape::bool_type)
{
b = py::buffer_info(x.data(),
as.size(),
py::format_descriptor<bool>::format(),
s.ndim(),
s.lens(),
strides);
}
else
{
b = py::buffer_info(x.data(),
as.size(),
py::format_descriptor<decltype(as())>::format(),
s.ndim(),
s.lens(),
strides);
}
});
return b;
}
migraphx::shape to_shape(const py::buffer_info& info)
{
migraphx::shape::type_t t;
std::size_t n = 0;
visit_types([&](auto as) {
if(info.format == py::format_descriptor<decltype(as())>::format() or
(info.format == "l" and py::format_descriptor<decltype(as())>::format() == "q") or
(info.format == "L" and py::format_descriptor<decltype(as())>::format() == "Q"))
{
t = as.type_enum();
n = sizeof(as());
}
else if(info.format == "?" and py::format_descriptor<decltype(as())>::format() == "b")
{
t = migraphx::shape::bool_type;
n = sizeof(bool);
}
});
if(n == 0)
{
MIGRAPHX_THROW("MIGRAPHX PYTHON: Unsupported data type " + info.format);
}
auto strides = info.strides;
std::transform(strides.begin(), strides.end(), strides.begin(), [&](auto i) -> std::size_t {
return n > 0 ? i / n : 0;
});
// scalar support
if(info.shape.empty())
{
return migraphx::shape{t};
}
else
{
return migraphx::shape{t, info.shape, strides};
}
}
MIGRAPHX_PYBIND11_MODULE(migraphx, m)
{
py::class_<migraphx::shape> shape_cls(m, "shape");
shape_cls
.def(py::init([](py::kwargs kwargs) {
auto v = migraphx::to_value(kwargs);
auto t = migraphx::shape::parse_type(v.get("type", "float"));
if(v.contains("dyn_dims"))
{
auto dyn_dims =
migraphx::from_value<std::vector<migraphx::shape::dynamic_dimension>>(
v.at("dyn_dims"));
return migraphx::shape(t, dyn_dims);
}
auto lens = v.get<std::size_t>("lens", {1});
if(v.contains("strides"))
return migraphx::shape(t, lens, v.at("strides").to_vector<std::size_t>());
else
return migraphx::shape(t, lens);
}))
.def("type", &migraphx::shape::type)
.def("lens", &migraphx::shape::lens)
.def("strides", &migraphx::shape::strides)
.def("ndim", &migraphx::shape::ndim)
.def("elements", &migraphx::shape::elements)
.def("bytes", &migraphx::shape::bytes)
.def("type_string", &migraphx::shape::type_string)
.def("type_size", &migraphx::shape::type_size)
.def("dyn_dims", &migraphx::shape::dyn_dims)
.def("packed", &migraphx::shape::packed)
.def("transposed", &migraphx::shape::transposed)
.def("broadcasted", &migraphx::shape::broadcasted)
.def("standard", &migraphx::shape::standard)
.def("scalar", &migraphx::shape::scalar)
.def("dynamic", &migraphx::shape::dynamic)
.def("__eq__", std::equal_to<migraphx::shape>{})
.def("__ne__", std::not_equal_to<migraphx::shape>{})
.def("__repr__", [](const migraphx::shape& s) { return migraphx::to_string(s); });
py::enum_<migraphx::shape::type_t>(shape_cls, "type_t")
MIGRAPHX_SHAPE_VISIT_TYPES(MIGRAPHX_PYTHON_GENERATE_SHAPE_ENUM);
py::class_<migraphx::shape::dynamic_dimension>(shape_cls, "dynamic_dimension")
.def(py::init<>())
.def(py::init<std::size_t, std::size_t>())
.def(py::init<std::size_t, std::size_t, std::set<std::size_t>>())
.def_readwrite("min", &migraphx::shape::dynamic_dimension::min)
.def_readwrite("max", &migraphx::shape::dynamic_dimension::max)
.def_readwrite("optimals", &migraphx::shape::dynamic_dimension::optimals)
.def("is_fixed", &migraphx::shape::dynamic_dimension::is_fixed);
py::class_<migraphx::argument>(m, "argument", py::buffer_protocol())
.def_buffer([](migraphx::argument& x) -> py::buffer_info { return to_buffer_info(x); })
.def(py::init([](py::buffer b) {
py::buffer_info info = b.request();
return migraphx::argument(to_shape(info), info.ptr);
}))
.def("get_shape", &migraphx::argument::get_shape)
.def("data_ptr",
[](migraphx::argument& x) { return reinterpret_cast<std::uintptr_t>(x.data()); })
.def("tolist",
[](migraphx::argument& x) {
py::list l{x.get_shape().elements()};
visit(x, [&](auto data) { l = py::cast(data.to_vector()); });
return l;
})
.def("__eq__", std::equal_to<migraphx::argument>{})
.def("__ne__", std::not_equal_to<migraphx::argument>{})
.def("__repr__", [](const migraphx::argument& x) { return migraphx::to_string(x); });
py::class_<migraphx::target>(m, "target");
py::class_<migraphx::instruction_ref>(m, "instruction_ref")
.def("shape", [](migraphx::instruction_ref i) { return i->get_shape(); })
.def("op", [](migraphx::instruction_ref i) { return i->get_operator(); });
py::class_<migraphx::module, std::unique_ptr<migraphx::module, py::nodelete>>(m, "module")
.def("print", [](const migraphx::module& mm) { std::cout << mm << std::endl; })
.def(
"add_instruction",
[](migraphx::module& mm,
const migraphx::operation& op,
std::vector<migraphx::instruction_ref>& args,
std::vector<migraphx::module*>& mod_args) {
return mm.add_instruction(op, args, mod_args);
},
py::arg("op"),
py::arg("args"),
py::arg("mod_args") = std::vector<migraphx::module*>{})
.def(
"add_literal",
[](migraphx::module& mm, py::buffer data) {
py::buffer_info info = data.request();
auto literal_shape = to_shape(info);
return mm.add_literal(literal_shape, reinterpret_cast<char*>(info.ptr));
},
py::arg("data"))
.def(
"add_parameter",
[](migraphx::module& mm, const std::string& name, const migraphx::shape shape) {
return mm.add_parameter(name, shape);
},
py::arg("name"),
py::arg("shape"))
.def(
"add_return",
[](migraphx::module& mm, std::vector<migraphx::instruction_ref>& args) {
return mm.add_return(args);
},
py::arg("args"))
.def("__repr__", [](const migraphx::module& mm) { return migraphx::to_string(mm); });
py::class_<migraphx::program>(m, "program")
.def(py::init([]() { return migraphx::program(); }))
.def("get_parameter_names", &migraphx::program::get_parameter_names)
.def("get_parameter_shapes", &migraphx::program::get_parameter_shapes)
.def("get_output_shapes", &migraphx::program::get_output_shapes)
.def("is_compiled", &migraphx::program::is_compiled)
.def(
"compile",
[](migraphx::program& p,
const migraphx::target& t,
bool offload_copy,
bool fast_math,
bool exhaustive_tune) {
migraphx::compile_options options;
options.offload_copy = offload_copy;
options.fast_math = fast_math;
options.exhaustive_tune = exhaustive_tune;
p.compile(t, options);
},
py::arg("t"),
py::arg("offload_copy") = true,
py::arg("fast_math") = true,
py::arg("exhaustive_tune") = false)
.def("get_main_module", [](const migraphx::program& p) { return p.get_main_module(); })
.def(
"create_module",
[](migraphx::program& p, const std::string& name) { return p.create_module(name); },
py::arg("name"))
.def("run",
[](migraphx::program& p, py::dict params) {
migraphx::parameter_map pm;
for(auto x : params)
{
std::string key = x.first.cast<std::string>();
py::buffer b = x.second.cast<py::buffer>();
py::buffer_info info = b.request();
pm[key] = migraphx::argument(to_shape(info), info.ptr);
}
return p.eval(pm);
})
.def("run_async",
[](migraphx::program& p,
py::dict params,
std::uintptr_t stream,
std::string stream_name) {
migraphx::parameter_map pm;
for(auto x : params)
{
std::string key = x.first.cast<std::string>();
py::buffer b = x.second.cast<py::buffer>();
py::buffer_info info = b.request();
pm[key] = migraphx::argument(to_shape(info), info.ptr);
}
migraphx::execution_environment exec_env{
migraphx::any_ptr(reinterpret_cast<void*>(stream), stream_name), true};
return p.eval(pm, exec_env);
})
.def("sort", &migraphx::program::sort)
.def("print", [](const migraphx::program& p) { std::cout << p << std::endl; })
.def("__eq__", std::equal_to<migraphx::program>{})
.def("__ne__", std::not_equal_to<migraphx::program>{})
.def("__repr__", [](const migraphx::program& p) { return migraphx::to_string(p); });
py::class_<migraphx::operation> op(m, "op");
op.def(py::init([](const std::string& name, py::kwargs kwargs) {
migraphx::value v = migraphx::value::object{};
if(kwargs)
{
v = migraphx::to_value(kwargs);
}
return migraphx::make_op(name, v);
}))
.def("name", &migraphx::operation::name);
py::enum_<migraphx::op::pooling_mode>(op, "pooling_mode")
.value("average", migraphx::op::pooling_mode::average)
.value("max", migraphx::op::pooling_mode::max)
.value("lpnorm", migraphx::op::pooling_mode::lpnorm);
py::enum_<migraphx::op::rnn_direction>(op, "rnn_direction")
.value("forward", migraphx::op::rnn_direction::forward)
.value("reverse", migraphx::op::rnn_direction::reverse)
.value("bidirectional", migraphx::op::rnn_direction::bidirectional);
m.def(
"argument_from_pointer",
[](const migraphx::shape shape, const int64_t address) {
return migraphx::argument(shape, reinterpret_cast<void*>(address));
},
py::arg("shape"),
py::arg("address"));
m.def(
"parse_tf",
[](const std::string& filename,
bool is_nhwc,
unsigned int batch_size,
std::unordered_map<std::string, std::vector<std::size_t>> map_input_dims,
std::vector<std::string> output_names) {
return migraphx::parse_tf(
filename, migraphx::tf_options{is_nhwc, batch_size, map_input_dims, output_names});
},
"Parse tf protobuf (default format is nhwc)",
py::arg("filename"),
py::arg("is_nhwc") = true,
py::arg("batch_size") = 1,
py::arg("map_input_dims") = std::unordered_map<std::string, std::vector<std::size_t>>(),
py::arg("output_names") = std::vector<std::string>());
m.def(
"parse_onnx",
[](const std::string& filename,
unsigned int default_dim_value,
migraphx::shape::dynamic_dimension default_dyn_dim_value,
std::unordered_map<std::string, std::vector<std::size_t>> map_input_dims,
std::unordered_map<std::string, std::vector<migraphx::shape::dynamic_dimension>>
map_dyn_input_dims,
bool skip_unknown_operators,
bool print_program_on_error,
int64_t max_loop_iterations) {
migraphx::onnx_options options;
options.default_dim_value = default_dim_value;
options.default_dyn_dim_value = default_dyn_dim_value;
options.map_input_dims = map_input_dims;
options.map_dyn_input_dims = map_dyn_input_dims;
options.skip_unknown_operators = skip_unknown_operators;
options.print_program_on_error = print_program_on_error;
options.max_loop_iterations = max_loop_iterations;
return migraphx::parse_onnx(filename, options);
},
"Parse onnx file",
py::arg("filename"),
py::arg("default_dim_value") = 0,
py::arg("default_dyn_dim_value") = migraphx::shape::dynamic_dimension{1, 1},
py::arg("map_input_dims") = std::unordered_map<std::string, std::vector<std::size_t>>(),
py::arg("map_dyn_input_dims") =
std::unordered_map<std::string, std::vector<migraphx::shape::dynamic_dimension>>(),
py::arg("skip_unknown_operators") = false,
py::arg("print_program_on_error") = false,
py::arg("max_loop_iterations") = 10);
m.def(
"parse_onnx_buffer",
[](const std::string& onnx_buffer,
unsigned int default_dim_value,
migraphx::shape::dynamic_dimension default_dyn_dim_value,
std::unordered_map<std::string, std::vector<std::size_t>> map_input_dims,
std::unordered_map<std::string, std::vector<migraphx::shape::dynamic_dimension>>
map_dyn_input_dims,
bool skip_unknown_operators,
bool print_program_on_error) {
migraphx::onnx_options options;
options.default_dim_value = default_dim_value;
options.default_dyn_dim_value = default_dyn_dim_value;
options.map_input_dims = map_input_dims;
options.map_dyn_input_dims = map_dyn_input_dims;
options.skip_unknown_operators = skip_unknown_operators;
options.print_program_on_error = print_program_on_error;
return migraphx::parse_onnx_buffer(onnx_buffer, options);
},
"Parse onnx file",
py::arg("filename"),
py::arg("default_dim_value") = 0,
py::arg("default_dyn_dim_value") = migraphx::shape::dynamic_dimension{1, 1},
py::arg("map_input_dims") = std::unordered_map<std::string, std::vector<std::size_t>>(),
py::arg("map_dyn_input_dims") =
std::unordered_map<std::string, std::vector<migraphx::shape::dynamic_dimension>>(),
py::arg("skip_unknown_operators") = false,
py::arg("print_program_on_error") = false);
m.def(
"load",
[](const std::string& name, const std::string& format) {
migraphx::file_options options;
options.format = format;
return migraphx::load(name, options);
},
"Load MIGraphX program",
py::arg("filename"),
py::arg("format") = "msgpack");
m.def(
"save",
[](const migraphx::program& p, const std::string& name, const std::string& format) {
migraphx::file_options options;
options.format = format;
return migraphx::save(p, name, options);
},
"Save MIGraphX program",
py::arg("p"),
py::arg("filename"),
py::arg("format") = "msgpack");
m.def("get_target", &migraphx::make_target);
m.def("create_argument", [](const migraphx::shape& s, const std::vector<double>& values) {
if(values.size() != s.elements())
MIGRAPHX_THROW("Values and shape elements do not match");
migraphx::argument a{s};
a.fill(values.begin(), values.end());
return a;
});
m.def("generate_argument", &migraphx::generate_argument, py::arg("s"), py::arg("seed") = 0);
m.def("fill_argument", &migraphx::fill_argument, py::arg("s"), py::arg("value"));
m.def("quantize_fp16",
&migraphx::quantize_fp16,
py::arg("prog"),
py::arg("ins_names") = std::vector<std::string>{"all"});
m.def("quantize_int8",
&migraphx::quantize_int8,
py::arg("prog"),
py::arg("t"),
py::arg("calibration") = std::vector<migraphx::parameter_map>{},
py::arg("ins_names") = std::vector<std::string>{"dot", "convolution"});
#ifdef HAVE_GPU
m.def("allocate_gpu", &migraphx::gpu::allocate_gpu, py::arg("s"), py::arg("host") = false);
m.def("to_gpu", &migraphx::gpu::to_gpu, py::arg("arg"), py::arg("host") = false);
m.def("from_gpu", &migraphx::gpu::from_gpu);
m.def("gpu_sync", [] { migraphx::gpu::gpu_sync(); });
#endif
#ifdef VERSION_INFO
m.attr("__version__") = VERSION_INFO;
#else
m.attr("__version__") = "dev";
#endif
}

3
docker/rocm/rocm-pin-600 Normal file
View File

@@ -0,0 +1,3 @@
Package: *
Pin: release o=repo.radeon.com
Pin-Priority: 600

38
docker/rocm/rocm.hcl Normal file
View File

@@ -0,0 +1,38 @@
variable "AMDGPU" {
default = "gfx900"
}
variable "ROCM" {
default = "5.7.3"
}
variable "HSA_OVERRIDE_GFX_VERSION" {
default = ""
}
variable "HSA_OVERRIDE" {
default = "1"
}
target deps {
dockerfile = "docker/main/Dockerfile"
platforms = ["linux/amd64"]
target = "deps"
}
target rootfs {
dockerfile = "docker/main/Dockerfile"
platforms = ["linux/amd64"]
target = "rootfs"
}
target rocm {
dockerfile = "docker/rocm/Dockerfile"
contexts = {
deps = "target:deps",
rootfs = "target:rootfs"
}
platforms = ["linux/amd64"]
args = {
AMDGPU = AMDGPU,
ROCM = ROCM,
HSA_OVERRIDE_GFX_VERSION = HSA_OVERRIDE_GFX_VERSION,
HSA_OVERRIDE = HSA_OVERRIDE
}
}

1
docker/rocm/rocm.list Normal file
View File

@@ -0,0 +1 @@
deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/5.7.3 focal main

17
docker/rocm/rocm.mk Normal file
View File

@@ -0,0 +1,17 @@
BOARDS += rocm
# AMD/ROCm is chunky so we build couple of smaller images for specific chipsets
ROCM_CHIPSETS:=gfx900:9.0.0 gfx1030:10.3.0 gfx1100:11.0.0
local-rocm: version
$(foreach chipset,$(ROCM_CHIPSETS),AMDGPU=$(word 1,$(subst :, ,$(chipset))) HSA_OVERRIDE_GFX_VERSION=$(word 2,$(subst :, ,$(chipset))) HSA_OVERRIDE=1 docker buildx bake --load --file=docker/rocm/rocm.hcl --set rocm.tags=frigate:latest-rocm-$(word 1,$(subst :, ,$(chipset))) rocm;)
unset HSA_OVERRIDE_GFX_VERSION && HSA_OVERRIDE=0 AMDGPU=gfx docker buildx bake --load --file=docker/rocm/rocm.hcl --set rocm.tags=frigate:latest-rocm rocm
build-rocm: version
$(foreach chipset,$(ROCM_CHIPSETS),AMDGPU=$(word 1,$(subst :, ,$(chipset))) HSA_OVERRIDE_GFX_VERSION=$(word 2,$(subst :, ,$(chipset))) HSA_OVERRIDE=1 docker buildx bake --file=docker/rocm/rocm.hcl --set rocm.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-rocm-$(chipset) rocm;)
unset HSA_OVERRIDE_GFX_VERSION && HSA_OVERRIDE=0 AMDGPU=gfx docker buildx bake --file=docker/rocm/rocm.hcl --set rocm.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-rocm rocm
push-rocm: build-rocm
$(foreach chipset,$(ROCM_CHIPSETS),AMDGPU=$(word 1,$(subst :, ,$(chipset))) HSA_OVERRIDE_GFX_VERSION=$(word 2,$(subst :, ,$(chipset))) HSA_OVERRIDE=1 docker buildx bake --push --file=docker/rocm/rocm.hcl --set rocm.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-rocm-$(chipset) rocm;)
unset HSA_OVERRIDE_GFX_VERSION && HSA_OVERRIDE=0 AMDGPU=gfx docker buildx bake --push --file=docker/rocm/rocm.hcl --set rocm.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-rocm rocm

View File

@@ -0,0 +1,20 @@
#!/command/with-contenv bash
# shellcheck shell=bash
# Compile YoloV8 ONNX files into ROCm MIGraphX files
OVERRIDE=$(cd /opt/frigate && python3 -c 'import frigate.detectors.plugins.rocm as rocm; print(rocm.auto_override_gfx_version())')
if ! test -z "$OVERRIDE"; then
echo "Using HSA_OVERRIDE_GFX_VERSION=${OVERRIDE}"
export HSA_OVERRIDE_GFX_VERSION=$OVERRIDE
fi
for onnx in /config/model_cache/yolov8/*.onnx
do
mxr="${onnx%.onnx}.mxr"
if ! test -f $mxr; then
echo "processing $onnx into $mxr"
/opt/rocm/bin/migraphx-driver compile $onnx --optimize --gpu --enable-offload-copy --binary -o $mxr
fi
done

View File

@@ -0,0 +1 @@
oneshot

View File

@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/compile-rocm-models/run

View File

@@ -8,6 +8,8 @@ ARG TRT_BASE=nvcr.io/nvidia/tensorrt:23.03-py3
# Build TensorRT-specific library
FROM ${TRT_BASE} AS trt-deps
ARG COMPUTE_LEVEL
RUN apt-get update \
&& apt-get install -y git build-essential cuda-nvcc-* cuda-nvtx-* libnvinfer-dev libnvinfer-plugin-dev libnvparsers-dev libnvonnxparsers-dev \
&& rm -rf /var/lib/apt/lists/*

View File

@@ -23,8 +23,8 @@ else
fi
tar xaf jetson_multimedia_api.tbz2 -C / && rm jetson_multimedia_api.tbz2
wget -q https://github.com/madsciencetist/jetson-ffmpeg/archive/refs/heads/master.zip
unzip master.zip && rm master.zip && cd jetson-ffmpeg-master
wget -q https://github.com/AndBobsYourUncle/jetson-ffmpeg/archive/9c17b09.zip -O jetson-ffmpeg.zip
unzip jetson-ffmpeg.zip && rm jetson-ffmpeg.zip && mv jetson-ffmpeg-* jetson-ffmpeg && cd jetson-ffmpeg
LD_LIBRARY_PATH=$(pwd)/stubs:$LD_LIBRARY_PATH # tegra multimedia libs aren't available in image, so use stubs for ffmpeg build
mkdir build
cd build
@@ -42,7 +42,7 @@ cd ../ && rm -rf nv-codec-headers-master
# Build ffmpeg with nvmpi patch
wget -q https://ffmpeg.org/releases/ffmpeg-6.0.tar.xz
tar xaf ffmpeg-*.tar.xz && rm ffmpeg-*.tar.xz && cd ffmpeg-*
patch -p1 < ../jetson-ffmpeg-master/ffmpeg_patches/ffmpeg6.0_nvmpi.patch
patch -p1 < ../jetson-ffmpeg/ffmpeg_patches/ffmpeg6.0_nvmpi.patch
export PKG_CONFIG_PATH=$INSTALL_PREFIX/lib/pkgconfig
# enable Jetson codecs but disable dGPU codecs
./configure --cc='ccache gcc' --cxx='ccache g++' \

View File

@@ -11,7 +11,7 @@ git clone --depth 1 https://github.com/NateMeyer/tensorrt_demos.git -b condition
if [ ! -e /usr/local/cuda ]; then
ln -s /usr/local/cuda-* /usr/local/cuda
fi
cd ./tensorrt_demos/plugins && make all -j$(nproc)
cd ./tensorrt_demos/plugins && make all -j$(nproc) computes="${COMPUTE_LEVEL:-}"
cp libyolo_layer.so /usr/local/lib/libyolo_layer.so
# Store yolo scripts for later conversion

View File

@@ -10,12 +10,16 @@ variable "SLIM_BASE" {
variable "TRT_BASE" {
default = null
}
variable "COMPUTE_LEVEL" {
default = ""
}
target "_build_args" {
args = {
BASE_IMAGE = BASE_IMAGE,
SLIM_BASE = SLIM_BASE,
TRT_BASE = TRT_BASE
TRT_BASE = TRT_BASE,
COMPUTE_LEVEL = COMPUTE_LEVEL
}
platforms = ["linux/${ARCH}"]
}

View File

@@ -2,7 +2,7 @@ BOARDS += trt
JETPACK4_BASE ?= timongentzsch/l4t-ubuntu20-opencv:latest # L4T 32.7.1 JetPack 4.6.1
JETPACK5_BASE ?= nvcr.io/nvidia/l4t-tensorrt:r8.5.2-runtime # L4T 35.3.1 JetPack 5.1.1
X86_DGPU_ARGS := ARCH=amd64
X86_DGPU_ARGS := ARCH=amd64 COMPUTE_LEVEL="50 60 70 80 90"
JETPACK4_ARGS := ARCH=arm64 BASE_IMAGE=$(JETPACK4_BASE) SLIM_BASE=$(JETPACK4_BASE) TRT_BASE=$(JETPACK4_BASE)
JETPACK5_ARGS := ARCH=arm64 BASE_IMAGE=$(JETPACK5_BASE) SLIM_BASE=$(JETPACK5_BASE) TRT_BASE=$(JETPACK5_BASE)

View File

@@ -96,7 +96,7 @@ model:
Note that if you rename objects in the labelmap, you will also need to update your `objects -> track` list as well.
:::caution
:::warning
Some labels have special handling and modifications can disable functionality.
@@ -120,7 +120,7 @@ NOTE: The folder that is mapped from the host needs to be the folder that contai
## Custom go2rtc version
Frigate currently includes go2rtc v1.8.1, there may be certain cases where you want to run a different version of go2rtc.
Frigate currently includes go2rtc v1.9.2, there may be certain cases where you want to run a different version of go2rtc.
To do this:

View File

@@ -0,0 +1,98 @@
---
id: authentication
title: Authentication
---
# Authentication
## Modes
Frigate supports two modes for authentication
| Mode | Description |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `native` | (default) Use this mode if you don't implement authentication with a proxy in front of Frigate. |
| `proxy` | Use this mode if you have an existing proxy for authentication. Supports passing authenticated user downstream to Frigate for role-based authorization (future implementation). |
### Native mode
Frigate stores user information in its database. Password hashes are generated using industry standard PBKDF2-SHA256 with 600,000 iterations. Upon successful login, a JWT token is issued with an expiration date and set as a cookie. The cookie is refreshed as needed automatically. This JWT token can also be passed in the Authorization header as a bearer token.
Users are managed in the UI under Settings > Users.
#### Onboarding
On startup, an admin user and password are generated and printed in the logs. It is recommended to set a new password for the admin account after logging in for the first time under Settings > Users.
#### Resetting admin password
In the event that you are locked out of your instance, you can tell Frigate to reset the admin password and print it in the logs on next startup using the `reset_admin_password` setting in your config file.
#### Login failure rate limiting
In order to limit the risk of brute force attacks, rate limiting is available for login failures. This is implemented with Flask-Limiter, and the string notation for valid values is available in [the documentation](https://flask-limiter.readthedocs.io/en/stable/configuration.html#rate-limit-string-notation).
For example, `1/second;5/minute;20/hour` will rate limit the login endpoint when failures occur more than:
- 1 time per second
- 5 times per minute
- 20 times per hour
Restarting Frigate will reset the rate limits.
If you are running Frigate behind a proxy, you will want to set `trusted_proxies` or these rate limits will apply to the upstream proxy IP address. This means that a brute force attack will rate limit login attempts from other devices and could temporarily lock you out of your instance. In order to ensure rate limits only apply to the actual IP address where the requests are coming from, you will need to list the upstream networks that you want to trust. These trusted proxies are checked against the `X-Forwarded-For` header when looking for the IP address where the request originated.
If you are running a reverse proxy in the same docker compose file as Frigate, here is an example of how your auth config might look:
```yaml
auth:
mode: native
failed_login_rate_limit: "1/second;5/minute;20/hour"
trusted_proxies:
- 172.18.0.0/16 # <---- this is the subnet for the internal docker compose network
```
### Proxy mode
Proxy mode is designed to complement common upstream authentication proxies such as Authelia, Authentik, oauth2_proxy, or traefik-forward-auth.
#### Header mapping
If your proxy supports passing a header with the authenticated username, you can use the `header_map` config to specify the header name so it is passed to Frigate. For example, the following will map the `X-Forwarded-User` value. Header names are not case sensitive.
```yaml
auth:
...
header_map:
user: x-forwarded-user
```
Note that only the following list of headers are permitted by default:
```
Remote-User
Remote-Groups
Remote-Email
Remote-Name
X-Forwarded-User
X-Forwarded-Groups
X-Forwarded-Email
X-Forwarded-Preferred-Username
X-authentik-username
X-authentik-groups
X-authentik-email
X-authentik-name
X-authentik-uid
```
If you would like to add more options, you can overwrite the default file with a docker bind mount at `/usr/local/nginx/conf/proxy_trusted_headers.conf`. Reference the source code for the default file formatting.
Future versions of Frigate may leverage group and role headers for authorization in Frigate as well.
#### Login page redirection
Frigate gracefully performs login page redirection that should work with most authentication proxies. If your reverse proxy returns a `Location` header on `401`, `302`, or `307` unauthorized responses, Frigate's frontend will automatically detect it and redirect to that URL.
#### Custom logout url
If your reverse proxy has a dedicated logout url, you can specify using the `logout_url` config option. This will update the link for the `Logout` link in the UI.

View File

@@ -31,7 +31,7 @@ First, set up a PTZ preset in your camera's firmware and give it a name. If you'
Edit your Frigate configuration file and enter the ONVIF parameters for your camera. Specify the object types to track, a required zone the object must enter to begin autotracking, and the camera preset name you configured in your camera's firmware to return to when tracking has ended. Optionally, specify a delay in seconds before Frigate returns the camera to the preset.
An [ONVIF connection](cameras.md) is required for autotracking to function.
An [ONVIF connection](cameras.md) is required for autotracking to function. Also, a [motion mask](masks.md) over your camera's timestamp and any overlay text is recommended to ensure they are completely excluded from scene change calculations when the camera is moving.
Note that `autotracking` is disabled by default but can be enabled in the configuration or by MQTT.
@@ -113,7 +113,7 @@ If you initially calibrate with zooming disabled and then enable zooming at a la
Every PTZ camera is different, so autotracking may not perform ideally in every situation. This experimental feature was initially developed using an EmpireTech/Dahua SD1A404XB-GNR.
The object tracker in Frigate estimates the motion of the PTZ so that tracked objects are preserved when the camera moves. In most cases (especially for faster moving objects), the default 5 fps is insufficient for the motion estimator to perform accurately. 10 fps is the current recommendation. Higher frame rates will likely not be more performant and will only slow down Frigate and the motion estimator. Adjust your camera to output at least 10 frames per second and change the `fps` parameter in the [detect configuration](index.md) of your configuration file.
The object tracker in Frigate estimates the motion of the PTZ so that tracked objects are preserved when the camera moves. In most cases 5 fps is sufficient, but if you plan to track faster moving objects, you may want to increase this slightly. Higher frame rates (> 10fps) will only slow down Frigate and the motion estimator and may lead to dropped frames, especially if you are using experimental zooming.
A fast [detector](object_detectors.md) is recommended. CPU detectors will not perform well or won't work at all. You can watch Frigate's debug viewer for your camera to see a thicker colored box around the object currently being autotracked.
@@ -159,7 +159,7 @@ This is often caused by the same reason as above - the `MoveStatus` ONVIF parame
### I'm seeing this error in the logs: "Autotracker: motion estimator couldn't get transformations". What does this mean?
To maintain object tracking during PTZ moves, Frigate tracks the motion of your camera based on the details of the frame. If you are seeing this message, it could mean that your `zoom_factor` may be set too high, the scene around your detected object does not have enough details (like hard edges or color variatons), or your camera's shutter speed is too slow and motion blur is occurring. Try reducing `zoom_factor`, finding a way to alter the scene around your object, or changing your camera's shutter speed.
To maintain object tracking during PTZ moves, Frigate tracks the motion of your camera based on the details of the frame. If you are seeing this message, it could mean that your `zoom_factor` may be set too high, the scene around your detected object does not have enough details (like hard edges or color variations), or your camera's shutter speed is too slow and motion blur is occurring. Try reducing `zoom_factor`, finding a way to alter the scene around your object, or changing your camera's shutter speed.
### Calibration seems to have completed, but the camera is not actually moving to track my object. Why?

View File

@@ -1,13 +1,20 @@
# Birdseye
Birdseye allows a heads-up view of your cameras to see what is going on around your property / space without having to watch all cameras that may have nothing happening. Birdseye allows specific modes that intelligently show and disappear based on what you care about.
In addition to Frigate's Live camera dashboard, Birdseye allows a portable heads-up view of your cameras to see what is going on around your property / space without having to watch all cameras that may have nothing happening. Birdseye allows specific modes that intelligently show and disappear based on what you care about.
Birdseye can be viewed by adding the "Birdseye" camera to a Camera Group in the Web UI. Add a Camera Group by pressing the "+" icon on the Live page, and choose "Birdseye" as one of the cameras.
Birdseye can also be used in HomeAssistant dashboards, cast to media devices, etc.
## Birdseye Behavior
### Birdseye Modes
Birdseye offers different modes to customize which cameras show under which circumstances.
- **continuous:** All cameras are always included
- **motion:** Cameras that have detected motion within the last 30 seconds are included
- **objects:** Cameras that have tracked an active object within the last 30 seconds are included
- **continuous:** All cameras are always included
- **motion:** Cameras that have detected motion within the last 30 seconds are included
- **objects:** Cameras that have tracked an active object within the last 30 seconds are included
### Custom Birdseye Icon
@@ -34,6 +41,29 @@ cameras:
enabled: False
```
### Birdseye Inactivity
By default birdseye shows all cameras that have had the configured activity in the last 30 seconds, this can be configured:
```yaml
birdseye:
enabled: True
inactivity_threshold: 15
```
## Birdseye Layout
### Birdseye Dimensions
The resolution and aspect ratio of birdseye can be configured. Resolution will increase the quality but does not affect the layout. Changing the aspect ratio of birdseye does affect how cameras are laid out.
```yaml
birdseye:
enabled: True
width: 1280
height: 720
```
### Sorting cameras in the Birdseye view
It is possible to override the order of cameras that are being shown in the Birdseye view.
@@ -54,4 +84,28 @@ cameras:
order: 2
```
*Note*: Cameras are sorted by default using their name to ensure a constant view inside Birdseye.
_Note_: Cameras are sorted by default using their name to ensure a constant view inside Birdseye.
### Birdseye Cameras
It is possible to limit the number of cameras shown on birdseye at one time. When this is enabled, birdseye will show the cameras with most recent activity. There is a cooldown to ensure that cameras do not switch too frequently.
For example, this can be configured to only show the most recently active camera.
```yaml
birdseye:
enabled: True
layout:
max_cameras: 1
```
### Birdseye Scaling
By default birdseye tries to fit 2 cameras in each row and then double in size until a suitable layout is found. The scaling can be configured with a value between 1.0 and 5.0 depending on use case.
```yaml
birdseye:
enabled: True
layout:
scaling_factor: 3.0
```

View File

@@ -69,16 +69,12 @@ cameras:
ffmpeg:
output_args:
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -tag:v hvc1 -bsf:v hevc_mp4toannexb -c:a aac
rtmp: -c:v copy -c:a aac -f flv
inputs:
- path: rtsp://user:password@camera-ip:554/H264/ch1/main/av_stream # <----- Update for your camera
roles:
- detect
- record
- rtmp
rtmp:
enabled: False # <-- RTMP should be disabled if your stream is not H264
detect:
width: # <- optional, by default Frigate tries to automatically detect resolution
height: # <- optional, by default Frigate tries to automatically detect resolution
@@ -105,6 +101,15 @@ If available, recommended settings are:
According to [this discussion](https://github.com/blakeblackshear/frigate/issues/3235#issuecomment-1135876973), the http video streams seem to be the most reliable for Reolink.
Cameras connected via a Reolink NVR can be connected with the http stream, use `channel[0..15]` in the stream url for the additional channels.
The setup of main stream can be also done via RTSP, but isn't always reliable on all hardware versions. The example configuration is working with the oldest HW version RLN16-410 device with multiple types of cameras.
:::warning
The below configuration only works for reolink cameras with stream resolution of 5MP or lower, 8MP+ cameras need to use RTSP as http-flv is not supported in this case.
:::
```yaml
go2rtc:
streams:
@@ -112,6 +117,11 @@ go2rtc:
- "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=username&password=password#video=copy#audio=copy#audio=opus"
your_reolink_camera_sub:
- "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=username&password=password"
your_reolink_camera_via_nvr:
- "ffmpeg:http://reolink_nvr_ip/flv?port=1935&app=bcs&stream=channel3_main.bcs&user=username&password=password" # channel numbers are 0-15
- "ffmpeg:your_reolink_camera_via_nvr#audio=aac"
your_reolink_camera_via_nvr_sub:
- "ffmpeg:http://reolink_nvr_ip/flv?port=1935&app=bcs&stream=channel3_ext.bcs&user=username&password=password"
cameras:
your_reolink_camera:
@@ -125,6 +135,31 @@ cameras:
input_args: preset-rtsp-restream
roles:
- detect
reolink_via_nvr:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/your_reolink_camera_via_nvr?video=copy&audio=aac
input_args: preset-rtsp-restream
roles:
- record
- path: rtsp://127.0.0.1:8554/your_reolink_camera_via_nvr_sub?video=copy
input_args: preset-rtsp-restream
roles:
- detect
```
#### Reolink Doorbell
The reolink doorbell supports 2-way audio via go2rtc and other applications. It is important that the http-flv stream is still used for stability, a secondary rtsp stream can be added that will be using for the two way audio only.
```yaml
go2rtc:
streams:
your_reolink_doorbell:
- "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=username&password=password#video=copy#audio=copy#audio=opus"
- rtsp://reolink_ip/Preview_01_sub
your_reolink_doorbell_sub:
- "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=username&password=password"
```
### Unifi Protect Cameras
@@ -140,15 +175,14 @@ go2rtc:
- rtspx://192.168.1.1:7441/abcdefghijk
```
[See the go2rtc docs for more information](https://github.com/AlexxIT/go2rtc/tree/v1.8.1#source-rtsp)
[See the go2rtc docs for more information](https://github.com/AlexxIT/go2rtc/tree/v1.9.2#source-rtsp)
In the Unifi 2.0 update Unifi Protect Cameras had a change in audio sample rate which causes issues for ffmpeg. The input rate needs to be set for record and rtmp if used directly with unifi protect.
In the Unifi 2.0 update Unifi Protect Cameras had a change in audio sample rate which causes issues for ffmpeg. The input rate needs to be set for record if used directly with unifi protect.
```yaml
ffmpeg:
output_args:
record: preset-record-ubiquiti
rtmp: preset-rtmp-ubiquiti # recommend using go2rtc instead
```
### TP-Link VIGI Cameras

View File

@@ -11,12 +11,11 @@ A camera is enabled by default but can be temporarily disabled by using `enabled
Each role can only be assigned to one input per camera. The options for roles are as follows:
| Role | Description |
| -------- | ---------------------------------------------------------------------------------------- |
| `detect` | Main feed for object detection. [docs](object_detectors.md) |
| `record` | Saves segments of the video feed based on configuration settings. [docs](record.md) |
| `audio` | Feed for audio based detection. [docs](audio_detectors.md) |
| `rtmp` | Deprecated: Broadcast as an RTMP feed for other services to consume. [docs](restream.md) |
| Role | Description |
| -------- | ----------------------------------------------------------------------------------- |
| `detect` | Main feed for object detection. [docs](object_detectors.md) |
| `record` | Saves segments of the video feed based on configuration settings. [docs](record.md) |
| `audio` | Feed for audio based detection. [docs](audio_detectors.md) |
```yaml
mqtt:
@@ -29,7 +28,6 @@ cameras:
- path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2
roles:
- detect
- rtmp # <- deprecated, recommend using restream instead
- path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/live
roles:
- record
@@ -52,7 +50,7 @@ For camera model specific settings check the [camera specific](camera_specific.m
## Setting up camera PTZ controls
:::caution
:::warning
Not every PTZ supports ONVIF, which is the standard protocol Frigate uses to communicate with your camera. Check the [official list of ONVIF conformant products](https://www.onvif.org/conformant-products/), your camera documentation, or camera manufacturer's website to ensure your PTZ supports ONVIF. Also, ensure your camera is running the latest firmware.
@@ -81,17 +79,42 @@ This list of working and non-working PTZ cameras is based on user feedback.
| Brand or specific camera | PTZ Controls | Autotracking | Notes |
| ------------------------ | :----------: | :----------: | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Amcrest | ✅ | ✅ | ⛔️ Generally, Amcrest should work, but some older models (like the common IP2M-841) don't support autotracking |
| Amcrest | ✅ | ✅ | ⛔️ Generally, Amcrest should work, but some older models (like the common IP2M-841) don't support auto tracking |
| Amcrest ASH21 | ❌ | ❌ | No ONVIF support |
| Ctronics PTZ | ✅ | ❌ | |
| Dahua | ✅ | ✅ | |
| Foscam R5 | ✅ | ❌ | |
| Hanwha XNP-6550RH | ✅ | ❌ | |
| Hikvision | ✅ | ❌ | Incomplete ONVIF support (MoveStatus won't update even on latest firmware) - reported with HWP-N4215IH-DE and DS-2DE3304W-DE, but likely others |
| Reolink 511WA | ✅ | ❌ | Zoom only |
| Reolink E1 Pro | ✅ | ❌ | |
| Reolink E1 Zoom | ✅ | ❌ | |
| Reolink RLC-823A 16x | ✅ | ❌ | |
| Sunba 405-D20X | ✅ | ❌ | |
| Tapo C200 | ✅ | ❌ | Incomplete ONVIF support |
| Tapo C210 | | ❌ | Incomplete ONVIF support |
| Tapo C210 | | ❌ | Incomplete ONVIF support, ONVIF Service Port: 2020 |
| Tapo C220 | ✅ | ❌ | Incomplete ONVIF support, ONVIF Service Port: 2020 |
| Tapo C225 | ✅ | ❌ | Incomplete ONVIF support, ONVIF Service Port: 2020 |
| Tapo C520WS | ✅ | ❌ | Incomplete ONVIF support, ONVIF Service Port: 2020 |
| Uniview IPC672LR-AX4DUPK | ✅ | ❌ | Firmware says FOV relative movement is supported, but camera doesn't actually move when sending ONVIF commands |
| Vikylin PTZ-2804X-I2 | ❌ | ❌ | Incomplete ONVIF support |
## Setting up camera groups
:::tip
It is recommended to set up camera groups using the UI.
:::
Cameras can be grouped together and assigned a name and icon, this allows them to be reviewed and filtered together. There will always be the default group for all cameras.
```yaml
camera_groups:
front:
cameras:
- driveway_cam
- garage_cam
icon: car
order: 0
```

View File

@@ -13,16 +13,16 @@ See [the hwaccel docs](/configuration/hardware_acceleration.md) for more info on
| Preset | Usage | Other Notes |
| --------------------- | ------------------------------ | ----------------------------------------------------- |
| preset-rpi-32-h264 | 32 bit Rpi with h264 stream | |
| preset-rpi-64-h264 | 64 bit Rpi with h264 stream | |
| preset-rpi-64-h265 | 64 bit Rpi with h265 stream | |
| preset-vaapi | Intel & AMD VAAPI | Check hwaccel docs to ensure correct driver is chosen |
| preset-intel-qsv-h264 | Intel QSV with h264 stream | If issues occur recommend using vaapi preset instead |
| preset-intel-qsv-h265 | Intel QSV with h265 stream | If issues occur recommend using vaapi preset instead |
| preset-nvidia-h264 | Nvidia GPU with h264 stream | |
| preset-nvidia-h265 | Nvidia GPU with h265 stream | |
| preset-nvidia-mjpeg | Nvidia GPU with mjpeg stream | Recommend restreaming mjpeg and using nvidia-h264 |
| preset-nvidia | Nvidia GPU | |
| preset-jetson-h264 | Nvidia Jetson with h264 stream | |
| preset-jetson-h265 | Nvidia Jetson with h265 stream | |
| preset-rk-h264 | Rockchip MPP with h264 stream | Use image with \*-rk suffix and privileged mode |
| preset-rk-h265 | Rockchip MPP with h265 stream | Use image with \*-rk suffix and privileged mode |
### Input Args Presets
@@ -42,7 +42,7 @@ See [the camera specific docs](/configuration/camera_specific.md) for more info
| preset-rtsp-udp | RTSP Stream via UDP | Use when camera is UDP only |
| preset-rtsp-blue-iris | Blue Iris RTSP Stream | Use when consuming a stream from Blue Iris |
:::caution
:::warning
It is important to be mindful of input args when using restream because you can have a mix of protocols. `http` and `rtmp` presets cannot be used with `rtsp` streams. For example, when using a reolink cam with the rtsp restream as a source for record the preset-http-reolink will cause a crash. In this case presets will need to be set at the stream level. See the example below.
@@ -71,11 +71,11 @@ cameras:
Output args presets help make the config more readable and handle use cases for different types of streams to ensure consistent recordings.
| Preset | Usage | Other Notes |
| -------------------------------- | --------------------------------- | --------------------------------------------- |
| preset-record-generic | Record WITHOUT audio | This is the default when nothing is specified |
| preset-record-generic-audio-aac | Record WITH aac audio | Use this to enable audio in recordings |
| preset-record-generic-audio-copy | Record WITH original audio | Use this to enable audio in recordings |
| preset-record-mjpeg | Record an mjpeg stream | Recommend restreaming mjpeg stream instead |
| preset-record-jpeg | Record live jpeg | Recommend restreaming live jpeg instead |
| preset-record-ubiquiti | Record ubiquiti stream with audio | Recordings with ubiquiti non-standard audio |
| Preset | Usage | Other Notes |
| -------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| preset-record-generic | Record WITHOUT audio | This is the default when nothing is specified |
| preset-record-generic-audio-copy | Record WITH original audio | Use this to enable audio in recordings |
| preset-record-generic-audio-aac | Record WITH transcoded aac audio | Use this to transcode to aac audio. If your source is already aac, use preset-record-generic-audio-copy instead to avoid re-encoding |
| preset-record-mjpeg | Record an mjpeg stream | Recommend restreaming mjpeg stream instead |
| preset-record-jpeg | Record live jpeg | Recommend restreaming live jpeg instead |
| preset-record-ubiquiti | Record ubiquiti stream with audio | Recordings with ubiquiti non-standard audio |

View File

@@ -3,32 +3,64 @@ id: hardware_acceleration
title: Hardware Acceleration
---
It is recommended to update your configuration to enable hardware accelerated decoding in ffmpeg. Depending on your system, these parameters may not be compatible. More information on hardware accelerated decoding for ffmpeg can be found here: https://trac.ffmpeg.org/wiki/HWAccelIntro
# Hardware Acceleration
It is highly recommended to use a GPU for hardware acceleration in Frigate. Some types of hardware acceleration are detected and used automatically, but you may need to update your configuration to enable hardware accelerated decoding in ffmpeg.
Depending on your system, these parameters may not be compatible. More information on hardware accelerated decoding for ffmpeg can be found here: https://trac.ffmpeg.org/wiki/HWAccelIntro
# Officially Supported
## Raspberry Pi 3/4
Ensure you increase the allocated RAM for your GPU to at least 128 (raspi-config > Performance Options > GPU Memory).
**NOTICE**: If you are using the addon, you may need to turn off `Protection mode` for hardware acceleration.
Ensure you increase the allocated RAM for your GPU to at least 128 (`raspi-config` > Performance Options > GPU Memory).
If you are using the HA addon, you may need to use the full access variant and turn off `Protection mode` for hardware acceleration.
```yaml
# if you want to decode a h264 stream
ffmpeg:
hwaccel_args: preset-rpi-64-h264
# if you want to decode a h265 (hevc) stream
ffmpeg:
hwaccel_args: preset-rpi-64-h265
```
:::note
If running Frigate in docker, you either need to run in priviliged mode or be sure to map the /dev/video1x devices to Frigate
If running Frigate in Docker, you either need to run in privileged mode or
map the `/dev/video*` devices to Frigate. With Docker compose add:
```yaml
services:
frigate:
...
devices:
- /dev/video11:/dev/video11
```
Or with `docker run`:
```bash
docker run -d \
--name frigate \
...
--device /dev/video10 \
--device /dev/video11 \
ghcr.io/blakeblackshear/frigate:stable
```
`/dev/video11` is the correct device (on Raspberry Pi 4B). You can check
by running the following and looking for `H264`:
```bash
for d in /dev/video*; do
echo -e "---\n$d"
v4l2-ctl --list-formats-ext -d $d
done
```
Or map in all the `/dev/video*` devices.
:::
## Intel-based CPUs
@@ -42,7 +74,11 @@ ffmpeg:
hwaccel_args: preset-vaapi
```
**NOTICE**: With some of the processors, like the J4125, the default driver `iHD` doesn't seem to work correctly for hardware acceleration. You may need to change the driver to `i965` by adding the following environment variable `LIBVA_DRIVER_NAME=i965` to your docker-compose file or [in the `frigate.yaml` for HA OS users](advanced.md#environment_vars).
:::note
With some of the processors, like the J4125, the default driver `iHD` doesn't seem to work correctly for hardware acceleration. You may need to change the driver to `i965` by adding the following environment variable `LIBVA_DRIVER_NAME=i965` to your docker-compose file or [in the `frigate.yaml` for HA OS users](advanced.md#environment_vars).
:::
### Via Quicksync (>=10th Generation only)
@@ -130,7 +166,11 @@ Depending on your OS and kernel configuration, you may need to change the `/proc
VAAPI supports automatic profile selection so it will work automatically with both H.264 and H.265 streams.
**Note:** You also need to set `LIBVA_DRIVER_NAME=radeonsi` as an environment variable on the container.
:::note
You need to change the driver to `radeonsi` by adding the following environment variable `LIBVA_DRIVER_NAME=radeonsi` to your docker-compose file or [in the `frigate.yaml` for HA OS users](advanced.md#environment_vars).
:::
```yaml
ffmpeg:
@@ -246,12 +286,12 @@ These instructions were originally based on the [Jellyfin documentation](https:/
# Community Supported
## NVIDIA Jetson (Orin AGX, Orin NX, Orin Nano*, Xavier AGX, Xavier NX, TX2, TX1, Nano)
## NVIDIA Jetson (Orin AGX, Orin NX, Orin Nano\*, Xavier AGX, Xavier NX, TX2, TX1, Nano)
A separate set of docker images is available that is based on Jetpack/L4T. They comes with an `ffmpeg` build
A separate set of docker images is available that is based on Jetpack/L4T. They come with an `ffmpeg` build
with codecs that use the Jetson's dedicated media engine. If your Jetson host is running Jetpack 4.6, use the
`frigate-tensorrt-jp4` image, or if your Jetson host is running Jetpack 5.0+, use the `frigate-tensorrt-jp5`
image. Note that the Orin Nano has no video encoder, so frigate will use software encoding on this platform,
`stable-tensorrt-jp4` tagged image, or if your Jetson host is running Jetpack 5.0+, use the `stable-tensorrt-jp5`
tagged image. Note that the Orin Nano has no video encoder, so frigate will use software encoding on this platform,
but the image will still allow hardware decoding and tensorrt object detection.
You will need to use the image with the nvidia container runtime:
@@ -262,7 +302,7 @@ You will need to use the image with the nvidia container runtime:
docker run -d \
...
--runtime nvidia
ghcr.io/blakeblackshear/frigate-tensorrt-jp5
ghcr.io/blakeblackshear/frigate:stable-tensorrt-jp5
```
### Docker Compose - Jetson
@@ -272,7 +312,7 @@ version: '2.4'
services:
frigate:
...
image: ghcr.io/blakeblackshear/frigate-tensorrt-jp5
image: ghcr.io/blakeblackshear/frigate:stable-tensorrt-jp5
runtime: nvidia # Add this
```
@@ -319,3 +359,59 @@ ffmpeg:
If everything is working correctly, you should see a significant reduction in ffmpeg CPU load and power consumption.
Verify that hardware decoding is working by running `jtop` (`sudo pip3 install -U jetson-stats`), which should show
that NVDEC/NVDEC1 are in use.
## Rockchip platform
Hardware accelerated video de-/encoding is supported on all Rockchip SoCs using [Nyanmisaka's FFmpeg Fork](https://github.com/nyanmisaka/ffmpeg-rockchip) based on [Rockchip's mpp library](https://github.com/rockchip-linux/mpp).
### Prerequisites
Make sure that you use a linux distribution that comes with the rockchip BSP kernel 5.10 or 6.1 and rkvdec2 driver. To check, enter the following commands:
```
$ uname -r
5.10.xxx-rockchip # or 6.1.xxx; the -rockchip suffix is important
$ ls /dev/dri
by-path card0 card1 renderD128 renderD129 # should list renderD128
```
I recommend [Joshua Riek's Ubuntu for Rockchip](https://github.com/Joshua-Riek/ubuntu-rockchip), if your board is supported.
### Setup
Follow Frigate's default installation instructions, but use a docker image with `-rk` suffix for example `ghcr.io/blakeblackshear/frigate:stable-rk`.
Next, you need to grant docker permissions to access your hardware:
- During the configuration process, you should run docker in privileged mode to avoid any errors due to insufficient permissions. To do so, add `privileged: true` to your `docker-compose.yml` file or the `--privileged` flag to your docker run command.
- After everything works, you should only grant necessary permissions to increase security. Add the lines below to your `docker-compose.yml` file or the following options to your docker run command: `--security-opt systempaths=unconfined --security-opt apparmor=unconfined --device /dev/dri:/dev/dri --device /dev/dma_heap:/dev/dma_heap --device /dev/rga:/dev/rga --device /dev/mpp_service:/dev/mpp_service`:
```yaml
security_opt:
- apparmor=unconfined
- systempaths=unconfined
devices:
- /dev/dri:/dev/dri
- /dev/dma_heap:/dev/dma_heap
- /dev/rga:/dev/rga
- /dev/mpp_service:/dev/mpp_service
```
### Configuration
Add one of the following FFmpeg presets to your `config.yaml` to enable hardware video processing:
```yaml
# if you try to decode a h264 encoded stream
ffmpeg:
hwaccel_args: preset-rk-h264
# if you try to decode a h265 (hevc) encoded stream
ffmpeg:
hwaccel_args: preset-rk-h265
```
:::note
Make sure that your SoC supports hardware acceleration for your input stream. For example, if your camera streams with h265 encoding and a 4k resolution, your SoC must be able to de- and encode h265 with a 4k resolution or higher. If you are unsure whether your SoC meets the requirements, take a look at the datasheet.
:::

View File

@@ -1,46 +1,35 @@
---
id: index
title: Frigate Configuration Reference
title: Frigate Configuration
---
For Home Assistant Addon installations, the config file needs to be in the root of your Home Assistant config directory (same location as `configuration.yaml`). It can be named `frigate.yaml` or `frigate.yml`, but if both files exist `frigate.yaml` will be preferred and `frigate.yml` will be ignored.
For all other installation types, the config file should be mapped to `/config/config.yml` inside the container.
It is recommended to start with a minimal configuration and add to it as described in [this guide](../guides/getting_started.md):
It is recommended to start with a minimal configuration and add to it as described in [this guide](../guides/getting_started.md) and use the built in configuration editor in Frigate's UI which supports validation.
```yaml
mqtt:
host: mqtt.server.com
enabled: False
cameras:
back:
dummy_camera: # <--- this will be changed to your actual camera later
enabled: False
ffmpeg:
inputs:
- path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2
- path: rtsp://127.0.0.1:554/rtsp
roles:
- detect
```
### VSCode Configuration Schema
## VSCode Configuration Schema
VSCode (and VSCode addon) supports the JSON schemas which will automatically validate the config. This can be added by adding `# yaml-language-server: $schema=http://frigate_host:5000/api/config/schema.json` to the top of the config file. `frigate_host` being the IP address of Frigate or `ccab4aaf-frigate` if running in the addon.
VSCode supports JSON schemas for automatically validating configuration files. You can enable this feature by adding `# yaml-language-server: $schema=http://frigate_host:5000/api/config/schema.json` to the beginning of the configuration file. Replace `frigate_host` with the IP address or hostname of your Frigate server. If you're using both VSCode and Frigate as an add-on, you should use `ccab4aaf-frigate` instead. Make sure to expose the internal unauthenticated port `5000` when accessing the config from VSCode on another machine.
### Full configuration reference:
## Environment Variable Substitution
:::caution
It is not recommended to copy this full configuration file. Only specify values that are different from the defaults. Configuration options and default values may change in future versions.
:::
**Note:** The following values will be replaced at runtime by using environment variables
- `{FRIGATE_MQTT_USER}`
- `{FRIGATE_MQTT_PASSWORD}`
- `{FRIGATE_RTSP_USER}`
- `{FRIGATE_RTSP_PASSWORD}`
for example:
Frigate supports the use of environment variables starting with `FRIGATE_` **only** where specifically indicated in the [reference config](./reference.md). For example, the following values can be replaced at runtime by using environment variables:
```yaml
mqtt:
@@ -61,617 +50,187 @@ onvif:
```
```yaml
mqtt:
# Optional: Enable mqtt server (default: shown below)
enabled: True
# Required: host name
host: mqtt.server.com
# Optional: port (default: shown below)
port: 1883
# Optional: topic prefix (default: shown below)
# NOTE: must be unique if you are running multiple instances
topic_prefix: frigate
# Optional: client id (default: shown below)
# NOTE: must be unique if you are running multiple instances
client_id: frigate
# Optional: user
# NOTE: MQTT user can be specified with an environment variables that must begin with 'FRIGATE_'.
# e.g. user: '{FRIGATE_MQTT_USER}'
user: mqtt_user
# Optional: password
# NOTE: MQTT password can be specified with an environment variables that must begin with 'FRIGATE_'.
# e.g. password: '{FRIGATE_MQTT_PASSWORD}'
password: password
# Optional: tls_ca_certs for enabling TLS using self-signed certs (default: None)
tls_ca_certs: /path/to/ca.crt
# Optional: tls_client_cert and tls_client key in order to use self-signed client
# certificates (default: None)
# NOTE: certificate must not be password-protected
# do not set user and password when using a client certificate
tls_client_cert: /path/to/client.crt
tls_client_key: /path/to/client.key
# Optional: tls_insecure (true/false) for enabling TLS verification of
# the server hostname in the server certificate (default: None)
tls_insecure: false
# Optional: interval in seconds for publishing stats (default: shown below)
stats_interval: 60
# Optional: Detectors configuration. Defaults to a single CPU detector
detectors:
# Required: name of the detector
detector_name:
# Required: type of the detector
# Frigate provided types include 'cpu', 'edgetpu', 'openvino' and 'tensorrt' (default: shown below)
# Additional detector types can also be plugged in.
# Detectors may require additional configuration.
# Refer to the Detectors configuration page for more information.
type: cpu
# Optional: Database configuration
database:
# The path to store the SQLite DB (default: shown below)
path: /config/frigate.db
# Optional: model modifications
model:
# Optional: path to the model (default: automatic based on detector)
path: /edgetpu_model.tflite
# Optional: path to the labelmap (default: shown below)
labelmap_path: /labelmap.txt
# Required: Object detection model input width (default: shown below)
width: 320
# Required: Object detection model input height (default: shown below)
height: 320
# Optional: Object detection model input colorspace
# Valid values are rgb, bgr, or yuv. (default: shown below)
input_pixel_format: rgb
# Optional: Object detection model input tensor format
# Valid values are nhwc or nchw (default: shown below)
input_tensor: nhwc
# Optional: Object detection model type, currently only used with the OpenVINO detector
# Valid values are ssd, yolox, yolov5, or yolov8 (default: shown below)
model_type: ssd
# Optional: Label name modifications. These are merged into the standard labelmap.
labelmap:
2: vehicle
# Optional: Audio Events Configuration
# NOTE: Can be overridden at the camera level
audio:
# Optional: Enable audio events (default: shown below)
enabled: False
# Optional: Configure the amount of seconds without detected audio to end the event (default: shown below)
max_not_heard: 30
# Optional: Configure the min rms volume required to run audio detection (default: shown below)
# As a rule of thumb:
# - 200 - high sensitivity
# - 500 - medium sensitivity
# - 1000 - low sensitivity
min_volume: 500
# Optional: Types of audio to listen for (default: shown below)
listen:
- bark
- fire_alarm
- scream
- speech
- yell
# Optional: Filters to configure detection.
filters:
# Label that matches label in listen config.
speech:
# Minimum score that triggers an audio event (default: shown below)
threshold: 0.8
# Optional: logger verbosity settings
logger:
# Optional: Default log verbosity (default: shown below)
default: info
# Optional: Component specific logger overrides
logs:
frigate.event: debug
# Optional: set environment variables
environment_vars:
EXAMPLE_VAR: value
# Optional: birdseye configuration
# NOTE: Can (enabled, mode) be overridden at the camera level
birdseye:
# Optional: Enable birdseye view (default: shown below)
enabled: True
# Optional: Restream birdseye via RTSP (default: shown below)
# NOTE: Enabling this will set birdseye to run 24/7 which may increase CPU usage somewhat.
restream: False
# Optional: Width of the output resolution (default: shown below)
width: 1280
# Optional: Height of the output resolution (default: shown below)
height: 720
# Optional: Encoding quality of the mpeg1 feed (default: shown below)
# 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
quality: 8
# Optional: Mode of the view. Available options are: objects, motion, and continuous
# objects - cameras are included if they have had a tracked object within the last 30 seconds
# motion - cameras are included if motion was detected in the last 30 seconds
# continuous - all cameras are included always
mode: objects
# Optional: ffmpeg configuration
# More information about presets at https://docs.frigate.video/configuration/ffmpeg_presets
ffmpeg:
# Optional: global ffmpeg args (default: shown below)
global_args: -hide_banner -loglevel warning -threads 2
# 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: preset-rtsp-generic
# Optional: global output args
output_args:
# Optional: output args for detect streams (default: shown below)
detect: -threads 2 -f rawvideo -pix_fmt yuv420p
# Optional: output args for record streams (default: shown below)
record: preset-record-generic
# Optional: output args for rtmp streams (default: shown below)
rtmp: preset-rtmp-generic
# Optional: Time in seconds to wait before ffmpeg retries connecting to the camera. (default: shown below)
# If set too low, frigate will retry a connection to the camera's stream too frequently, using up the limited streams some cameras can allow at once
# If set too high, then if a ffmpeg crash or camera stream timeout occurs, you could potentially lose up to a maximum of retry_interval second(s) of footage
# NOTE: this can be a useful setting for Wireless / Battery cameras to reduce how much footage is potentially lost during a connection timeout.
retry_interval: 10
# Optional: Detect configuration
# NOTE: Can be overridden at the camera level
detect:
# Optional: width of the frame for the input with the detect role (default: shown below)
width: 1280
# Optional: height of the frame for the input with the detect role (default: shown below)
height: 720
# Optional: desired fps for your camera for the input with the detect role (default: shown below)
# NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
fps: 5
# Optional: enables detection for the camera (default: True)
enabled: True
# Optional: Number of frames without a detection before Frigate considers an object to be gone. (default: 5x the frame rate)
max_disappeared: 25
# Optional: Configuration for stationary object tracking
stationary:
# Optional: Frequency for confirming stationary objects (default: same as threshold)
# When set to 1, object detection will run to confirm the object still exists on every frame.
# If set to 10, object detection will run to confirm the object still exists on every 10th frame.
interval: 50
# Optional: Number of frames without a position change for an object to be considered stationary (default: 10x the frame rate or 10s)
threshold: 50
# Optional: Define a maximum number of frames for tracking a stationary object (default: not set, track forever)
# This can help with false positives for objects that should only be stationary for a limited amount of time.
# It can also be used to disable stationary object tracking. For example, you may want to set a value for person, but leave
# car at the default.
# WARNING: Setting these values overrides default behavior and disables stationary object tracking.
# There are very few situations where you would want it disabled. It is NOT recommended to
# copy these values from the example config into your config unless you know they are needed.
max_frames:
# Optional: Default for all object types (default: not set, track forever)
default: 3000
# Optional: Object specific values
objects:
person: 1000
# Optional: Milliseconds to offset detect annotations by (default: shown below).
# There can often be latency between a recording and the detect process,
# especially when using separate streams for detect and record.
# Use this setting to make the timeline bounding boxes more closely align
# with the recording. The value can be positive or negative.
# TIP: Imagine there is an event clip with a person walking from left to right.
# If the event timeline bounding box is consistently to the left of the person
# then the value should be decreased. Similarly, if a person is walking from
# left to right and the bounding box is consistently ahead of the person
# then the value should be increased.
# TIP: This offset is dynamic so you can change the value and it will update existing
# events, this makes it easy to tune.
# WARNING: Fast moving objects will likely not have the bounding box align.
annotation_offset: 0
# Optional: Object configuration
# NOTE: Can be overridden at the camera level
objects:
# Optional: list of objects to track from labelmap.txt (default: shown below)
track:
- person
# 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
# 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 width/height of the bounding box for the detected object (default: 0)
min_ratio: 0.5
# Optional: maximum width/height of the bounding box for the detected object (default: 24000000)
max_ratio: 2.0
# 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
# 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
# Optional: Motion configuration
# NOTE: Can be overridden 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: 30
# Optional: The percentage of the image used to detect lightning or other substantial changes where motion detection
# needs to recalibrate. (default: shown below)
# Increasing this value will make motion detection more likely to consider lightning or ir mode changes as valid motion.
# Decreasing this value will make motion detection more likely to ignore large amounts of motion such as a person approaching
# a doorbell camera.
lightning_threshold: 0.8
# Optional: Minimum size in pixels in the resized motion image that counts as motion (default: shown below)
# Increasing this value will prevent smaller areas of motion from being detected. Decreasing will
# make motion detection more sensitive to smaller moving objects.
# As a rule of thumb:
# - 10 - high sensitivity
# - 30 - medium sensitivity
# - 50 - low sensitivity
contour_area: 10
# 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.01
# Optional: Height of the resized motion frame (default: 100)
# 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: 100
# Optional: motion mask
# NOTE: see docs for more detailed info on creating masks
mask: 0,900,1080,900,1080,1920,0,1920
# Optional: improve contrast (default: shown below)
# Enables dynamic contrast improvement. This should help improve night detections at the cost of making motion detection more sensitive
# for daytime.
improve_contrast: True
# Optional: Delay when updating camera motion through MQTT from ON -> OFF (default: shown below).
mqtt_off_delay: 30
# Optional: Record configuration
# NOTE: Can be overridden at the camera level
record:
# Optional: Enable recording (default: shown below)
# WARNING: If recording is disabled in the config, turning it on via
# the UI or MQTT later will have no effect.
enabled: False
# Optional: Number of minutes to wait between cleanup runs (default: shown below)
# This can be used to reduce the frequency of deleting recording segments from disk if you want to minimize i/o
expire_interval: 60
# Optional: Sync recordings with disk on startup (default: shown below).
sync_on_startup: False
# Optional: Retention settings for recording
retain:
# Optional: Number of days to retain recordings regardless of events (default: shown below)
# NOTE: This should be set to 0 and retention should be defined in events section below
# if you only want to retain recordings of events.
days: 0
# Optional: Mode for retention. Available options are: all, motion, and active_objects
# all - save all recording segments regardless of activity
# motion - save all recordings segments with any detected motion
# active_objects - save all recording segments with active/moving objects
# NOTE: this mode only applies when the days setting above is greater than 0
mode: all
# Optional: Recording Export Settings
export:
# Optional: Timelapse Output Args (default: shown below).
# NOTE: The default args are set to fit 24 hours of recording into 1 hour playback.
# See https://stackoverflow.com/a/58268695 for more info on how these args work.
# As an example: if you wanted to go from 24 hours to 30 minutes that would be going
# from 86400 seconds to 1800 seconds which would be 1800 / 86400 = 0.02.
# The -r (framerate) dictates how smooth the output video is.
# So the args would be -vf setpts=0.02*PTS -r 30 in that case.
timelapse_args: "-vf setpts=0.04*PTS -r 30"
# Optional: Event recording settings
events:
# Optional: Number of seconds before the event to include (default: shown below)
pre_capture: 5
# Optional: Number of seconds after the event to include (default: shown below)
post_capture: 5
# Optional: Objects to save recordings for. (default: all tracked objects)
objects:
- person
# Optional: Restrict recordings to objects that entered any of the listed zones (default: no required zones)
required_zones: []
# Optional: Retention settings for recordings of events
retain:
# Required: Default retention days (default: shown below)
default: 10
# Optional: Mode for retention. (default: shown below)
# all - save all recording segments for events regardless of activity
# motion - save all recordings segments for events with any detected motion
# active_objects - save all recording segments for event with active/moving objects
#
# NOTE: If the retain mode for the camera is more restrictive than the mode configured
# here, the segments will already be gone by the time this mode is applied.
# For example, if the camera retain mode is "motion", the segments without motion are
# never stored, so setting the mode to "all" here won't bring them back.
mode: motion
# Optional: Per object retention days
objects:
person: 15
# Optional: Configuration for the jpg snapshots written to the clips directory for each event
# NOTE: Can be overridden at the camera level
snapshots:
# Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
enabled: False
# Optional: save a clean PNG copy of the snapshot image (default: shown below)
clean_copy: True
# 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
# Optional: quality of the encoded jpeg, 0-100 (default: shown below)
quality: 70
# Optional: RTMP configuration
# NOTE: RTMP is deprecated in favor of restream
# NOTE: Can be overridden at the camera level
rtmp:
# Optional: Enable the RTMP stream (default: False)
enabled: False
# Optional: Restream configuration
# Uses https://github.com/AlexxIT/go2rtc (v1.8.1)
go2rtc:
# Optional: jsmpeg stream configuration for WebUI
live:
# Optional: Set the name of the stream that should be used for live view
# in frigate WebUI. (default: name of camera)
stream_name: camera_name
# Optional: Set the height of the jsmpeg stream. (default: 720)
# This must be less than or equal to the height of the detect stream. Lower resolutions
# reduce bandwidth required for viewing the jsmpeg stream. Width is computed to match known aspect ratio.
height: 720
# Optional: Set the encode quality of the jsmpeg stream (default: shown below)
# 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
quality: 8
# Optional: in-feed timestamp style configuration
# NOTE: Can be overridden at the camera level
timestamp_style:
# Optional: Position of the timestamp (default: shown below)
# "tl" (top left), "tr" (top right), "bl" (bottom left), "br" (bottom right)
position: "tl"
# Optional: Format specifier conform to the Python package "datetime" (default: shown below)
# Additional Examples:
# german: "%d.%m.%Y %H:%M:%S"
format: "%m/%d/%Y %H:%M:%S"
# Optional: Color of font
color:
# All Required when color is specified (default: shown below)
red: 255
green: 255
blue: 255
# Optional: Line thickness of font (default: shown below)
thickness: 2
# Optional: Effect of lettering (default: shown below)
# None (No effect),
# "solid" (solid background in inverse color of font)
# "shadow" (shadow for font)
effect: None
# Required
cameras:
# Required: name of the camera
back:
# Optional: Enable/Disable the camera (default: shown below).
# If disabled: config is used but no live stream and no capture etc.
# Events/Recordings are still viewable.
enabled: True
# 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: path may include environment variables, which must begin with 'FRIGATE_' and 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: audio,detect,record,rtmp
# NOTICE: In addition to assigning the audio, record, and rtmp roles,
# they must also be enabled in the camera config.
roles:
- audio
- detect
- record
- 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:
# Optional: timeout for highest scoring image before allowing it
# to be replaced by a newer image. (default: shown below)
best_image_timeout: 60
# 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: Presence in a zone is evaluated only based on the bottom center of the objects bounding box.
coordinates: 545,1077,747,939,788,805
# Optional: Number of consecutive frames required for object to be considered present in the zone (default: shown below).
inertia: 3
# Optional: List of objects that can trigger this zone (default: all tracked objects)
objects:
- person
# 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
# 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: jpeg encode quality (default: shown below)
quality: 70
# Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
required_zones: []
# Optional: Configuration for how camera is handled in the GUI.
ui:
# Optional: Adjust sort order of cameras in the UI. Larger numbers come later (default: shown below)
# By default the cameras are sorted alphabetically.
order: 0
# Optional: Whether or not to show the camera in the Frigate UI (default: shown below)
dashboard: True
# Optional: connect to ONVIF camera
# to enable PTZ controls.
onvif:
# Required: host of the camera being connected to.
host: 0.0.0.0
# Optional: ONVIF port for device (default: shown below).
port: 8000
# Optional: username for login.
# NOTE: Some devices require admin to access ONVIF.
user: admin
# Optional: password for login.
password: admin
# Optional: PTZ camera object autotracking. Keeps a moving object in
# the center of the frame by automatically moving the PTZ camera.
autotracking:
# Optional: enable/disable object autotracking. (default: shown below)
enabled: False
# Optional: calibrate the camera on startup (default: shown below)
# A calibration will move the PTZ in increments and measure the time it takes to move.
# The results are used to help estimate the position of tracked objects after a camera move.
# Frigate will update your config file automatically after a calibration with
# a "movement_weights" entry for the camera. You should then set calibrate_on_startup to False.
calibrate_on_startup: False
# Optional: the mode to use for zooming in/out on objects during autotracking. (default: shown below)
# Available options are: disabled, absolute, and relative
# disabled - don't zoom in/out on autotracked objects, use pan/tilt only
# absolute - use absolute zooming (supported by most PTZ capable cameras)
# relative - use relative zooming (not supported on all PTZs, but makes concurrent pan/tilt/zoom movements)
zooming: disabled
# Optional: A value to change the behavior of zooming on autotracked objects. (default: shown below)
# A lower value will keep more of the scene in view around a tracked object.
# A higher value will zoom in more on a tracked object, but Frigate may lose tracking more quickly.
# The value should be between 0.1 and 0.75
zoom_factor: 0.3
# Optional: list of objects to track from labelmap.txt (default: shown below)
track:
- person
# Required: Begin automatically tracking an object when it enters any of the listed zones.
required_zones:
- zone_name
# Required: Name of ONVIF preset in camera's firmware to return to when tracking is over. (default: shown below)
return_preset: home
# Optional: Seconds to delay before returning to preset. (default: shown below)
timeout: 10
# Optional: Values generated automatically by a camera calibration. Do not modify these manually. (default: shown below)
movement_weights: []
# Optional: Configuration for how to sort the cameras in the Birdseye view.
birdseye:
# Optional: Adjust sort order of cameras in the Birdseye view. Larger numbers come later (default: shown below)
# By default the cameras are sorted alphabetically.
order: 0
# Optional
ui:
# Optional: Set the default live mode for cameras in the UI (default: shown below)
live_mode: mse
# Optional: Set a timezone to use in the UI (default: use browser local time)
# timezone: America/Denver
# Optional: Use an experimental recordings / camera view UI (default: shown below)
use_experimental: False
# Optional: Set the time format used.
# Options are browser, 12hour, or 24hour (default: shown below)
time_format: browser
# Optional: Set the date style for a specified length.
# Options are: full, long, medium, short
# Examples:
# short: 2/11/23
# medium: Feb 11, 2023
# full: Saturday, February 11, 2023
# (default: shown below).
date_style: short
# Optional: Set the time style for a specified length.
# Options are: full, long, medium, short
# Examples:
# short: 8:14 PM
# medium: 8:15:22 PM
# full: 8:15:22 PM Mountain Standard Time
# (default: shown below).
time_style: medium
# Optional: Ability to manually override the date / time styling to use strftime format
# https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html
# possible values are shown above (default: not set)
strftime_fmt: "%Y/%m/%d %H:%M"
# Optional: Telemetry configuration
telemetry:
# Optional: Enabled network interfaces for bandwidth stats monitoring (default: empty list, let nethogs search all)
network_interfaces:
- eth
- enp
- eno
- ens
- wl
- lo
# Optional: Configure system stats
stats:
# Enable AMD GPU stats (default: shown below)
amd_gpu_stats: True
# Enable Intel GPU stats (default: shown below)
intel_gpu_stats: True
# Enable network bandwidth stats monitoring for camera ffmpeg processes, go2rtc, and object detectors. (default: shown below)
# NOTE: The container must either be privileged or have cap_net_admin, cap_net_raw capabilities enabled.
network_bandwidth: False
# Optional: Enable the latest version outbound check (default: shown below)
# NOTE: If you use the HomeAssistant integration, disabling this will prevent it from reporting new versions
version_check: True
rtsp:
username: "{FRIGATE_GO2RTC_RTSP_USERNAME}"
password: "{FRIGATE_GO2RTC_RTSP_PASSWORD}"
```
## Common configuration examples
Here are some common starter configuration examples. Refer to the [reference config](./reference.md) for detailed information about all the config values.
### Raspberry Pi Home Assistant Addon with USB Coral
- Single camera with 720p, 5fps stream for detect
- MQTT connected to home assistant mosquitto addon
- Hardware acceleration for decoding video
- USB Coral detector
- Save all video with any detectable motion for 7 days regardless of whether any objects were detected or not
- Continue to keep all video if it was during any event for 30 days
- Save snapshots for 30 days
- Motion mask for the camera timestamp
```yaml
mqtt:
host: core-mosquitto
user: mqtt-user
password: xxxxxxxxxx
ffmpeg:
hwaccel_args: preset-rpi-64-h264
detectors:
coral:
type: edgetpu
device: usb
record:
enabled: True
retain:
days: 7
mode: motion
events:
retain:
default: 30
mode: motion
snapshots:
enabled: True
retain:
default: 30
cameras:
name_of_your_camera:
detect:
width: 1280
height: 720
fps: 5
ffmpeg:
inputs:
- path: rtsp://10.0.10.10:554/rtsp
roles:
- detect
motion:
mask:
- 0.000,0.427,0.002,0.000,0.999,0.000,0.999,0.781,0.885,0.456,0.700,0.424,0.701,0.311,0.507,0.294,0.453,0.347,0.451,0.400
```
### Standalone Intel Mini PC with USB Coral
- Single camera with 720p, 5fps stream for detect
- MQTT disabled (not integrated with home assistant)
- VAAPI hardware acceleration for decoding video
- USB Coral detector
- Save all video with any detectable motion for 7 days regardless of whether any objects were detected or not
- Continue to keep all video if it was during any event for 30 days
- Save snapshots for 30 days
- Motion mask for the camera timestamp
```yaml
mqtt:
enabled: False
ffmpeg:
hwaccel_args: preset-vaapi
detectors:
coral:
type: edgetpu
device: usb
record:
enabled: True
retain:
days: 7
mode: motion
events:
retain:
default: 30
mode: motion
snapshots:
enabled: True
retain:
default: 30
cameras:
name_of_your_camera:
detect:
width: 1280
height: 720
fps: 5
ffmpeg:
inputs:
- path: rtsp://10.0.10.10:554/rtsp
roles:
- detect
motion:
mask:
- 0.000,0.427,0.002,0.000,0.999,0.000,0.999,0.781,0.885,0.456,0.700,0.424,0.701,0.311,0.507,0.294,0.453,0.347,0.451,0.400
```
### Home Assistant integrated Intel Mini PC with OpenVino
- Single camera with 720p, 5fps stream for detect
- MQTT connected to same mqtt server as home assistant
- VAAPI hardware acceleration for decoding video
- OpenVino detector
- Save all video with any detectable motion for 7 days regardless of whether any objects were detected or not
- Continue to keep all video if it was during any event for 30 days
- Save snapshots for 30 days
- Motion mask for the camera timestamp
```yaml
mqtt:
host: 192.168.X.X # <---- same mqtt broker that home assistant uses
user: mqtt-user
password: xxxxxxxxxx
ffmpeg:
hwaccel_args: preset-vaapi
detectors:
ov:
type: openvino
device: AUTO
model:
path: /openvino-model/ssdlite_mobilenet_v2.xml
model:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
record:
enabled: True
retain:
days: 7
mode: motion
events:
retain:
default: 30
mode: motion
snapshots:
enabled: True
retain:
default: 30
cameras:
name_of_your_camera:
detect:
width: 1280
height: 720
fps: 5
ffmpeg:
inputs:
- path: rtsp://10.0.10.10:554/rtsp
roles:
- detect
motion:
mask:
- 0.000,0.427,0.002,0.000,0.999,0.000,0.999,0.781,0.885,0.456,0.700,0.424,0.701,0.311,0.507,0.294,0.453,0.347,0.451,0.400
```

View File

@@ -3,17 +3,17 @@ id: live
title: Live View
---
Frigate has different live view options, some of which require the bundled `go2rtc` to be configured as shown in the [step by step guide](/guides/configuring_go2rtc).
Frigate intelligently displays your camera streams on the Live view dashboard. Your camera images update once per minute when no detectable activity is occurring to conserve bandwidth and resources. As soon as any motion is detected, cameras seamlessly switch to a live stream.
## Live View Options
## Live View technologies
Live view options can be selected while viewing the live stream. The options are:
Frigate intelligently uses three different streaming technologies to display your camera streams. The highest quality and fluency of the Live view requires the bundled `go2rtc` to be configured as shown in the [step by step guide](/guides/configuring_go2rtc).
| Source | Latency | Frame Rate | Resolution | Audio | Requires go2rtc | Other Limitations |
| ------ | ------- | ------------------------------------- | -------------- | ---------------------------- | --------------- | ------------------------------------------------- |
| jsmpeg | low | same as `detect -> fps`, capped at 10 | same as detect | no | no | none |
| mse | low | native | native | yes (depends on audio codec) | yes | iPhone requires iOS 17.1+, Firefox is h.264 only |
| webrtc | lowest | native | native | yes (depends on audio codec) | yes | requires extra config, doesn't support h.265 |
| Source | Latency | Frame Rate | Resolution | Audio | Requires go2rtc | Other Limitations |
| ------ | ------- | ------------------------------------- | -------------- | ---------------------------- | --------------- | ------------------------------------------------ |
| jsmpeg | low | same as `detect -> fps`, capped at 10 | same as detect | no | no | none |
| mse | low | native | native | yes (depends on audio codec) | yes | iPhone requires iOS 17.1+, Firefox is h.264 only |
| webrtc | lowest | native | native | yes (depends on audio codec) | yes | requires extra config, doesn't support h.265 |
### Audio Support
@@ -79,7 +79,7 @@ WebRTC works by creating a TCP or UDP connection on port `8555`. However, it req
- stun:8555
```
- For access through Tailscale, the Frigate system's Tailscale IP must be added as a WebRTC candidate. Tailscale IPs all start with `100.`, and are reserved within the `100.0.0.0/8` CIDR block.
- For access through Tailscale, the Frigate system's Tailscale IP must be added as a WebRTC candidate. Tailscale IPs all start with `100.`, and are reserved within the `100.64.0.0/10` CIDR block.
:::tip
@@ -104,6 +104,7 @@ If you are having difficulties getting WebRTC to work and you are running Frigat
If not running in host mode, port 8555 will need to be mapped for the container:
docker-compose.yml
```yaml
services:
frigate:
@@ -115,4 +116,4 @@ services:
:::
See [go2rtc WebRTC docs](https://github.com/AlexxIT/go2rtc/tree/v1.8.1#module-webrtc) for more information about this.
See [go2rtc WebRTC docs](https://github.com/AlexxIT/go2rtc/tree/v1.8.3#module-webrtc) for more information about this.

View File

@@ -3,41 +3,49 @@ id: masks
title: Masks
---
There are two types of masks available:
## Motion masks
**Motion masks**: Motion masks are used to prevent unwanted types of motion from triggering detection. Try watching the debug 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.
Motion masks are used to prevent unwanted types of motion from triggering detection. Try watching the Debug feed (Settings --> Debug) 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._
**Object filter masks**: Object filter masks are used to filter out false positives for a given object type based on location. 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.
See [further clarification](#further-clarification) below on why you may not want to use a motion mask.
## Object filter masks
Object filter masks are used to filter out false positives for a given object type based on location. 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 filter masks can be used to filter out stubborn false positives in fixed locations. For example, the base of this tree may be frequently detected as a person. The following image shows an example of an object filter mask (shaded red area) over the location where the bottom center is typically located to filter out person detections in a precise location.
![object mask](/img/bottom-center-mask.jpg)
## Using the mask creator
To create a poly mask:
1. Visit the Web UI
1. Click the camera you wish to create a mask for
1. Select "Debug" at the top
1. Expand the "Options" below the video feed
1. Click "Mask & Zone creator"
1. Click "Add" on the type of mask or zone you would like to create
1. Click on the camera's latest image to create a masked area. The yaml representation will be updated in real-time
1. When you've finished creating your mask, click "Copy" and paste the contents into your config file and restart Frigate
2. Click/tap the gear icon and open "Settings"
3. Select "Mask / zone editor"
4. At the top right, select the camera you wish to create a mask or zone for
5. Click the plus icon under the type of mask or zone you would like to create
6. Click on the camera's latest image to create the points for a masked area. Click the first point again to close the polygon.
7. When you've finished creating your mask, press Save.
8. Restart Frigate to apply your changes.
Example of a finished row corresponding to the below example image:
Your config file will be updated with the relative coordinates of the mask/zone:
```yaml
motion:
mask: "0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432"
mask: "0.000,0.427,0.002,0.000,0.999,0.000,0.999,0.781,0.885,0.456,0.700,0.424,0.701,0.311,0.507,0.294,0.453,0.347,0.451,0.400"
```
Multiple masks can be listed.
Multiple masks can be listed in your config.
```yaml
motion:
mask:
- 458,1346,336,973,317,869,375,866,432
- 0,461,3,0,1919,0,1919,843,1699,492,1344
- 0.239,1.246,0.175,0.901,0.165,0.805,0.195,0.802
- 0.000,0.427,0.002,0.000,0.999,0.000,0.999,0.781,0.885,0.456
```
![poly](/img/example-mask-poly-min.png)
### Further Clarification
This is a response to a [question posed on reddit](https://www.reddit.com/r/homeautomation/comments/ppxdve/replacing_my_doorbell_with_a_security_camera_a_6/hd876w4?utm_source=share&utm_medium=web2x&context=3):

View File

@@ -0,0 +1,101 @@
---
id: motion_detection
title: Motion Detection
---
# Tuning Motion Detection
Frigate uses motion detection as a first line check to see if there is anything happening in the frame worth checking with object detection.
Once motion is detected, it tries to group up nearby areas of motion together in hopes of identifying a rectangle in the image that will capture the area worth inspecting. These are the red "motion boxes" you see in the debug viewer.
## The Goal
The default motion settings should work well for the majority of cameras, however there are cases where tuning motion detection can lead to better and more optimal results. Each camera has its own environment with different variables that affect motion, this means that the same motion settings will not fit all of your cameras.
Before tuning motion it is important to understand the goal. In an optimal configuration, motion from people and cars would be detected, but not grass moving, lighting changes, timestamps, etc. If your motion detection is too sensitive, you will experience higher CPU loads and greater false positives from the increased rate of object detection. If it is not sensitive enough, you will miss events.
## Create Motion Masks
First, mask areas with regular motion not caused by the objects you want to detect. The best way to find candidates for motion masks is by watching the debug stream with motion boxes enabled. Good use cases for motion masks are timestamps or tree limbs and large bushes that regularly move due to wind. When possible, avoid creating motion masks that would block motion detection for objects you want to track **even if they are in locations where you don't want events**. Motion masks should not be used to avoid detecting objects in specific areas. More details can be found [in the masks docs.](/configuration/masks.md).
## Prepare For Testing
The easiest way to tune motion detection is to use the Frigate UI under Settings > Motion Tuner. This screen allows the changing of motion detection values live to easily see the immediate effect on what is detected as motion.
## Tuning Motion Detection During The Day
Now that things are set up, find a time to tune that represents normal circumstances. For example, if you tune your motion on a day that is sunny and windy you may find later that the motion settings are not sensitive enough on a cloudy and still day.
:::note
Remember that motion detection is just used to determine when object detection should be used. You should aim to have motion detection sensitive enough that you won't miss events from objects you want to detect with object detection. The goal is to prevent object detection from running constantly for every small pixel change in the image. Windy days are still going to result in lots of motion being detected.
:::
### Threshold
The threshold value dictates how much of a change in a pixels luminance is required to be considered motion.
```yaml
# default threshold value
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: 30
```
Lower values mean motion detection is more sensitive to changes in color, making it more likely for example to detect motion when a brown dogs blends in with a brown fence or a person wearing a red shirt blends in with a red car. If the threshold is too low however, it may detect things like grass blowing in the wind, shadows, etc. to be detected as motion.
Watching the motion boxes in the debug view, increase the threshold until you only see motion that is visible to the eye. Once this is done, it is important to test and ensure that desired motion is still detected.
### Contour Area
```yaml
# default contour_area value
motion:
# Optional: Minimum size in pixels in the resized motion image that counts as motion (default: shown below)
# Increasing this value will prevent smaller areas of motion from being detected. Decreasing will
# make motion detection more sensitive to smaller moving objects.
# As a rule of thumb:
# - 10 - high sensitivity
# - 30 - medium sensitivity
# - 50 - low sensitivity
contour_area: 10
```
Once the threshold calculation is run, the pixels that have changed are grouped together. The contour area value is used to decide which groups of changed pixels qualify as motion. Smaller values are more sensitive meaning people that are far away, small animals, etc. are more likely to be detected as motion, but it also means that small changes in shadows, leaves, etc. are detected as motion. Higher values are less sensitive meaning these things won't be detected as motion but with the risk that desired motion won't be detected until closer to the camera.
Watching the motion boxes in the debug view, adjust the contour area until there are no motion boxes smaller than the smallest you'd expect frigate to detect something moving.
### Improve Contrast
At this point if motion is working as desired there is no reason to continue with tuning for the day. If you were unable to find a balance between desired and undesired motion being detected, you can try disabling improve contrast and going back to the threshold and contour area steps.
## Tuning Motion Detection During The Night
Once daytime motion detection is tuned, there is a chance that the settings will work well for motion detection during the night as well. If this is the case then the preferred settings can be written to the config file and left alone.
However, if the preferred day settings do not work well at night it is recommended to use HomeAssistant or some other solution to automate changing the settings. That way completely separate sets of motion settings can be used for optimal day and night motion detection.
## Tuning For Large Changes In Motion
```yaml
# default lightning_threshold:
motion:
# Optional: The percentage of the image used to detect lightning or other substantial changes where motion detection
# needs to recalibrate. (default: shown below)
# Increasing this value will make motion detection more likely to consider lightning or ir mode changes as valid motion.
# Decreasing this value will make motion detection more likely to ignore large amounts of motion such as a person approaching
# a doorbell camera.
lightning_threshold: 0.8
```
:::tip
Some cameras like doorbell cameras may have missed detections when someone walks directly in front of the camera and the lightning_threshold causes motion detection to be re-calibrated. In this case, it may be desirable to increase the `lightning_threshold` to ensure these events are not missed.
:::
Large changes in motion like PTZ moves and camera switches between Color and IR mode should result in no motion detection. This is done via the `lightning_threshold` configuration. It is defined as the percentage of the image used to detect lightning or other substantial changes where motion detection needs to recalibrate. Increasing this value will make motion detection more likely to consider lightning or IR mode changes as valid motion. Decreasing this value will make motion detection more likely to ignore large amounts of motion such as a person approaching a doorbell camera.

View File

@@ -5,12 +5,18 @@ title: Object Detectors
# Officially Supported Detectors
Frigate provides the following builtin detector types: `cpu`, `edgetpu`, `openvino`, and `tensorrt`. By default, Frigate will use a single CPU detector. Other detectors may require additional configuration as described below. When using multiple detectors they will run in dedicated processes, but pull from a common queue of detection requests from across all cameras.
Frigate provides the following builtin detector types: `cpu`, `edgetpu`, `openvino`, `tensorrt`, and `rknn`. By default, Frigate will use a single CPU detector. Other detectors may require additional configuration as described below. When using multiple detectors they will run in dedicated processes, but pull from a common queue of detection requests from across all cameras.
## CPU Detector (not recommended)
The CPU detector type runs a TensorFlow Lite model utilizing the CPU without hardware acceleration. It is recommended to use a hardware accelerated detector type instead for better performance. To configure a CPU based detector, set the `"type"` attribute to `"cpu"`.
:::tip
If you do not have GPU or Edge TPU hardware, using the [OpenVINO Detector](#openvino-detector) is often more efficient than using the CPU detector.
:::
The number of threads used by the interpreter can be specified using the `"num_threads"` attribute, and defaults to `3.`
A TensorFlow Lite model is provided in the container at `/cpu_model.tflite` and is used by this detector type by default. To provide your own model, bind mount the file into the container and provide the path with `model.path`.
@@ -29,14 +35,20 @@ detectors:
When using CPU detectors, you can add one CPU detector per camera. Adding more detectors than the number of cameras should not improve performance.
## Edge-TPU Detector
## Edge TPU Detector
The EdgeTPU detector type runs a TensorFlow Lite model utilizing the Google Coral delegate for hardware acceleration. To configure an EdgeTPU detector, set the `"type"` attribute to `"edgetpu"`.
The Edge TPU detector type runs a TensorFlow Lite model utilizing the Google Coral delegate for hardware acceleration. To configure an Edge TPU detector, set the `"type"` attribute to `"edgetpu"`.
The EdgeTPU device can be specified using the `"device"` attribute according to the [Documentation for the TensorFlow Lite Python API](https://coral.ai/docs/edgetpu/multiple-edgetpu/#using-the-tensorflow-lite-python-api). If not set, the delegate will use the first device it finds.
The Edge TPU device can be specified using the `"device"` attribute according to the [Documentation for the TensorFlow Lite Python API](https://coral.ai/docs/edgetpu/multiple-edgetpu/#using-the-tensorflow-lite-python-api). If not set, the delegate will use the first device it finds.
A TensorFlow Lite model is provided in the container at `/edgetpu_model.tflite` and is used by this detector type by default. To provide your own model, bind mount the file into the container and provide the path with `model.path`.
:::tip
See [common Edge TPU troubleshooting steps](/troubleshooting/edgetpu) if the Edge TPU is not detected.
:::
### Single USB Coral
```yaml
@@ -95,11 +107,11 @@ detectors:
## OpenVINO Detector
The OpenVINO detector type runs an OpenVINO IR model on Intel CPU, GPU and VPU hardware. To configure an OpenVINO detector, set the `"type"` attribute to `"openvino"`.
The OpenVINO detector type runs an OpenVINO IR model on AMD and Intel CPUs, Intel GPUs and Intel VPU hardware. To configure an OpenVINO detector, set the `"type"` attribute to `"openvino"`.
The OpenVINO device to be used is specified using the `"device"` attribute according to the naming conventions in the [Device Documentation](https://docs.openvino.ai/latest/openvino_docs_OV_UG_Working_with_devices.html). Other supported devices could be `AUTO`, `CPU`, `GPU`, `MYRIAD`, etc. If not specified, the default OpenVINO device will be selected by the `AUTO` plugin.
OpenVINO is supported on 6th Gen Intel platforms (Skylake) and newer. A supported Intel platform is required to use the `GPU` device with OpenVINO. The `MYRIAD` device may be run on any platform, including Arm devices. For detailed system requirements, see [OpenVINO System Requirements](https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/system-requirements.html)
OpenVINO is supported on 6th Gen Intel platforms (Skylake) and newer. It will also run on AMD CPUs despite having no official support for it. A supported Intel platform is required to use the `GPU` device with OpenVINO. The `MYRIAD` device may be run on any platform, including Arm devices. For detailed system requirements, see [OpenVINO System Requirements](https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/system-requirements.html)
An OpenVINO model is provided in the container at `/openvino-model/ssdlite_mobilenet_v2.xml` and is used by this detector type by default. The model comes from Intel's Open Model Zoo [SSDLite MobileNet V2](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/ssdlite_mobilenet_v2) and is converted to an FP16 precision IR model. Use the model configuration shown below when using the OpenVINO detector with the default model.
@@ -119,7 +131,7 @@ model:
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
```
This detector also supports some YOLO variants: YOLOX, YOLOv5, and YOLOv8 specifically. Other YOLO variants are not officially supported/tested. Frigate does not come with any yolo models preloaded, so you will need to supply your own models. This detector has been verified to work with the [yolox_tiny](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/yolox-tiny) model from Intel's Open Model Zoo. You can follow [these instructions](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/yolox-tiny#download-a-model-and-convert-it-into-openvino-ir-format) to retrieve the OpenVINO-compatible `yolox_tiny` model. Make sure that the model input dimensions match the `width` and `height` parameters, and `model_type` is set accordingly. See [Full Configuration Reference](/configuration/index.md#full-configuration-reference) for a list of possible `model_type` options. Below is an example of how `yolox_tiny` can be used in Frigate:
This detector also supports YOLOX. Other YOLO variants are not officially supported/tested. Frigate does not come with any yolo models preloaded, so you will need to supply your own models. This detector has been verified to work with the [yolox_tiny](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/yolox-tiny) model from Intel's Open Model Zoo. You can follow [these instructions](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/yolox-tiny#download-a-model-and-convert-it-into-openvino-ir-format) to retrieve the OpenVINO-compatible `yolox_tiny` model. Make sure that the model input dimensions match the `width` and `height` parameters, and `model_type` is set accordingly. See [Full Configuration Reference](/configuration/reference.md) for a list of possible `model_type` options. Below is an example of how `yolox_tiny` can be used in Frigate:
```yaml
detectors:
@@ -140,7 +152,7 @@ model:
### Intel NCS2 VPU and Myriad X Setup
Intel produces a neural net inference accelleration chip called Myriad X. This chip was sold in their Neural Compute Stick 2 (NCS2) which has been discontinued. If intending to use the MYRIAD device for accelleration, additional setup is required to pass through the USB device. The host needs a udev rule installed to handle the NCS2 device.
Intel produces a neural net inference acceleration chip called Myriad X. This chip was sold in their Neural Compute Stick 2 (NCS2) which has been discontinued. If intending to use the MYRIAD device for acceleration, additional setup is required to pass through the USB device. The host needs a udev rule installed to handle the NCS2 device.
```bash
sudo usermod -a -G users "$(whoami)"
@@ -170,7 +182,7 @@ volumes:
## NVidia TensorRT Detector
NVidia GPUs may be used for object detection using the TensorRT libraries. Due to the size of the additional libraries, this detector is only provided in images with the `-tensorrt` tag suffix. This detector is designed to work with Yolo models for object detection.
Nvidia GPUs may be used for object detection using the TensorRT libraries. Due to the size of the additional libraries, this detector is only provided in images with the `-tensorrt` tag suffix, e.g. `ghcr.io/blakeblackshear/frigate:stable-tensorrt`. This detector is designed to work with Yolo models for object detection.
### Minimum Hardware Support
@@ -192,7 +204,7 @@ There are improved capabilities in newer GPU architectures that TensorRT can ben
The model used for TensorRT must be preprocessed on the same hardware platform that they will run on. This means that each user must run additional setup to generate a model file for the TensorRT library. A script is included that will build several common models.
The Frigate image will generate model files during startup if the specified model is not found. Processed models are stored in the `/config/model_cache` folder. Typically the `/config` path is mapped to a directory on the host already and the `model_cache` does not need to be mapped separately unless the user wants to store it in a different location on the host.
The Frigate image will generate model files during startup if the specified model is not found. Processed models are stored in the `/config/model_cache` folder. Typically the `/config` path is mapped to a directory on the host already and the `model_cache` does not need to be mapped separately unless the user wants to store it in a different location on the host.
By default, the `yolov7-320` model will be generated, but this can be overridden by specifying the `YOLO_MODELS` environment variable in Docker. One or more models may be listed in a comma-separated format, and each one will be generated. To select no model generation, set the variable to an empty string, `YOLO_MODELS=""`. Models will only be generated if the corresponding `{model}.trt` file is not present in the `model_cache` folder, so you can force a model to be regenerated by deleting it from your Frigate data folder.
@@ -239,7 +251,7 @@ frigate:
- USE_FP16=false
```
If you have multiple GPUs passed through to Frigate, you can specify which one to use for the model conversion. The conversion script will use the first visible GPU, however in systems with mixed GPU models you may not want to use the default index for object detection. Add the `TRT_MODEL_PREP_DEVICE` environment variable to select a specific GPU.
If you have multiple GPUs passed through to Frigate, you can specify which one to use for the model conversion. The conversion script will use the first visible GPU, however in systems with mixed GPU models you may not want to use the default index for object detection. Add the `TRT_MODEL_PREP_DEVICE` environment variable to select a specific GPU.
```yml
frigate:
@@ -249,7 +261,7 @@ frigate:
### Configuration Parameters
The TensorRT detector can be selected by specifying `tensorrt` as the model type. The GPU will need to be passed through to the docker container using the same methods described in the [Hardware Acceleration](hardware_acceleration.md#nvidia-gpu) section. If you pass through multiple GPUs, you can select which GPU is used for a detector with the `device` configuration parameter. The `device` parameter is an integer value of the GPU index, as shown by `nvidia-smi` within the container.
The TensorRT detector can be selected by specifying `tensorrt` as the model type. The GPU will need to be passed through to the docker container using the same methods described in the [Hardware Acceleration](hardware_acceleration.md#nvidia-gpus) section. If you pass through multiple GPUs, you can select which GPU is used for a detector with the `device` configuration parameter. The `device` parameter is an integer value of the GPU index, as shown by `nvidia-smi` within the container.
The TensorRT detector uses `.trt` model files that are located in `/config/model_cache/tensorrt` by default. These model path and dimensions used will depend on which model you have generated.
@@ -289,5 +301,110 @@ Replace `<your_codeproject_ai_server_ip>` and `<port>` with the IP address and p
To verify that the integration is working correctly, start Frigate and observe the logs for any error messages related to CodeProject.AI. Additionally, you can check the Frigate web interface to see if the objects detected by CodeProject.AI are being displayed and tracked properly.
# Community Supported Detectors
## Rockchip platform
Hardware accelerated object detection is supported on the following SoCs:
- RK3562
- RK3566
- RK3568
- RK3576
- RK3588
This implementation uses the [Rockchip's RKNN-Toolkit2](https://github.com/airockchip/rknn-toolkit2/) Currently, only [Yolo-NAS](https://github.com/Deci-AI/super-gradients/blob/master/YOLONAS.md) is supported as object detection model.
### Prerequisites
Make sure that you use a linux distribution that comes with the rockchip BSP kernel 5.10 or 6.1 and rknpu driver. To check, enter the following commands:
```
$ uname -r
5.10.xxx-rockchip # or 6.1.xxx; the -rockchip suffix is important
$ ls /dev/dri
by-path card0 card1 renderD128 renderD129 # should list renderD129
$ sudo cat /sys/kernel/debug/rknpu/version
RKNPU driver: v0.9.2 # or later version
```
I recommend [Joshua Riek's Ubuntu for Rockchip](https://github.com/Joshua-Riek/ubuntu-rockchip), if your board is supported.
### Setup
Follow Frigate's default installation instructions, but use a docker image with `-rk` suffix for example `ghcr.io/blakeblackshear/frigate:stable-rk`.
Next, you need to grant docker permissions to access your hardware:
- During the configuration process, you should run docker in privileged mode to avoid any errors due to insufficient permissions. To do so, add `privileged: true` to your `docker-compose.yml` file or the `--privileged` flag to your docker run command.
- After everything works, you should only grant necessary permissions to increase security. Add the lines below to your `docker-compose.yml` file or the following options to your docker run command: `--security-opt systempaths=unconfined --security-opt apparmor=unconfined --device /dev/dri:/dev/dri`:
```yaml
security_opt:
- apparmor=unconfined
- systempaths=unconfined
devices:
- /dev/dri:/dev/dri
```
### Configuration
This `config.yml` shows all relevant options to configure the detector and explains them. All values shown are the default values (except for two). Lines that are required at least to use the detector are labeled as required, all other lines are optional.
```yaml
detectors: # required
rknn: # required
type: rknn # required
# number of NPU cores to use
# 0 means choose automatically
# increase for better performance if you have a multicore NPU e.g. set to 3 on rk3588
num_cores: 0
model: # required
# name of model (will be automatically downloaded) or path to your own .rknn model file
# possible values are:
# - deci-fp16-yolonas_s
# - deci-fp16-yolonas_m
# - deci-fp16-yolonas_l
# - /config/model_cache/your_custom_model.rknn
path: deci-fp16-yolonas_s
# width and height of detection frames
width: 320
height: 320
# pixel format of detection frame
# default value is rgb but yolo models usually use bgr format
input_pixel_format: bgr # required
# shape of detection frame
input_tensor: nhwc
```
### Choosing a model
:::warning
yolo-nas models use weights from DeciAI. These weights are subject to their license and can't be used commercially. For more information, see: https://docs.deci.ai/super-gradients/latest/LICENSE.YOLONAS.html
:::
The inference time was determined on a rk3588 with 3 NPU cores.
| Model | Size in mb | Inference time in ms |
| ------------------- | ---------- | -------------------- |
| deci-fp16-yolonas_s | 24 | 25 |
| deci-fp16-yolonas_m | 62 | 35 |
| deci-fp16-yolonas_l | 81 | 45 |
:::tip
You can get the load of your NPU with the following command:
```bash
$ cat /sys/kernel/debug/rknpu/load
>> NPU load: Core0: 0%, Core1: 0%, Core2: 0%,
```
:::
- By default the rknn detector uses the yolonas_s model (`model: path: default-fp16-yolonas_s`). This model comes with the image, so no further steps than those mentioned above are necessary and no download happens.
- The other choices are automatically downloaded and stored in the folder `config/model_cache/rknn_cache`. After upgrading Frigate, you should remove older models to free up space.
- Finally, you can also provide your own `.rknn` model. You should not save your own models in the `rknn_cache` folder, store them directly in the `model_cache` folder or another subfolder. To convert a model to `.rknn` format see the `rknn-toolkit2` (requires a x86 machine). Note, that there is only post-processing for the supported models.

View File

@@ -1,8 +1,10 @@
---
id: false_positives
title: Reducing false positives
id: object_filters
title: Filters
---
There are several types of object filters that can be used to reduce false positive rates.
## Object Scores
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:
@@ -18,6 +20,8 @@ For object filters in your configuration, any single detection below `min_score`
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.
show image of snapshot vs event with differing scores
### Minimum Score
Any detection below `min_score` will be immediately thrown out and never tracked because it is considered a false positive. If `min_score` is too low then false positives may be detected and tracked which can confuse the object tracker and may lead to wasted resources. If `min_score` is too high then lower scoring true positives like objects that are further away or partially occluded may be thrown out which can also confuse the tracker and cause valid events to be lost or disjointed.
@@ -36,7 +40,13 @@ False positives can also be reduced by filtering a detection based on its shape.
### Object Proportions
`min_ratio` and `max_ratio` filter on the ratio of width / height of an objects bounding box and can be used to reduce false positives. For example if a false positive is detected as very tall for a dog which is often wider, a `min_ratio` filter can be used to filter out these false positives.
`min_ratio` and `max_ratio` values are compared against a given detected object's width/height ratio (in pixels). If the ratio is outside this range, the object will be ignored as a false positive. This allows objects that are proportionally too short-and-wide (higher ratio) or too tall-and-narrow (smaller ratio) to be ignored.
:::info
Conceptually, a ratio of 1 is a square, 0.5 is a "tall skinny" box, and 2 is a "wide flat" box. If `min_ratio` is 1.0, any object that is taller than it is wide will be ignored. Similarly, if `max_ratio` is 1.0, then any object that is wider than it is tall will be ignored.
:::
## Other Tools

View File

@@ -1,15 +1,16 @@
---
id: objects
title: Objects
title: Available Objects
---
import labels from "../../../labelmap.txt";
Frigate includes the object models listed below from the Google Coral test data.
Please note:
- `car` is listed twice because `truck` has been renamed to `car` by default. These object types are frequently confused.
- `person` is the only tracked object by default. See the [full configuration reference](index.md#full-configuration-reference) for an example of expanding the list of tracked objects.
Please note:
- `car` is listed twice because `truck` has been renamed to `car` by default. These object types are frequently confused.
- `person` is the only tracked object by default. See the [full configuration reference](reference.md) for an example of expanding the list of tracked objects.
<ul>
{labels.split("\n").map((label) => (

View File

@@ -3,17 +3,90 @@ id: record
title: Recording
---
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. Each camera supports a configurable retention policy in the config. Frigate chooses the largest matching retention value between the recording retention and the event retention when determining if a recording should be removed.
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` in **UTC time**. These recordings are written directly from your camera stream without re-encoding. Each camera supports a configurable retention policy in the config. Frigate chooses the largest matching retention value between the recording retention and the event retention when determining if a recording should be removed.
New recording segments are written from the camera stream to cache, they are only moved to disk if they match the setup recording retention policy.
H265 recordings can be viewed in Chrome 108+, Edge and Safari only. All other browsers require recordings to be encoded with H264.
## Common recording configurations
### Most conservative: Ensure all video is saved
For users deploying Frigate in environments where it is important to have contiguous video stored even if there was no detectable motion, the following config will store all video for 3 days. After 3 days, only video containing motion and overlapping with events will be retained until 30 days have passed.
```yaml
record:
enabled: True
retain:
days: 3
mode: all
events:
retain:
default: 30
mode: motion
```
### Reduced storage: Only saving video when motion is detected
In order to reduce storage requirements, you can adjust your config to only retain video where motion was detected.
```yaml
record:
enabled: True
retain:
days: 3
mode: motion
events:
retain:
default: 30
mode: motion
```
### Minimum: Events only
If you only want to retain video that occurs during an event, this config will discard video unless an event is ongoing.
```yaml
record:
enabled: True
retain:
days: 0
mode: all
events:
retain:
default: 30
mode: motion
```
## Will Frigate delete old recordings if my storage runs out?
As of Frigate 0.12 if there is less than an hour left of storage, the oldest 2 hours of recordings will be deleted.
## What if I don't want 24/7 recordings?
## Configuring Recording Retention
Frigate supports both continuous and event based recordings with separate retention modes and retention periods.
:::tip
Retention configs support decimals meaning they can be configured to retain `0.5` days, for example.
:::
### Continuous Recording
The number of days to retain continuous recordings can be set via the following config where X is a number, by default continuous recording is disabled.
```yaml
record:
enabled: True
retain:
days: 1 # <- number of days to keep continuous recordings
```
Continuous recording supports different retention modes [which are described below](#what-do-the-different-retain-modes-mean)
### Event Recording
If you only used clips in previous versions with recordings disabled, you can use the following config to get the same behavior. This is also the default behavior when recordings are enabled.
@@ -22,34 +95,31 @@ record:
enabled: True
events:
retain:
default: 10
default: 10 # <- number of days to keep event recordings
```
This configuration will retain recording segments that overlap with events and have active tracked objects for 10 days. Because multiple events can reference the same recording segments, this avoids storing duplicate footage for overlapping events and reduces overall storage needs.
When `retain -> days` is set to `0`, segments will be deleted from the cache if no events are in progress.
## Can I have "24/7" recordings, but only at certain times?
Using Frigate UI, HomeAssistant, or MQTT, cameras can be automated to only record in certain situations or at certain times.
**WARNING**: Recordings still must be enabled in the config. If a camera has recordings disabled in the config, enabling via the methods listed above will have no effect.
## What do the different retain modes mean?
Frigate saves from the stream with the `record` role in 10 second segments. These options determine which recording segments are kept for 24/7 recording (but can also affect events).
Frigate saves from the stream with the `record` role in 10 second segments. These options determine which recording segments are kept for continuous recording (but can also affect events).
Let's say you have Frigate configured so that your doorbell camera would retain the last **2** days of continuous recording.
Let's say you have Frigate configured so that your doorbell camera would retain the last **2** days of 24/7 recording.
- With the `all` option all 48 hours of those two days would be kept and viewable.
- With the `motion` option the only parts of those 48 hours would be segments that Frigate detected motion. This is the middle ground option that won't keep all 48 hours, but will likely keep all segments of interest along with the potential for some extra segments.
- With the `active_objects` option the only segments that would be kept are those where there was a true positive object that was not considered stationary.
The same options are available with events. Let's consider a scenario where you drive up and park in your driveway, go inside, then come back out 4 hours later.
- With the `all` option all segments for the duration of the event would be saved for the event. This event would have 4 hours of footage.
- With the `motion` option all segments for the duration of the event with motion would be saved. This means any segment where a car drove by in the street, person walked by, lighting changed, etc. would be saved.
- With the `active_objects` it would only keep segments where the object was active. In this case the only segments that would be saved would be the ones where the car was driving up, you going inside, you coming outside, and the car driving away. Essentially reducing the 4 hours to a minute or two of event footage.
A configuration example of the above retain modes where all `motion` segments are stored for 7 days and `active objects` are stored for 14 days would be as follows:
```yaml
record:
enabled: True
@@ -61,11 +131,13 @@ record:
default: 14
mode: active_objects
```
The above configuration example can be added globally or on a per camera basis.
### Object Specific Retention
You can also set specific retention length for an object type. The below configuration example builds on from above but also specifies that recordings of dogs only need to be kept for 2 days and recordings of cars should be kept for 7 days.
```yaml
record:
enabled: True
@@ -81,17 +153,40 @@ record:
car: 7
```
## Can I have "continuous" recordings, but only at certain times?
Using Frigate UI, HomeAssistant, or MQTT, cameras can be automated to only record in certain situations or at certain times.
## How do I export recordings?
The export page in the Frigate WebUI allows for exporting real time clips with a designated start and stop time as well as exporting a timelapse for a designated start and stop time. These exports can take a while so it is important to leave the file until it is no longer in progress.
The export page in the Frigate WebUI allows for exporting real time clips with a designated start and stop time as well as exporting a time-lapse for a designated start and stop time. These exports can take a while so it is important to leave the file until it is no longer in progress.
## Syncing Recordings With Disk
### Time-lapse export
In some cases the recordings files may be deleted but Frigate will not know this has happened. Sync on startup can be enabled which will tell Frigate to check the file system and delete any db entries for files which don't exist.
When exporting a time-lapse the default speed-up is 25x with 30 FPS. This means that every 25 seconds of (real-time) recording is condensed into 1 second of time-lapse video (always without audio) with a smoothness of 30 FPS.
To configure the speed-up factor, the frame rate and further custom settings, the configuration parameter `timelapse_args` can be used. The below configuration example would change the time-lapse speed to 60x (for fitting 1 hour of recording into 1 minute of time-lapse) with 25 FPS:
```yaml
record:
sync_on_startup: True
enabled: True
export:
timelapse_args: "-vf setpts=PTS/60 -r 25"
```
:::tip
When using `hwaccel_args` globally hardware encoding is used for time lapse generation. The encoder determines its own behavior so the resulting file size may be undesirably large.
To reduce the output file size the ffmpeg parameter `-qp n` can be utilized (where `n` stands for the value of the quantisation parameter). The value can be adjusted to get an acceptable tradeoff between quality and file size for the given scenario.
:::
## Syncing Recordings With Disk
In some cases the recordings files may be deleted but Frigate will not know this has happened. Recordings sync can be enabled which will tell Frigate to check the file system and delete any db entries for files which don't exist.
```yaml
record:
sync_recordings: True
```
:::warning

View File

@@ -0,0 +1,713 @@
---
id: reference
title: Full Reference Config
---
### Full configuration reference:
:::warning
It is not recommended to copy this full configuration file. Only specify values that are different from the defaults. Configuration options and default values may change in future versions.
:::
```yaml
mqtt:
# Optional: Enable mqtt server (default: shown below)
enabled: True
# Required: host name
host: mqtt.server.com
# Optional: port (default: shown below)
port: 1883
# Optional: topic prefix (default: shown below)
# NOTE: must be unique if you are running multiple instances
topic_prefix: frigate
# Optional: client id (default: shown below)
# NOTE: must be unique if you are running multiple instances
client_id: frigate
# Optional: user
# NOTE: MQTT user can be specified with an environment variable or docker secrets that must begin with 'FRIGATE_'.
# e.g. user: '{FRIGATE_MQTT_USER}'
user: mqtt_user
# Optional: password
# NOTE: MQTT password can be specified with an environment variable or docker secrets that must begin with 'FRIGATE_'.
# e.g. password: '{FRIGATE_MQTT_PASSWORD}'
password: password
# Optional: tls_ca_certs for enabling TLS using self-signed certs (default: None)
tls_ca_certs: /path/to/ca.crt
# Optional: tls_client_cert and tls_client key in order to use self-signed client
# certificates (default: None)
# NOTE: certificate must not be password-protected
# do not set user and password when using a client certificate
tls_client_cert: /path/to/client.crt
tls_client_key: /path/to/client.key
# Optional: tls_insecure (true/false) for enabling TLS verification of
# the server hostname in the server certificate (default: None)
tls_insecure: false
# Optional: interval in seconds for publishing stats (default: shown below)
stats_interval: 60
# Optional: Detectors configuration. Defaults to a single CPU detector
detectors:
# Required: name of the detector
detector_name:
# Required: type of the detector
# Frigate provided types include 'cpu', 'edgetpu', 'openvino' and 'tensorrt' (default: shown below)
# Additional detector types can also be plugged in.
# Detectors may require additional configuration.
# Refer to the Detectors configuration page for more information.
type: cpu
# Optional: Database configuration
database:
# The path to store the SQLite DB (default: shown below)
path: /config/frigate.db
# Optional: Authentication configuration
auth:
# Optional: Authentication mode (default: shown below)
# Valid values are: native, proxy
mode: native
# Optional: Reset the admin user password on startup (default: shown below)
# New password is printed in the logs
reset_admin_password: False
# Optional: Cookie to store the JWT token for native auth (default: shown below)
cookie_name: frigate_token
# Optional: Set secure flag on cookie. (default: shown below)
# NOTE: This should be set to True if you are using TLS
cookie_secure: False
# Optional: Session length in seconds (default: shown below)
session_length: 86400 # 24 hours
# Optional: Refresh time in seconds (default: shown below)
# When the session is going to expire in less time than this setting,
# it will be refreshed back to the session_length.
refresh_time: 43200 # 12 hours
# Optional: Mapping for headers from upstream proxies. Only used in proxy auth mode.
# NOTE: Many authentication proxies pass a header downstream with the authenticated
# user name. Not all values are supported. It must be a whitelisted header.
# See the docs for more info.
header_map:
user: x-forwarded-user
# Optional: Rate limiting for login failures to help prevent brute force
# login attacks (default: shown below)
# See the docs for more information on valid values
failed_login_rate_limit: None
# Optional: Trusted proxies for determining IP address to rate limit
# NOTE: This is only used for rate limiting login attempts and does not bypass
# authentication in any way
trusted_proxies: []
# Optional: Url for logging out a user. This only needs to be set if you are using
# proxy mode.
logout_url: /api/logout
# Optional: Number of hashing iterations for user passwords
# As of Feb 2023, OWASP recommends 600000 iterations for PBKDF2-SHA256
# NOTE: changing this value will not automatically update password hashes, you
# will need to change each user password for it to apply
hash_iterations: 600000
# Optional: model modifications
model:
# Optional: path to the model (default: automatic based on detector)
path: /edgetpu_model.tflite
# Optional: path to the labelmap (default: shown below)
labelmap_path: /labelmap.txt
# Required: Object detection model input width (default: shown below)
width: 320
# Required: Object detection model input height (default: shown below)
height: 320
# Optional: Object detection model input colorspace
# Valid values are rgb, bgr, or yuv. (default: shown below)
input_pixel_format: rgb
# Optional: Object detection model input tensor format
# Valid values are nhwc or nchw (default: shown below)
input_tensor: nhwc
# Optional: Object detection model type, currently only used with the OpenVINO detector
# Valid values are ssd, yolox, yolonas (default: shown below)
model_type: ssd
# Optional: Label name modifications. These are merged into the standard labelmap.
labelmap:
2: vehicle
# Optional: Audio Events Configuration
# NOTE: Can be overridden at the camera level
audio:
# Optional: Enable audio events (default: shown below)
enabled: False
# Optional: Configure the amount of seconds without detected audio to end the event (default: shown below)
max_not_heard: 30
# Optional: Configure the min rms volume required to run audio detection (default: shown below)
# As a rule of thumb:
# - 200 - high sensitivity
# - 500 - medium sensitivity
# - 1000 - low sensitivity
min_volume: 500
# Optional: Types of audio to listen for (default: shown below)
listen:
- bark
- fire_alarm
- scream
- speech
- yell
# Optional: Filters to configure detection.
filters:
# Label that matches label in listen config.
speech:
# Minimum score that triggers an audio event (default: shown below)
threshold: 0.8
# Optional: logger verbosity settings
logger:
# Optional: Default log verbosity (default: shown below)
default: info
# Optional: Component specific logger overrides
logs:
frigate.event: debug
# Optional: set environment variables
environment_vars:
EXAMPLE_VAR: value
# Optional: birdseye configuration
# NOTE: Can (enabled, mode) be overridden at the camera level
birdseye:
# Optional: Enable birdseye view (default: shown below)
enabled: True
# Optional: Restream birdseye via RTSP (default: shown below)
# NOTE: Enabling this will set birdseye to run 24/7 which may increase CPU usage somewhat.
restream: False
# Optional: Width of the output resolution (default: shown below)
width: 1280
# Optional: Height of the output resolution (default: shown below)
height: 720
# Optional: Encoding quality of the mpeg1 feed (default: shown below)
# 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
quality: 8
# Optional: Mode of the view. Available options are: objects, motion, and continuous
# objects - cameras are included if they have had a tracked object within the last 30 seconds
# motion - cameras are included if motion was detected in the last 30 seconds
# continuous - all cameras are included always
mode: objects
# Optional: Threshold for camera activity to stop showing camera (default: shown below)
inactivity_threshold: 30
# Optional: Configure the birdseye layout
layout:
# Optional: Scaling factor for the layout calculator (default: shown below)
scaling_factor: 2.0
# Optional: Maximum number of cameras to show at one time, showing the most recent (default: show all cameras)
max_cameras: 1
# Optional: ffmpeg configuration
# More information about presets at https://docs.frigate.video/configuration/ffmpeg_presets
ffmpeg:
# Optional: global ffmpeg args (default: shown below)
global_args: -hide_banner -loglevel warning -threads 2
# Optional: global hwaccel args (default: auto detect)
# NOTE: See hardware acceleration docs for your specific device
hwaccel_args: "auto"
# Optional: global input args (default: shown below)
input_args: preset-rtsp-generic
# Optional: global output args
output_args:
# Optional: output args for detect streams (default: shown below)
detect: -threads 2 -f rawvideo -pix_fmt yuv420p
# Optional: output args for record streams (default: shown below)
record: preset-record-generic
# Optional: Time in seconds to wait before ffmpeg retries connecting to the camera. (default: shown below)
# If set too low, frigate will retry a connection to the camera's stream too frequently, using up the limited streams some cameras can allow at once
# If set too high, then if a ffmpeg crash or camera stream timeout occurs, you could potentially lose up to a maximum of retry_interval second(s) of footage
# NOTE: this can be a useful setting for Wireless / Battery cameras to reduce how much footage is potentially lost during a connection timeout.
retry_interval: 10
# Optional: Detect configuration
# NOTE: Can be overridden at the camera level
detect:
# Optional: width of the frame for the input with the detect role (default: use native stream resolution)
width: 1280
# Optional: height of the frame for the input with the detect role (default: use native stream resolution)
height: 720
# Optional: desired fps for your camera for the input with the detect role (default: shown below)
# NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
fps: 5
# Optional: enables detection for the camera (default: True)
enabled: True
# Optional: Number of consecutive detection hits required for an object to be initialized in the tracker. (default: 1/2 the frame rate)
min_initialized: 2
# Optional: Number of frames without a detection before Frigate considers an object to be gone. (default: 5x the frame rate)
max_disappeared: 25
# Optional: Configuration for stationary object tracking
stationary:
# Optional: Frequency for confirming stationary objects (default: same as threshold)
# When set to 1, object detection will run to confirm the object still exists on every frame.
# If set to 10, object detection will run to confirm the object still exists on every 10th frame.
interval: 50
# Optional: Number of frames without a position change for an object to be considered stationary (default: 10x the frame rate or 10s)
threshold: 50
# Optional: Define a maximum number of frames for tracking a stationary object (default: not set, track forever)
# This can help with false positives for objects that should only be stationary for a limited amount of time.
# It can also be used to disable stationary object tracking. For example, you may want to set a value for person, but leave
# car at the default.
# WARNING: Setting these values overrides default behavior and disables stationary object tracking.
# There are very few situations where you would want it disabled. It is NOT recommended to
# copy these values from the example config into your config unless you know they are needed.
max_frames:
# Optional: Default for all object types (default: not set, track forever)
default: 3000
# Optional: Object specific values
objects:
person: 1000
# Optional: Milliseconds to offset detect annotations by (default: shown below).
# There can often be latency between a recording and the detect process,
# especially when using separate streams for detect and record.
# Use this setting to make the timeline bounding boxes more closely align
# with the recording. The value can be positive or negative.
# TIP: Imagine there is an event clip with a person walking from left to right.
# If the event timeline bounding box is consistently to the left of the person
# then the value should be decreased. Similarly, if a person is walking from
# left to right and the bounding box is consistently ahead of the person
# then the value should be increased.
# TIP: This offset is dynamic so you can change the value and it will update existing
# events, this makes it easy to tune.
# WARNING: Fast moving objects will likely not have the bounding box align.
annotation_offset: 0
# Optional: Object configuration
# NOTE: Can be overridden at the camera level
objects:
# Optional: list of objects to track from labelmap.txt (default: shown below)
track:
- person
# 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.000,0.000,0.781,0.000,0.781,0.278,0.000,0.278
# 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 width/height of the bounding box for the detected object (default: 0)
min_ratio: 0.5
# Optional: maximum width/height of the bounding box for the detected object (default: 24000000)
max_ratio: 2.0
# 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
# 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.000,0.000,0.781,0.000,0.781,0.278,0.000,0.278
# Optional: Review configuration
# NOTE: Can be overridden at the camera level
review:
# Optional: alerts configuration
alerts:
# Optional: labels that qualify as an alert (default: shown below)
labels:
- car
- person
# Optional: required zones for an object to be marked as an alert (default: none)
required_zones:
- driveway
# Optional: detections configuration
detections:
# Optional: labels that qualify as a detection (default: all labels that are tracked / listened to)
labels:
- car
- person
# Optional: required zones for an object to be marked as a detection (default: none)
required_zones:
- driveway
# Optional: Motion configuration
# NOTE: Can be overridden 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: 30
# Optional: The percentage of the image used to detect lightning or other substantial changes where motion detection
# needs to recalibrate. (default: shown below)
# Increasing this value will make motion detection more likely to consider lightning or ir mode changes as valid motion.
# Decreasing this value will make motion detection more likely to ignore large amounts of motion such as a person approaching
# a doorbell camera.
lightning_threshold: 0.8
# Optional: Minimum size in pixels in the resized motion image that counts as motion (default: shown below)
# Increasing this value will prevent smaller areas of motion from being detected. Decreasing will
# make motion detection more sensitive to smaller moving objects.
# As a rule of thumb:
# - 10 - high sensitivity
# - 30 - medium sensitivity
# - 50 - low sensitivity
contour_area: 10
# 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.01
# Optional: Height of the resized motion frame (default: 100)
# 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: 100
# Optional: motion mask
# NOTE: see docs for more detailed info on creating masks
mask: 0.000,0.469,1.000,0.469,1.000,1.000,0.000,1.000
# Optional: improve contrast (default: shown below)
# Enables dynamic contrast improvement. This should help improve night detections at the cost of making motion detection more sensitive
# for daytime.
improve_contrast: True
# Optional: Delay when updating camera motion through MQTT from ON -> OFF (default: shown below).
mqtt_off_delay: 30
# Optional: Record configuration
# NOTE: Can be overridden at the camera level
record:
# Optional: Enable recording (default: shown below)
# WARNING: If recording is disabled in the config, turning it on via
# the UI or MQTT later will have no effect.
enabled: False
# Optional: Number of minutes to wait between cleanup runs (default: shown below)
# This can be used to reduce the frequency of deleting recording segments from disk if you want to minimize i/o
expire_interval: 60
# Optional: Sync recordings with disk on startup and once a day (default: shown below).
sync_recordings: False
# Optional: Retention settings for recording
retain:
# Optional: Number of days to retain recordings regardless of events (default: shown below)
# NOTE: This should be set to 0 and retention should be defined in events section below
# if you only want to retain recordings of events.
days: 0
# Optional: Mode for retention. Available options are: all, motion, and active_objects
# all - save all recording segments regardless of activity
# motion - save all recordings segments with any detected motion
# active_objects - save all recording segments with active/moving objects
# NOTE: this mode only applies when the days setting above is greater than 0
mode: all
# Optional: Recording Export Settings
export:
# Optional: Timelapse Output Args (default: shown below).
# NOTE: The default args are set to fit 24 hours of recording into 1 hour playback.
# See https://stackoverflow.com/a/58268695 for more info on how these args work.
# As an example: if you wanted to go from 24 hours to 30 minutes that would be going
# from 86400 seconds to 1800 seconds which would be 1800 / 86400 = 0.02.
# The -r (framerate) dictates how smooth the output video is.
# So the args would be -vf setpts=0.02*PTS -r 30 in that case.
timelapse_args: "-vf setpts=0.04*PTS -r 30"
# Optional: Recording Preview Settings
preview:
# Optional: Quality of recording preview (default: shown below).
# Options are: very_low, low, medium, high, very_high
quality: medium
# Optional: Event recording settings
events:
# Optional: Number of seconds before the event to include (default: shown below)
pre_capture: 5
# Optional: Number of seconds after the event to include (default: shown below)
post_capture: 5
# Optional: Objects to save recordings for. (default: all tracked objects)
objects:
- person
# Optional: Retention settings for recordings of events
retain:
# Required: Default retention days (default: shown below)
default: 10
# Optional: Mode for retention. (default: shown below)
# all - save all recording segments for events regardless of activity
# motion - save all recordings segments for events with any detected motion
# active_objects - save all recording segments for event with active/moving objects
#
# NOTE: If the retain mode for the camera is more restrictive than the mode configured
# here, the segments will already be gone by the time this mode is applied.
# For example, if the camera retain mode is "motion", the segments without motion are
# never stored, so setting the mode to "all" here won't bring them back.
mode: motion
# Optional: Per object retention days
objects:
person: 15
# Optional: Configuration for the jpg snapshots written to the clips directory for each event
# NOTE: Can be overridden at the camera level
snapshots:
# Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
enabled: False
# Optional: save a clean PNG copy of the snapshot image (default: shown below)
clean_copy: True
# Optional: print a timestamp on the snapshots (default: shown below)
timestamp: False
# Optional: draw bounding box on the snapshots (default: shown below)
bounding_box: True
# 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
# Optional: quality of the encoded jpeg, 0-100 (default: shown below)
quality: 70
# Optional: Restream configuration
# Uses https://github.com/AlexxIT/go2rtc (v1.8.3)
go2rtc:
# Optional: jsmpeg stream configuration for WebUI
live:
# Optional: Set the name of the stream that should be used for live view
# in frigate WebUI. (default: name of camera)
stream_name: camera_name
# Optional: Set the height of the jsmpeg stream. (default: 720)
# This must be less than or equal to the height of the detect stream. Lower resolutions
# reduce bandwidth required for viewing the jsmpeg stream. Width is computed to match known aspect ratio.
height: 720
# Optional: Set the encode quality of the jsmpeg stream (default: shown below)
# 1 is the highest quality, and 31 is the lowest. Lower quality feeds utilize less CPU resources.
quality: 8
# Optional: in-feed timestamp style configuration
# NOTE: Can be overridden at the camera level
timestamp_style:
# Optional: Position of the timestamp (default: shown below)
# "tl" (top left), "tr" (top right), "bl" (bottom left), "br" (bottom right)
position: "tl"
# Optional: Format specifier conform to the Python package "datetime" (default: shown below)
# Additional Examples:
# german: "%d.%m.%Y %H:%M:%S"
format: "%m/%d/%Y %H:%M:%S"
# Optional: Color of font
color:
# All Required when color is specified (default: shown below)
red: 255
green: 255
blue: 255
# Optional: Line thickness of font (default: shown below)
thickness: 2
# Optional: Effect of lettering (default: shown below)
# None (No effect),
# "solid" (solid background in inverse color of font)
# "shadow" (shadow for font)
effect: None
# Required
cameras:
# Required: name of the camera
back:
# Optional: Enable/Disable the camera (default: shown below).
# If disabled: config is used but no live stream and no capture etc.
# Events/Recordings are still viewable.
enabled: True
# 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: path may include environment variables or docker secrets, which must begin with 'FRIGATE_' and 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: audio,detect,record
# NOTICE: In addition to assigning the audio, detect, and record roles
# they must also be enabled in the camera config.
roles:
- audio
- detect
- record
# 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:
# Optional: timeout for highest scoring image before allowing it
# to be replaced by a newer image. (default: shown below)
best_image_timeout: 60
# Optional: URL to visit the camera web UI directly from the system page. Might not be available on every camera.
webui_url: ""
# 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: Presence in a zone is evaluated only based on the bottom center of the objects bounding box.
coordinates: 0.284,0.997,0.389,0.869,0.410,0.745
# Optional: Number of consecutive frames required for object to be considered present in the zone (default: shown below).
inertia: 3
# Optional: Number of seconds that an object must loiter to be considered in the zone (default: shown below)
loitering_time: 0
# Optional: List of objects that can trigger this zone (default: all tracked objects)
objects:
- person
# 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
# 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: jpeg encode quality (default: shown below)
quality: 70
# Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
required_zones: []
# Optional: Configuration for how camera is handled in the GUI.
ui:
# Optional: Adjust sort order of cameras in the UI. Larger numbers come later (default: shown below)
# By default the cameras are sorted alphabetically.
order: 0
# Optional: Whether or not to show the camera in the Frigate UI (default: shown below)
dashboard: True
# Optional: connect to ONVIF camera
# to enable PTZ controls.
onvif:
# Required: host of the camera being connected to.
host: 0.0.0.0
# Optional: ONVIF port for device (default: shown below).
port: 8000
# Optional: username for login.
# NOTE: Some devices require admin to access ONVIF.
user: admin
# Optional: password for login.
password: admin
# Optional: PTZ camera object autotracking. Keeps a moving object in
# the center of the frame by automatically moving the PTZ camera.
autotracking:
# Optional: enable/disable object autotracking. (default: shown below)
enabled: False
# Optional: calibrate the camera on startup (default: shown below)
# A calibration will move the PTZ in increments and measure the time it takes to move.
# The results are used to help estimate the position of tracked objects after a camera move.
# Frigate will update your config file automatically after a calibration with
# a "movement_weights" entry for the camera. You should then set calibrate_on_startup to False.
calibrate_on_startup: False
# Optional: the mode to use for zooming in/out on objects during autotracking. (default: shown below)
# Available options are: disabled, absolute, and relative
# disabled - don't zoom in/out on autotracked objects, use pan/tilt only
# absolute - use absolute zooming (supported by most PTZ capable cameras)
# relative - use relative zooming (not supported on all PTZs, but makes concurrent pan/tilt/zoom movements)
zooming: disabled
# Optional: A value to change the behavior of zooming on autotracked objects. (default: shown below)
# A lower value will keep more of the scene in view around a tracked object.
# A higher value will zoom in more on a tracked object, but Frigate may lose tracking more quickly.
# The value should be between 0.1 and 0.75
zoom_factor: 0.3
# Optional: list of objects to track from labelmap.txt (default: shown below)
track:
- person
# Required: Begin automatically tracking an object when it enters any of the listed zones.
required_zones:
- zone_name
# Required: Name of ONVIF preset in camera's firmware to return to when tracking is over. (default: shown below)
return_preset: home
# Optional: Seconds to delay before returning to preset. (default: shown below)
timeout: 10
# Optional: Values generated automatically by a camera calibration. Do not modify these manually. (default: shown below)
movement_weights: []
# Optional: Configuration for how to sort the cameras in the Birdseye view.
birdseye:
# Optional: Adjust sort order of cameras in the Birdseye view. Larger numbers come later (default: shown below)
# By default the cameras are sorted alphabetically.
order: 0
# Optional
ui:
# Optional: Set the default live mode for cameras in the UI (default: shown below)
live_mode: mse
# Optional: Set a timezone to use in the UI (default: use browser local time)
# timezone: America/Denver
# Optional: Set the time format used.
# Options are browser, 12hour, or 24hour (default: shown below)
time_format: browser
# Optional: Set the date style for a specified length.
# Options are: full, long, medium, short
# Examples:
# short: 2/11/23
# medium: Feb 11, 2023
# full: Saturday, February 11, 2023
# (default: shown below).
date_style: short
# Optional: Set the time style for a specified length.
# Options are: full, long, medium, short
# Examples:
# short: 8:14 PM
# medium: 8:15:22 PM
# full: 8:15:22 PM Mountain Standard Time
# (default: shown below).
time_style: medium
# Optional: Ability to manually override the date / time styling to use strftime format
# https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html
# possible values are shown above (default: not set)
strftime_fmt: "%Y/%m/%d %H:%M"
# Optional: Telemetry configuration
telemetry:
# Optional: Enabled network interfaces for bandwidth stats monitoring (default: empty list, let nethogs search all)
network_interfaces:
- eth
- enp
- eno
- ens
- wl
- lo
# Optional: Configure system stats
stats:
# Enable AMD GPU stats (default: shown below)
amd_gpu_stats: True
# Enable Intel GPU stats (default: shown below)
intel_gpu_stats: True
# Enable network bandwidth stats monitoring for camera ffmpeg processes, go2rtc, and object detectors. (default: shown below)
# NOTE: The container must either be privileged or have cap_net_admin, cap_net_raw capabilities enabled.
network_bandwidth: False
# Optional: Enable the latest version outbound check (default: shown below)
# NOTE: If you use the HomeAssistant integration, disabling this will prevent it from reporting new versions
version_check: True
# Optional: Camera groups (default: no groups are setup)
# NOTE: It is recommended to use the UI to setup camera groups
camera_groups:
# Required: Name of camera group
front:
# Required: list of cameras in the group
cameras:
- front_cam
- side_cam
- front_doorbell_cam
# Required: icon used for group
icon: car
# Required: index of this group
order: 0
```

View File

@@ -7,17 +7,18 @@ title: Restream
Frigate can restream your video feed as an RTSP feed for other applications such as Home Assistant to utilize it at `rtsp://<frigate_host>:8554/<camera_name>`. Port 8554 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](#reduce-connections-to-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.
Frigate uses [go2rtc](https://github.com/AlexxIT/go2rtc/tree/v1.8.1) to provide its restream and MSE/WebRTC capabilities. The go2rtc config is hosted at the `go2rtc` in the config, see [go2rtc docs](https://github.com/AlexxIT/go2rtc/tree/v1.8.1#configuration) for more advanced configurations and features.
Frigate uses [go2rtc](https://github.com/AlexxIT/go2rtc/tree/v1.9.2) to provide its restream and MSE/WebRTC capabilities. The go2rtc config is hosted at the `go2rtc` in the config, see [go2rtc docs](https://github.com/AlexxIT/go2rtc/tree/v1.9.2#configuration) for more advanced configurations and features.
:::note
You can access the go2rtc webUI at `http://frigate_ip:5000/live/webrtc` which can be helpful to debug as well as provide useful information about your camera streams.
You can access the go2rtc stream info at `http://frigate_ip:8080/api/go2rtc/streams` which can be helpful to debug as well as provide useful information about your camera streams.
:::
### Birdseye Restream
Birdseye RTSP restream can be accessed at `rtsp://<frigate_host>:8554/birdseye`. Enabling the birdseye restream will cause birdseye to run 24/7 which may increase CPU usage somewhat.
```yaml
birdseye:
restream: true
@@ -32,16 +33,11 @@ go2rtc:
rtsp:
username: "admin"
password: "pass"
streams:
...
streams: ...
```
**NOTE:** This does not apply to localhost requests, there is no need to provide credentials when using the restream as a source for frigate cameras.
## RTMP (Deprecated)
In previous Frigate versions RTMP was used for re-streaming. RTMP has disadvantages however including being incompatible with H.265, high bitrates, and certain audio codecs. RTMP is deprecated and it is recommended to move to the new restream role.
## Reduce Connections To Camera
Some cameras only support one active connection or you may just want to have a single connection open to the camera. The RTSP restream allows this to be possible.
@@ -138,7 +134,7 @@ cameras:
## Advanced Restream Configurations
The [exec](https://github.com/AlexxIT/go2rtc/tree/v1.8.1#source-exec) source in go2rtc can be used for custom ffmpeg commands. An example is below:
The [exec](https://github.com/AlexxIT/go2rtc/tree/v1.9.2#source-exec) source in go2rtc can be used for custom ffmpeg commands. An example is below:
NOTE: The output will need to be passed with two curly braces `{{output}}`

View File

@@ -0,0 +1,53 @@
---
id: review
title: Review
---
The Review page of the Frigate UI is for quickly reviewing historical footage of interest from your cameras. _Review items_ are indicated on a vertical timeline and displayed as a grid of previews - bandwidth-optimized, low frame rate, low resolution videos. Hovering over or swiping a preview plays the video and marks it as reviewed. If more in-depth analysis is required, the preview can be clicked/tapped and the full frame rate, full resolution recording is displayed.
Review items are filterable by date, object type, and camera.
## Alerts and Detections
Not every segment of video captured by Frigate may be of the same level of interest to you. Video of people who enter your property may be a different priority than those walking by on the sidewalk. For this reason, Frigate 0.14 categorizes review items as _alerts_ and _detections_. By default, all person and car objects are considered alerts. You can refine categorization of your review items by configuring required zones for them.
## Restricting alerts to specific labels
By default a review item will only be marked as an alert if a person or car is detected. This can be configured to include any object or audio label using the following config:
```yaml
# can be overridden at the camera level
review:
alerts:
labels:
- car
- cat
- dog
- person
- speech
```
## Restricting detections to specific labels
By default all detections that do not qualify as an alert qualify as a detection. However, detections can further be filtered to only include certain labels or certain zones.
By default a review item will only be marked as an alert if a person or car is detected. This can be configured to include any object or audio label using the following config:
```yaml
# can be overridden at the camera level
review:
detections:
labels:
- bark
- dog
```
## Restricting review items to specific zones
By default a review item will be created if any `review -> alerts -> labels` and `review -> detections -> labels` are detected anywhere in the camera frame. You will likely want to configure review items to only be created when the object enters an area of interest, [see the zone docs for more information](./zones.md#restricting-alerts-and-detections-to-specific-zones)
:::info
Because zones don't apply to audio, audio labels will always be marked as an alert.
:::

View File

@@ -3,6 +3,10 @@ id: snapshots
title: Snapshots
---
Frigate can save a snapshot image to `/media/frigate/clips` for each event named as `<camera>-<id>.jpg`.
Frigate can save a snapshot image to `/media/frigate/clips` for each object that is detected named as `<camera>-<id>.jpg`. They are also accessible [via the api](../integrations/api.md#get-apieventsidsnapshotjpg)
Snapshots sent via MQTT are configured in the [config file](https://docs.frigate.video/configuration/) under `cameras -> your_camera -> mqtt`
For users with Frigate+ enabled, snapshots are accessible in the UI in the Frigate+ pane to allow for quick submission to the Frigate+ service.
To only save snapshots for objects that enter a specific zone, [see the zone docs](./zones.md#restricting-snapshots-to-specific-zones)
Snapshots sent via MQTT are configured in the [config file](https://docs.frigate.video/configuration/) under `cameras -> your_camera -> mqtt`

View File

@@ -23,6 +23,30 @@ NOTE: There is no way to disable stationary object tracking with this value.
`threshold` is the number of frames an object needs to remain relatively still before it is considered stationary.
## Avoiding stationary objects
## Why does Frigate track stationary objects?
In some cases, like a driveway, you may prefer to only have an event when a car is coming & going vs a constant event of it stationary in the driveway. [This docs sections](../guides/stationary_objects.md) explains how to approach that scenario.
Frigate didn't always track stationary objects. In fact, it didn't even track objects at all initially.
Let's look at an example use case: I want to record any cars that enter my driveway.
One might simply think "Why not just run object detection any time there is motion around the driveway area and notify if the bounding box is in that zone?"
With that approach, what video is related to the car that entered the driveway? Did it come from the left or right? Was it parked across the street for an hour before turning into the driveway? One approach is to just record 24/7 or for motion (on any changed changed pixels) and not attempt to do that at all. This is what most other NVRs do. Just don't even try to identify a start and end for that object since it's hard and you will be wrong some portion of the time.
Couldn't you just look at when motion stopped and started? Motion for a video feed is nothing more than looking for pixels that are different than they were in previous frames. If the car entered the driveway while someone was mowing the grass, how would you know which motion was for the car and which was for the person when they mow along the driveway or street? What if another car was driving the other direction on the street? Or what if its a windy day and the bush by your mailbox is blowing around?
In order to do it more accurately, you need to identify objects and track them with a unique id. In each subsequent frame, everything has moved a little and you need to determine which bounding boxes go with each object from the previous frame.
Tracking objects across frames is a challenging problem. Especially if you want to do it in real time. There are entire competitions for research algorithms to see which of them can do it the most accurately. Zero of them are accurate 100% of the time. Even the ones that can't do it in realtime. There is always an error rate in the algorithm.
Now consider that the car is driving down a street that has other cars parked along it. It will drive behind some of these cars and in front of others. There may even be a car driving the opposite direction.
Let's assume for now that we are NOT already tracking two parked cars on the street or the car parked in the driveway, ie, there is no stationary object tracking.
As the car you are tracking approaches an area with 2 cars parked, the headlights reflect off the parked cars and the car parked in your driveway. The pixel values are different in that area, so there is motion detected. Object detection runs and identifies the remaining 3 cars. In the previous frame, you had a single bounding box from the car you are tracking. Now you have 4. The original object, the 2 cars on the street and the one in your driveway.
Now you have to determine which of the bounding boxes in this frame should be matched to the tracking id from the previous frame where you only had one. Remember, you have never seen these additional 3 cars before, so you know nothing about them. On top of that the bounding box for the car you are tracking has now moved to a new location, so which of the 4 belongs to the car you were originally tracking? The algorithms here are fairly good. They use a Kalman filter to predict the next location of an object using the historical bounding boxes and the bounding box closest to the predicted location is linked. It's right sometimes, but the error rate is going to be high when there are 4 possible bounding boxes.
Now let's assume that those other 3 cars were already being tracked as stationary objects, so the car driving down the street is a new 4th car. The object tracker knows we have had 3 cars and we now have 4. As the new car approaches the parked cars, the bounding boxes for all 4 cars is predicted based on the previous frames. The predicted boxes for the parked cars is pretty much a 100% overlap with the bounding boxes in the new frame. The parked cars are slam dunk matches to the tracking ids they had before and the only one left is the remaining bounding box which gets assigned to the new car. This results in a much lower error rate. Not perfect, but better.
The most difficult scenario that causes IDs to be assigned incorrectly is when an object completely occludes another object. When a car drives in front of another car and its no longer visible, a bounding box disappeared and it's a bit of a toss up when assigning the id since it's difficult to know which one is in front of the other. This happens for cars passing in front of other cars fairly often. It's something that we want to improve in the future.

View File

@@ -1,15 +0,0 @@
---
id: user_interface
title: User Interface Configurations
---
### Experimental UI
While developing and testing new components, users may decide to opt-in to test potential new features on the front-end.
```yaml
ui:
use_experimental: true
```
Note that experimental changes may contain bugs or may be removed at any time in future releases of the software. Use of these features are presented as-is and with no functional guarantee.

View File

@@ -5,28 +5,61 @@ title: 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. Presence in a zone is evaluated based on the bottom center of the bounding box for the object. It does not matter how much of the bounding box overlaps with the zone.
For example, the cat in this image is currently in Zone 1, but **not** Zone 2.
![bottom center](/img/bottom-center.jpg)
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, enable the Zones option for the debug feed so you can adjust as needed. The zone line will increase in thickness when any object enters the zone.
During testing, enable the Zones option for the Debug view of your camera (Settings --> Debug) 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 steps for a "Motion mask"](masks.md), but use the section of the web UI for creating a zone instead.
### Restricting events to specific zones
### Restricting alerts and detections to specific zones
Often you will only want events to be created when an object enters areas of interest. This is done using zones along with setting required_zones. Let's say you only want to be notified when an object enters your entire_yard zone, the config would be:
Often you will only want alerts to be created when an object enters areas of interest. This is done using zones along with setting required_zones. Let's say you only want to have an alert created when an object enters your entire_yard zone, the config would be:
```yaml
camera:
record:
events:
cameras:
name_of_your_camera:
review:
alerts:
required_zones:
- entire_yard
zones:
entire_yard:
coordinates: ...
```
You may also want to filter detections to only be created when an object enters a secondary area of interest. This is done using zones along with setting required_zones. Let's say you want alerts when an object enters the inner area of the yard but detections when an object enters the edge of the yard, the config would be
```yaml
cameras:
name_of_your_camera:
review:
alerts:
required_zones:
- inner_yard
detections:
required_zones:
- edge_yard
zones:
edge_yard:
coordinates: ...
inner_yard:
coordinates: ...
```
### Restricting snapshots to specific zones
```yaml
cameras:
name_of_your_camera:
snapshots:
required_zones:
- entire_yard
snapshots:
required_zones:
- entire_yard
zones:
entire_yard:
coordinates: ...
zones:
entire_yard:
coordinates: ...
```
### Restricting zones to specific objects
@@ -34,49 +67,80 @@ camera:
Sometimes you want to limit a zone to specific object types to have more granular control of when events/snapshots are saved. The following example will limit one zone to person objects and the other to cars.
```yaml
camera:
record:
events:
cameras:
name_of_your_camera:
record:
events:
required_zones:
- entire_yard
- front_yard_street
snapshots:
required_zones:
- entire_yard
- front_yard_street
snapshots:
required_zones:
- entire_yard
- front_yard_street
zones:
entire_yard:
coordinates: ... (everywhere you want a person)
objects:
- person
front_yard_street:
coordinates: ... (just the street)
objects:
- car
zones:
entire_yard:
coordinates: ... (everywhere you want a person)
objects:
- person
front_yard_street:
coordinates: ... (just the street)
objects:
- car
```
Only car objects can trigger the `front_yard_street` zone and only person can trigger the `entire_yard`. You will get events for person objects that enter anywhere in the yard, and events for cars only if they enter the street.
### Zone Loitering
Sometimes objects are expected to be passing through a zone, but an object loitering in an area is unexpected. Zones can be configured to have a minimum loitering time before the object will be considered in the zone.
```yaml
cameras:
name_of_your_camera:
zones:
sidewalk:
loitering_time: 4 # unit is in seconds
objects:
- person
```
### Zone Inertia
Sometimes an objects bounding box may be slightly incorrect and the bottom center of the bounding box is inside the zone while the object is not actually in the zone. Zone inertia helps guard against this by requiring an object's bounding box to be within the zone for multiple consecutive frames. This value can be configured:
```yaml
camera:
zones:
front_yard:
inertia: 3
objects:
- person
cameras:
name_of_your_camera:
zones:
front_yard:
inertia: 3
objects:
- person
```
There may also be cases where you expect an object to quickly enter and exit a zone, like when a car is pulling into the driveway, and you may want to have the object be considered present in the zone immediately:
```yaml
camera:
zones:
driveway_entrance:
inertia: 1
objects:
- car
cameras:
name_of_your_camera:
zones:
driveway_entrance:
inertia: 1
objects:
- car
```
### Loitering Time
Zones support a `loitering_time` configuration which can be used to only consider an object as part of a zone if they loiter in the zone for the specified number of seconds. This can be used, for example, to create alerts for cars that stop on the street but not cars that just drive past your camera.
```yaml
cameras:
name_of_your_camera:
zones:
front_yard:
loitering_time: 5 # unit is in seconds
objects:
- person
```

View File

@@ -33,7 +33,6 @@ Fork [blakeblackshear/frigate-hass-integration](https://github.com/blakeblackshe
### Prerequisites
- [Frigate source code](#frigate-core-web-and-docs)
- GNU make
- Docker
- An extra detector (Coral, OpenVINO, etc.) is optional but recommended to simulate real world performance.
@@ -95,7 +94,7 @@ The following commands are used inside the container to ensure hardware accelera
**Raspberry Pi (64bit)**
This should show <50% CPU in top, and ~80% CPU without `-c:v h264_v4l2m2m`.
This should show less than 50% CPU in top, and ~80% CPU without `-c:v h264_v4l2m2m`.
```shell
ffmpeg -c:v h264_v4l2m2m -re -stream_loop -1 -i https://streams.videolan.org/ffmpeg/incoming/720p60.mp4 -f rawvideo -pix_fmt yuv420p pipe: > /dev/null
@@ -129,9 +128,8 @@ ffmpeg -c:v h264_qsv -re -stream_loop -1 -i https://streams.videolan.org/ffmpeg/
### Prerequisites
- [Frigate source code](#frigate-core-web-and-docs)
- All [core](#core) prerequisites _or_ another running Frigate instance locally available
- Node.js 16
- Node.js 20
### Making changes
@@ -155,6 +153,12 @@ cd web && npm install
cd web && npm run dev
```
##### 3a. Run the development server against a non-local instance
To run the development server against a non-local instance, you will need to
replace the `localhost` values in `vite.config.ts` with the IP address of the
non-local backend server.
#### 4. Making changes
The Web UI is built using [Vite](https://vitejs.dev/), [Preact](https://preactjs.com), and [Tailwind CSS](https://tailwindcss.com).
@@ -182,8 +186,7 @@ npm run test
### Prerequisites
- [Frigate source code](#frigate-core-web-and-docs)
- Node.js 16
- Node.js 20
### Making changes
@@ -201,7 +204,7 @@ 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](https://v2.docusaurus.io). Please refer to the Docusaurus docs for more information on how to modify Frigate's documentation.
The docs are built using [Docusaurus v3](https://docusaurus.io). Please refer to the Docusaurus docs for more information on how to modify Frigate's documentation.
#### 3. Build (optional)
@@ -222,3 +225,13 @@ docker buildx create --name builder --driver docker-container --driver-opt netwo
docker buildx inspect builder --bootstrap
make push
```
## Other
### Nginx
When testing nginx config changes from within the dev container, the following command can be used to copy and reload the config for testing without rebuilding the container:
```console
sudo cp docker/main/rootfs/usr/local/nginx/conf/* /usr/local/nginx/conf/ && sudo /usr/local/nginx/sbin/nginx -s reload
```

View File

@@ -5,9 +5,9 @@ title: Camera setup
Cameras configured to output H.264 video and AAC audio will offer the most compatibility with all features of Frigate and Home Assistant. H.265 has better compression, but less compatibility. Chrome 108+, Safari and Edge are the only browsers able to play H.265 and only support a limited number of H.265 profiles. Ideally, cameras should be configured directly for the desired resolutions and frame rates you want to use in Frigate. Reducing frame rates within Frigate will waste CPU resources decoding extra frames that are discarded. There are three different goals that you want to tune your stream configurations around.
- **Detection**: This is the only stream that Frigate will decode for processing. Also, this is the stream where snapshots will be generated from. The resolution for detection should be tuned for the size of the objects you want to detect. See [Choosing a detect resolution](#choosing-a-detect-resolution) for more details. The recommended frame rate is 5fps, but may need to be higher for very fast moving objects. Higher resolutions and frame rates will drive higher CPU usage on your server.
- **Detection**: This is the only stream that Frigate will decode for processing. Also, this is the stream where snapshots will be generated from. The resolution for detection should be tuned for the size of the objects you want to detect. See [Choosing a detect resolution](#choosing-a-detect-resolution) for more details. The recommended frame rate is 5fps, but may need to be higher (10fps is the recommended maximum for most users) for very fast moving objects. Higher resolutions and frame rates will drive higher CPU usage on your server.
- **Recording**: This stream should be the resolution you wish to store for reference. Typically, this will be the highest resolution your camera supports. I recommend setting this feed to 15 fps.
- **Recording**: This stream should be the resolution you wish to store for reference. Typically, this will be the highest resolution your camera supports. I recommend setting this feed in your camera's firmware to 15 fps.
- **Stream Viewing**: This stream will be rebroadcast as is to Home Assistant for viewing with the stream component. Setting this resolution too high will use significant bandwidth when viewing streams in Home Assistant, and they may not load reliably over slower connections.

View File

@@ -0,0 +1,58 @@
---
id: glossary
title: Glossary
---
The glossary explains terms commonly used in Frigate's documentation.
## Bounding Box
A box returned from the object detection model that outlines an object in the frame. These have multiple colors depending on object type in the debug live view.
## Event
The time period starting when a tracked object entered the frame and ending when it left the frame, including any time that the object remained still. Events are saved when it is considered a [true positive](#threshold) and meets the requirements for a snapshot or recording to be saved.
## False Positive
An incorrect detection of an object type. For example a dog being detected as a person, a chair being detected as a dog, etc. A person being detected in an area you want to ignore is not a false positive.
## Mask
There are two types of masks in Frigate. [See the mask docs for more info](/configuration/masks)
### Motion Mask
Motion masks prevent detection of [motion](#motion) in masked areas from triggering Frigate to run object detection, but do not prevent objects from being detected if object detection runs due to motion in nearby areas. For example: camera timestamps, skies, the tops of trees, etc.
### Object Mask
Object filter masks drop any bounding boxes where the bottom center (overlap doesn't matter) is in the masked area. It forces them to be considered a [false positive](#false-positive) so that they are ignored.
## Min Score
The lowest score that an object can be detected with during tracking, any detection with a lower score will be assumed to be a false positive
## Motion
When pixels in the current camera frame are different than previous frames. When many nearby pixels are different in the current frame they grouped together and indicated with a red motion box in the live debug view. [See the motion detection docs for more info](/configuration/motion_detection)
## Region
A portion of the camera frame that is sent to object detection, regions can be sent due to motion, active objects, or occasionally for stationary objects. These are represented by green boxes in the debug live view.
## Snapshot Score
The score shown in a snapshot is the score of that object at that specific moment in time.
## Threshold
The threshold is the median score that an object must reach in order to be considered a true positive.
## Top Score
The top score for an object is the highest median score for an object.
## Zone
Zones are areas of interest, zones can be used for notifications and for limiting the areas where Frigate will create an [event](#event). [See the zone docs for more info](/configuration/zones)

View File

@@ -9,7 +9,7 @@ Cameras that output H.264 video and AAC audio will offer the most compatibility
I recommend Dahua, Hikvision, and Amcrest in that order. Dahua edges out Hikvision because they are easier to find and order, not because they are better cameras. I personally use Dahua cameras because they are easier to purchase directly. In my experience Dahua and Hikvision both have multiple streams with configurable resolutions and frame rates and rock solid streams. They also both have models with large sensors well known for excellent image quality at night. Not all the models are equal. Larger sensors are better than higher resolutions; especially at night. Amcrest is the fallback recommendation because they are rebranded Dahuas. They are rebranding the lower end models with smaller sensors or less configuration options.
Many users have reported various issues with Reolink cameras, so I do not recommend them. If you are using Reolink, I suggest the [Reolink specific configuration](../configuration/camera_specific.md#reolink-410520-possibly-others). Wifi cameras are also not recommended. Their streams are less reliable and cause connection loss and/or lost video data.
Many users have reported various issues with Reolink cameras, so I do not recommend them. If you are using Reolink, I suggest the [Reolink specific configuration](../configuration/camera_specific.md#reolink-cameras). Wifi cameras are also not recommended. Their streams are less reliable and cause connection loss and/or lost video data.
Here are some of the camera's I recommend:
@@ -21,13 +21,12 @@ I may earn a small commission for my endorsement, recommendation, testimonial, o
## Server
My current favorite is the Minisforum GK41 because of the dual NICs that allow you to setup a dedicated private network for your cameras where they can be blocked from accessing the internet. There are many used workstation options on eBay that work very well. Anything with an Intel CPU and capable of running Debian should work fine. As a bonus, you may want to look for devices with a M.2 or PCIe express slot that is compatible with the Google Coral. I may earn a small commission for my endorsement, recommendation, testimonial, or link to any products or services from this website.
My current favorite is the Beelink EQ12 because of the efficient N100 CPU and dual NICs that allow you to setup a dedicated private network for your cameras where they can be blocked from accessing the internet. There are many used workstation options on eBay that work very well. Anything with an Intel CPU and capable of running Debian should work fine. As a bonus, you may want to look for devices with a M.2 or PCIe express slot that is compatible with the Google Coral. I may earn a small commission for my endorsement, recommendation, testimonial, or link to any products or services from this website.
| Name | Coral Inference Speed | Coral Compatibility | Notes |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Odyssey X86 Blue J4125 (<a href="https://amzn.to/3oH4BKi" target="_blank" rel="nofollow noopener sponsored">Amazon</a>) (<a href="https://www.seeedstudio.com/Frigate-NVR-with-Odyssey-Blue-and-Coral-USB-Accelerator.html?utm_source=Frigate" target="_blank" rel="nofollow noopener sponsored">SeeedStudio</a>) | 9-10ms | M.2 B+M, USB | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. |
| Minisforum GK41 (<a href="https://amzn.to/3ptnb8D" target="_blank" rel="nofollow noopener sponsored">Amazon</a>) | 9-10ms | USB | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. |
| Intel NUC (<a href="https://amzn.to/3psFlHi" target="_blank" rel="nofollow noopener sponsored">Amazon</a>) | 8-10ms | USB | Overkill for most, but great performance. Can handle many cameras at 5fps depending on typical amounts of motion. Requires extra parts. |
| Name | Coral Inference Speed | Coral Compatibility | Notes |
| ------------------------------------------------------------------------------------------------------------- | --------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Beelink EQ12 (<a href="https://amzn.to/3OlTMJY" target="_blank" rel="nofollow noopener sponsored">Amazon</a>) | 5-10ms | USB | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. |
| Intel NUC (<a href="https://amzn.to/3psFlHi" target="_blank" rel="nofollow noopener sponsored">Amazon</a>) | 5-10ms | USB | Overkill for most, but great performance. Can handle many cameras at 5fps depending on typical amounts of motion. Requires extra parts. |
## Detectors
@@ -41,14 +40,15 @@ The USB version is compatible with the widest variety of hardware and does not r
The PCIe and M.2 versions require installation of a driver on the host. Follow the instructions for your version from https://coral.ai
A single Coral can handle many cameras and will be sufficient for the majority of users. You can calculate the maximum performance of your Coral based on the inference speed reported by Frigate. With an inference speed of 10, your Coral will top out at `1000/10=100`, or 100 frames per second. If your detection fps is regularly getting close to that, you should first consider tuning motion masks. If those are already properly configured, a second Coral may be needed.
A single Coral can handle many cameras using the default model and will be sufficient for the majority of users. You can calculate the maximum performance of your Coral based on the inference speed reported by Frigate. With an inference speed of 10, your Coral will top out at `1000/10=100`, or 100 frames per second. If your detection fps is regularly getting close to that, you should first consider tuning motion masks. If those are already properly configured, a second Coral may be needed.
### OpenVino
### OpenVINO
The OpenVINO detector type is able to run on:
- 6th Gen Intel Platforms and newer that have an iGPU
- x86 & Arm64 hosts with VPU Hardware (ex: Intel NCS2)
- Most modern AMD CPUs (though this is officially not supported by Intel)
More information is available [in the detector docs](/configuration/object_detectors#openvino-detector)

View File

@@ -20,6 +20,10 @@ Use of a [Google Coral Accelerator](https://coral.ai/products/) is optional, but
## Screenshots
![Live View](/img/live-view.png)
![Review Items](/img/review-items.png)
![Media Browser](/img/media_browser-min.png)
![Notification](/img/notification-min.png)

View File

@@ -13,7 +13,7 @@ Frigate is a Docker container that can be run on any Docker host including as a
### Operating System
Frigate runs best with docker installed on bare metal debian-based distributions. For ideal performance, Frigate needs access to underlying hardware for the Coral and GPU devices. Running Frigate in a VM on top of Proxmox, ESXi, Virtualbox, etc. is not recommended. The virtualization layer often introduces a sizable amount of overhead for communication with Coral devices, but [not in all circumstances](https://github.com/blakeblackshear/frigate/discussions/1837).
Frigate runs best with Docker installed on bare metal Debian-based distributions. For ideal performance, Frigate needs low overhead access to underlying hardware for the Coral and GPU devices. Running Frigate in a VM on top of Proxmox, ESXi, Virtualbox, etc. is not recommended though [some users have had success with Proxmox](#proxmox).
Windows is not officially supported, but some users have had success getting it to run under WSL or Virtualbox. Getting the GPU and/or Coral devices properly passed to Frigate may be difficult or impossible. Search previous discussions or issues for help.
@@ -28,6 +28,17 @@ Frigate uses the following locations for read/write operations in the container.
- `/tmp/cache`: Cache location for recording segments. Initial recordings are written here before being checked and converted to mp4 and moved to the recordings folder. Segments generated via the `clip.mp4` endpoints are also concatenated and processed here. It is recommended to use a [`tmpfs`](https://docs.docker.com/storage/tmpfs/) mount for this.
- `/dev/shm`: Internal cache for raw decoded frames in shared memory. It is not recommended to modify this directory or map it with docker. The minimum size is impacted by the `shm-size` calculations below.
### Ports
The following ports are used by Frigate and can be mapped via docker as required.
| Port | Description |
| ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `8080` | Authenticated UI and API access. Reverse proxies should use this port. |
| `5000` | Internal unauthenticated UI and API access. Access to this port should be limited. Intended to be used within the docker network for services that integrate with Frigate. |
| `8554` | RTSP restreaming. By default, these streams are unauthenticated. Authentication can be configured in go2rtc section of config. |
| `8555` | WebRTC connections for low latency live views. |
#### Common docker compose storage configurations
Writing to a local disk or external USB drive:
@@ -47,6 +58,12 @@ services:
...
```
:::warning
Users of the Snapcraft build of Docker cannot use storage locations outside your $HOME folder.
:::
### Calculating required shm-size
Frigate utilizes shared memory to store frames during processing. The default `shm-size` provided by Docker is **64MB**.
@@ -72,7 +89,6 @@ $ python -c 'print("{:.2f}MB".format(((1280 * 720 * 1.5 * 9 + 270480) / 1048576)
The shm size cannot be set per container for Home Assistant add-ons. However, this is probably not required since by default Home Assistant Supervisor allocates `/dev/shm` with half the size of your total memory. If your machine has 8GB of memory, chances are that Frigate will have access to up to 4GB without any additional configuration.
### Raspberry Pi 3/4
By default, the Raspberry Pi limits the amount of memory available to the GPU. In order to use ffmpeg hardware acceleration, you must increase the available memory by setting `gpu_mem` to the maximum recommended value in `config.txt` as described in the [official docs](https://www.raspberrypi.org/documentation/computers/config_txt.html#memory-options).
@@ -81,22 +97,7 @@ Additionally, the USB Coral draws a considerable amount of power. If using any o
## Docker
Running in Docker with compose is the recommended install method:
:::note
The following officially supported builds are available:
`ghcr.io/blakeblackshear/frigate:stable` - Standard Frigate build for amd64 & RPi Optimized Frigate build for arm64
`ghcr.io/blakeblackshear/frigate:stable-standard-arm64` - Standard Frigate build for arm64
`ghcr.io/blakeblackshear/frigate:stable-tensorrt` - Frigate build specific for amd64 devices running an nvidia GPU
The following community supported builds are available:
`ghcr.io/blakeblackshear/frigate:stable-tensorrt-jp5` - Frigate build optimized for nvidia Jetson devices running Jetpack 5
`ghcr.io/blakeblackshear/frigate:stable-tensorrt-jp4` - Frigate build optimized for nvidia Jetson devices running Jetpack 4.6
:::
Running in Docker with compose is the recommended install method.
```yaml
version: "3.9"
@@ -108,9 +109,10 @@ services:
image: ghcr.io/blakeblackshear/frigate:stable
shm_size: "64mb" # update for your cameras based on calculation above
devices:
- /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
- /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
- /dev/bus/usb:/dev/bus/usb # Passes the USB Coral, needs to be modified for other versions
- /dev/apex_0:/dev/apex_0 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
- /dev/video11:/dev/video11 # For Raspberry Pi 4B
- /dev/dri/renderD128:/dev/dri/renderD128 # For intel hwaccel, needs to be updated for your hardware
volumes:
- /etc/localtime:/etc/localtime:ro
- /path/to/your/config:/config
@@ -120,7 +122,8 @@ services:
tmpfs:
size: 1000000000
ports:
- "5000:5000"
- "8080:8080"
# - "5000:5000" # Internal unauthenticated access. Expose carefully.
- "8554:8554" # RTSP feeds
- "8555:8555/tcp" # WebRTC over tcp
- "8555:8555/udp" # WebRTC over udp
@@ -142,20 +145,37 @@ docker run -d \
-v /path/to/your/config:/config \
-v /etc/localtime:/etc/localtime:ro \
-e FRIGATE_RTSP_PASSWORD='password' \
-p 5000:5000 \
-p 8080:8080 \
-p 8554:8554 \
-p 8555:8555/tcp \
-p 8555:8555/udp \
ghcr.io/blakeblackshear/frigate:stable
```
The official docker image tags for the current stable version are:
- `stable` - Standard Frigate build for amd64 & RPi Optimized Frigate build for arm64
- `stable-standard-arm64` - Standard Frigate build for arm64
- `stable-tensorrt` - Frigate build specific for amd64 devices running an nvidia GPU
The community supported docker image tags for the current stable version are:
- `stable-tensorrt-jp5` - Frigate build optimized for nvidia Jetson devices running Jetpack 5
- `stable-tensorrt-jp4` - Frigate build optimized for nvidia Jetson devices running Jetpack 4.6
- `stable-rk` - Frigate build for SBCs with Rockchip SoC
- `stable-rocm` - Frigate build for [AMD GPUs and iGPUs](../configuration/object_detectors.md#amdrocm-gpu-detector), all drivers
- `stable-rocm-gfx900` - AMD gfx900 driver only
- `stable-rocm-gfx1030` - AMD gfx1030 driver only
- `stable-rocm-gfx1100` - AMD gfx1100 driver only
## Home Assistant Addon
:::caution
:::warning
As of HomeAssistant OS 10.2 and Core 2023.6 defining separate network storage for media is supported.
There are important limitations in Home Assistant Operating System to be aware of:
- Separate local storage for media is not yet supported by Home Assistant
- AMD GPUs are not supported because HA OS does not include the mesa driver.
- Nvidia GPUs are not supported because addons do not support the nvidia runtime.
@@ -198,19 +218,27 @@ To install make sure you have the [community app plugin here](https://forums.unr
## Proxmox
It is recommended to run Frigate in LXC for maximum performance. See [this discussion](https://github.com/blakeblackshear/frigate/discussions/1111) for more information.
It is recommended to run Frigate in LXC, rather than in a VM, for maximum performance. The setup can be complex so be prepared to read the Proxmox and LXC documentation. Suggestions include:
- For Intel-based hardware acceleration, to allow access to the `/dev/dri/renderD128` device with major number 226 and minor number 128, add the following lines to the `/etc/pve/lxc/<id>.conf` LXC configuration:
- `lxc.cgroup2.devices.allow: c 226:128 rwm`
- `lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file`
- The LXC configuration will likely also need `features: fuse=1,nesting=1`. This allows running a Docker container in an LXC container (`nesting`) and prevents duplicated files and wasted storage (`fuse`).
- Successfully passing hardware devices through multiple levels of containerization (LXC then Docker) can be difficult. Many people make devices like `/dev/dri/renderD128` world-readable in the host or run Frigate in a privileged LXC container.
- The virtualization layer often introduces a sizable amount of overhead for communication with Coral devices, but [not in all circumstances](https://github.com/blakeblackshear/frigate/discussions/1837).
See the [Proxmox LXC discussion](https://github.com/blakeblackshear/frigate/discussions/5773) for more general information.
## ESXi
For details on running Frigate using ESXi, please see the instructions [here](https://williamlam.com/2023/05/frigate-nvr-with-coral-tpu-igpu-passthrough-using-esxi-on-intel-nuc.html).
If you're running Frigate on a rack mounted server and want to passthough the Google Coral, [read this.](https://github.com/blakeblackshear/frigate/issues/305)
If you're running Frigate on a rack mounted server and want to passthrough the Google Coral, [read this.](https://github.com/blakeblackshear/frigate/issues/305)
## Synology NAS on DSM 7
These settings were tested on DSM 7.1.1-42962 Update 4
**General:**
The `Execute container using high privilege` option needs to be enabled in order to give the frigate container the elevated privileges it may need.
@@ -219,14 +247,12 @@ The `Enable auto-restart` option can be enabled if you want the container to aut
![image](https://user-images.githubusercontent.com/4516296/232586790-0b659a82-561d-4bc5-899b-0f5b39c6b11d.png)
**Advanced Settings:**
If you want to use the password template feature, you should add the "FRIGATE_RTSP_PASSWORD" environment variable and set it to your preferred password under advanced settings. The rest of the environment variables should be left as default for now.
![image](https://user-images.githubusercontent.com/4516296/232587163-0eb662d4-5e28-4914-852f-9db1ec4b9c3d.png)
**Port Settings:**
The network mode should be set to `bridge`. You need to map the default frigate container ports to your local Synology NAS ports that you want to use to access Frigate.
@@ -235,12 +261,11 @@ There may be other services running on your NAS that are using the same ports th
![image](https://user-images.githubusercontent.com/4516296/232582642-773c0e37-7ef5-4373-8ce3-41401b1626e6.png)
**Volume Settings:**
You need to configure 2 paths:
- The location of your config file in yaml format, this needs to be file and you need to go to the location of where your config.yml is located, this will be different depending on your NAS folder structure e.g. `/docker/frigate/config/config.yml` will mount to `/config/config.yml` within the container.
- The location of your config directory which will be different depending on your NAS folder structure e.g. `/docker/frigate/config` will mount to `/config` within the container.
- The location on your NAS where the recordings will be saved this needs to be a folder e.g. `/docker/volumes/frigate-0-media`
![image](https://user-images.githubusercontent.com/4516296/232585872-44431d15-55e0-4004-b78b-1e512702b911.png)
@@ -249,14 +274,15 @@ You need to configure 2 paths:
These instructions were tested on a QNAP with an Intel J3455 CPU and 16G RAM, running QTS 4.5.4.2117.
QNAP has a graphic tool named Container Station to install and manage docker containers. However, there are two limitations with Container Station that make it unsuitable to install Frigate:
QNAP has a graphic tool named Container Station to install and manage docker containers. However, there are two limitations with Container Station that make it unsuitable to install Frigate:
1. Container Station does not incorporate GitHub Container Registry (ghcr), which hosts Frigate docker image version 0.12.0 and above.
2. Container Station uses default 64 Mb shared memory size (shm-size), and does not have a mechanism to adjust it. Frigate requires a larger shm-size to be able to work properly with more than two high resolution cameras.
2. Container Station uses default 64 Mb shared memory size (shm-size), and does not have a mechanism to adjust it. Frigate requires a larger shm-size to be able to work properly with more than two high resolution cameras.
Because of above limitations, the installation has to be done from command line. Here are the steps:
Because of above limitations, the installation has to be done from command line. Here are the steps:
**Preparation**
1. Install Container Station from QNAP App Center if it is not installed.
2. Enable ssh on your QNAP (please do an Internet search on how to do this).
3. Prepare Frigate config file, name it `config.yml`.
@@ -267,7 +293,8 @@ Because of above limitations, the installation has to be done from command line.
**Installation**
Run the following commands to install Frigate (using `stable` version as example):
```bash
```shell
# Download Frigate image
docker pull ghcr.io/blakeblackshear/frigate:stable
# Create directory to host Frigate config file on QNAP file system.
@@ -276,8 +303,8 @@ mkdir -p /share/Container/frigate/config
# Copy the config file prepared in step 2 into the newly created config directory.
cp path/to/your/config/file /share/Container/frigate/config
# Create directory to host Frigate media files on QNAP file system.
# (if you have a surveilliance disk, create media directory on the surveilliance disk.
# Example command assumes share_vol2 is the surveilliance drive
# (if you have a surveillance disk, create media directory on the surveillance disk.
# Example command assumes share_vol2 is the surveillance drive
mkdir -p /share/share_vol2/frigate/media
# Create Frigate docker container. Replace shm-size value with the value from preparation step 3.
# Also replace the time zone value for 'TZ' in the sample command.
@@ -294,8 +321,7 @@ docker run \
--network=bridge \
--privileged \
--workdir=/opt/frigate \
-p 1935:1935 \
-p 5000:5000 \
-p 8080:8080 \
-p 8554:8554 \
-p 8555:8555 \
-p 8555:8555/udp \
@@ -308,6 +334,4 @@ docker run \
ghcr.io/blakeblackshear/frigate:stable
```
Log into QNAP, open Container Station. Frigate docker container should be listed under 'Overview' and running. Visit Frigate Web UI by clicking Frigate docker, and then clicking the URL shown at the top of the detail page.
Log into QNAP, open Container Station. Frigate docker container should be listed under 'Overview' and running. Visit Frigate Web UI by clicking Frigate docker, and then clicking the URL shown at the top of the detail page.

View File

@@ -0,0 +1,67 @@
---
id: video_pipeline
title: Video pipeline
---
Frigate uses a sophisticated video pipeline that starts with the camera feed and progressively applies transformations to it (e.g. decoding, motion detection, etc.).
This guide provides an overview to help users understand some of the key Frigate concepts.
## Overview
At a high level, there are five processing steps that could be applied to a camera feed
```mermaid
%%{init: {"themeVariables": {"edgeLabelBackground": "transparent"}}}%%
flowchart LR
Feed(Feed\nacquisition) --> Decode(Video\ndecoding)
Decode --> Motion(Motion\ndetection)
Motion --> Object(Object\ndetection)
Feed --> Recording(Recording\nand\nvisualization)
Motion --> Recording
Object --> Recording
```
As the diagram shows, all feeds first need to be acquired. Depending on the data source, it may be as simple as using FFmpeg to connect to an RTSP source via TCP or something more involved like connecting to an Apple Homekit camera using go2rtc. A single camera can produce a main (i.e. high resolution) and a sub (i.e. lower resolution) video feed.
Typically, the sub-feed will be decoded to produce full-frame images. As part of this process, the resolution may be downscaled and an image sampling frequency may be imposed (e.g. keep 5 frames per second).
These frames will then be compared over time to detect movement areas (a.k.a. motion boxes). These motion boxes are combined into motion regions and are analyzed by a machine learning model to detect known objects. Finally, the snapshot and recording retention config will decide what video clips and events should be saved.
## Detailed view of the video pipeline
The following diagram adds a lot more detail than the simple view explained before. The goal is to show the detailed data paths between the processing steps.
```mermaid
%%{init: {"themeVariables": {"edgeLabelBackground": "transparent"}}}%%
flowchart TD
RecStore[(Recording\nstore)]
SnapStore[(Snapshot\nstore)]
subgraph Acquisition
Cam["Camera"] -->|FFmpeg supported| Stream
Cam -->|"Other streaming\nprotocols"| go2rtc
go2rtc("go2rtc") --> Stream
Stream[Capture main and\nsub streams] --> |detect stream|Decode(Decode and\ndownscale)
end
subgraph Motion
Decode --> MotionM(Apply\nmotion masks)
MotionM --> MotionD(Motion\ndetection)
end
subgraph Detection
MotionD --> |motion regions| ObjectD(Object detection)
Decode --> ObjectD
ObjectD --> ObjectFilter(Apply object filters & zones)
ObjectFilter --> ObjectZ(Track objects)
end
Decode --> |decoded frames|Birdseye
MotionD --> |motion event|Birdseye
ObjectZ --> |object event|Birdseye
MotionD --> |"video segments\n(retain motion)"|RecStore
ObjectZ --> |detection clip|RecStore
Stream -->|"video segments\n(retain all)"| RecStore
ObjectZ --> |detection snapshot|SnapStore
```

View File

@@ -3,15 +3,17 @@ id: configuring_go2rtc
title: Configuring go2rtc
---
# Configuring go2rtc
Use of the bundled go2rtc is optional. You can still configure FFmpeg to connect directly to your cameras. However, adding go2rtc to your configuration is required for the following features:
- WebRTC or MSE for live viewing with higher resolutions and frame rates than the jsmpeg stream which is limited to the detect stream
- Live stream support for cameras in Home Assistant Integration
- RTSP (instead of RTMP) relay for use with other consumers to reduce the number of connections to your camera streams
- RTSP relay for use with other consumers to reduce the number of connections to your camera streams
# Setup a go2rtc stream
First, you will want to configure go2rtc to connect to your camera stream by adding the stream you want to use for live view in your Frigate config file. If you set the stream name under go2rtc to match the name of your camera, it will automatically be mapped and you will get additional live view options for the camera. Avoid changing any other parts of your config at this step. Note that go2rtc supports [many different stream types](https://github.com/AlexxIT/go2rtc/tree/v1.8.1#module-streams), not just rtsp.
First, you will want to configure go2rtc to connect to your camera stream by adding the stream you want to use for live view in your Frigate config file. If you set the stream name under go2rtc to match the name of your camera, it will automatically be mapped and you will get additional live view options for the camera. Avoid changing any other parts of your config at this step. Note that go2rtc supports [many different stream types](https://github.com/AlexxIT/go2rtc/tree/v1.9.2#module-streams), not just rtsp.
```yaml
go2rtc:
@@ -24,7 +26,7 @@ The easiest live view to get working is MSE. After adding this to the config, re
### What if my video doesn't play?
If you are unable to see your video feed, first check the go2rtc logs in the Frigate UI under Logs in the sidebar. If go2rtc is having difficulty connecting to your camera, you should see some error messages in the log. If you do not see any errors, then the video codec of the stream may not be supported in your browser. If your camera stream is set to H265, try switching to H264. You can see more information about [video codec compatibility](https://github.com/AlexxIT/go2rtc/tree/v1.8.1#codecs-madness) in the go2rtc documentation. If you are not able to switch your camera settings from H265 to H264 or your stream is a different format such as MJPEG, you can use go2rtc to re-encode the video using the [FFmpeg parameters](https://github.com/AlexxIT/go2rtc/tree/v1.8.1#source-ffmpeg). It supports rotating and resizing video feeds and hardware acceleration. Keep in mind that transcoding video from one format to another is a resource intensive task and you may be better off using the built-in jsmpeg view. Here is an example of a config that will re-encode the stream to H264 without hardware acceleration:
If you are unable to see your video feed, first check the go2rtc logs in the Frigate UI under Logs in the sidebar. If go2rtc is having difficulty connecting to your camera, you should see some error messages in the log. If you do not see any errors, then the video codec of the stream may not be supported in your browser. If your camera stream is set to H265, try switching to H264. You can see more information about [video codec compatibility](https://github.com/AlexxIT/go2rtc/tree/v1.9.2#codecs-madness) in the go2rtc documentation. If you are not able to switch your camera settings from H265 to H264 or your stream is a different format such as MJPEG, you can use go2rtc to re-encode the video using the [FFmpeg parameters](https://github.com/AlexxIT/go2rtc/tree/v1.9.2#source-ffmpeg). It supports rotating and resizing video feeds and hardware acceleration. Keep in mind that transcoding video from one format to another is a resource intensive task and you may be better off using the built-in jsmpeg view. Here is an example of a config that will re-encode the stream to H264 without hardware acceleration:
```yaml
go2rtc:
@@ -72,7 +74,7 @@ go2rtc:
- "ffmpeg:rtsp://user:password@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2#video=copy#audio=copy#audio=aac"
```
:::caution
:::warning
To access the go2rtc stream externally when utilizing the Frigate Add-On (for instance through VLC), you must first enable the RTSP Restream port. You can do this by visiting the Frigate Add-On configuration page within Home Assistant and revealing the hidden options under the "Show disabled ports" section.

View File

@@ -3,7 +3,145 @@ id: getting_started
title: Getting started
---
This guide walks through the steps to build a configuration file for Frigate. It assumes that you already have an environment setup as described in [Installation](../frigate/installation.md). You should also configure your cameras according to the [camera setup guide](/frigate/camera_setup). Pay particular attention to the section on choosing a detect resolution.
# Getting Started
## Setting up hardware
This section guides you through setting up a server with Debian Bookworm and Docker. If you already have an environment with Linux and Docker installed, you can continue to [Installing Frigate](#installing-frigate) below.
### Install Debian 12 (Bookworm)
There are many guides on how to install Debian Server, so this will be an abbreviated guide. Connect a temporary monitor and keyboard to your device so you can install a minimal server without a desktop environment.
#### Prepare installation media
1. Download the small installation image from the [Debian website](https://www.debian.org/distrib/netinst)
1. Flash the ISO to a USB device (popular tool is [balena Etcher](https://etcher.balena.io/))
1. Boot your device from USB
#### Install and setup Debian for remote access
1. Ensure your device is connected to the network so updates and software options can be installed
1. Choose the non-graphical install option if you don't have a mouse connected, but either install method works fine
1. You will be prompted to set the root user password and create a user with a password
1. Install the minimum software. Fewer dependencies result in less maintenance.
1. Uncheck "Debian desktop environment" and "GNOME"
1. Check "SSH server"
1. Keep "standard system utilities" checked
1. After reboot, login as root at the command prompt to add user to sudoers
1. Install sudo
```bash
apt update && apt install -y sudo
```
1. Add the user you created to the sudo group (change `blake` to your own user)
```bash
usermod -aG sudo blake
```
1. Shutdown by running `poweroff`
At this point, you can install the device in a permanent location. The remaining steps can be performed via SSH from another device. If you don't have an SSH client, you can install one of the options listed in the [Visual Studio Code documentation](https://code.visualstudio.com/docs/remote/troubleshooting#_installing-a-supported-ssh-client).
#### Finish setup via SSH
1. Connect via SSH and login with your non-root user created during install
1. Setup passwordless sudo so you don't have to type your password for each sudo command (change `blake` in the command below to your user)
```bash
echo 'blake ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/user
```
1. Logout and login again to activate passwordless sudo
1. Setup automatic security updates for the OS (optional)
1. Ensure everything is up to date by running
```bash
sudo apt update && sudo apt upgrade -y
```
1. Install unattended upgrades
```bash
sudo apt install -y unattended-upgrades
echo unattended-upgrades unattended-upgrades/enable_auto_updates boolean true | sudo debconf-set-selections
sudo dpkg-reconfigure -f noninteractive unattended-upgrades
```
Now you have a minimal Debian server that requires very little maintenance.
### Install Docker
1. Install Docker Engine (not Docker Desktop) using the [official docs](https://docs.docker.com/engine/install/debian/)
1. Specifically, follow the steps in the [Install using the apt repository](https://docs.docker.com/engine/install/debian/#install-using-the-repository) section
2. Add your user to the docker group as described in the [Linux postinstall steps](https://docs.docker.com/engine/install/linux-postinstall/)
## Installing Frigate
This section shows how to create a minimal directory structure for a Docker installation on Debian. If you have installed Frigate as a Home Assistant addon or another way, you can continue to [Configuring Frigate](#configuring-frigate).
### Setup directories
Frigate requires a valid config file to start. The following directory structure is the bare minimum to get started. Once Frigate is running, you can use the built-in config editor which supports config validation.
```
.
├── docker-compose.yml
├── config/
│ └── config.yml
└── storage/
```
This will create the above structure:
```bash
mkdir storage config && touch docker-compose.yml config/config.yml
```
If you are setting up Frigate on a Linux device via SSH, you can use [nano](https://itsfoss.com/nano-editor-guide/) to edit the following files. If you prefer to edit remote files with a full editor instead of a terminal, I recommend using [Visual Studio Code](https://code.visualstudio.com/) with the [Remote SSH extension](https://code.visualstudio.com/docs/remote/ssh-tutorial).
:::note
This `docker-compose.yml` file is just a starter for amd64 devices. You will need to customize it for your setup as detailed in the [Installation docs](/frigate/installation#docker).
:::
`docker-compose.yml`
```yaml
version: "3.9"
services:
frigate:
container_name: frigate
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:stable
volumes:
- ./config:/config
- ./storage:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "8080:8080"
- "8554:8554" # RTSP feeds
```
`config.yml`
```yaml
mqtt:
enabled: False
cameras:
dummy_camera: # <--- this will be changed to your actual camera later
enabled: False
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:554/rtsp
roles:
- detect
```
Now you should be able to start Frigate by running `docker compose up -d` from within the folder containing `docker-compose.yml`. On startup, an admin user and password will be created and outputted in the logs. You can see this by running `docker logs frigate`. Frigate should now be accessible at `server_ip:8080` where you can login with the `admin` user and finish the configuration using the built-in configuration editor.
## Configuring Frigate
This section assumes that you already have an environment setup as described in [Installation](../frigate/installation.md). You should also configure your cameras according to the [camera setup guide](/frigate/camera_setup). Pay particular attention to the section on choosing a detect resolution.
### Step 1: Add a detect stream
@@ -15,6 +153,7 @@ mqtt:
cameras:
name_of_your_camera: # <------ Name the camera
enabled: True
ffmpeg:
inputs:
- path: rtsp://10.0.10.10:554/rtsp # <----- The stream you want to use for detection
@@ -26,7 +165,7 @@ cameras:
### Step 2: Start Frigate
At this point you should be able to start Frigate and see the the video feed in the UI.
At this point you should be able to start Frigate and see the video feed in the UI.
If you get an error image from the camera, this means ffmpeg was not able to get the video feed from your camera. Check the logs for error messages from ffmpeg. The default ffmpeg arguments are designed to work with H264 RTSP cameras that support TCP connections.
@@ -36,7 +175,21 @@ FFmpeg arguments for other types of cameras can be found [here](../configuration
Now that you have a working camera configuration, you want to setup hardware acceleration to minimize the CPU required to decode your video streams. See the [hardware acceleration](../configuration/hardware_acceleration.md) config reference for examples applicable to your hardware.
Here is an example configuration with hardware acceleration configured for Intel processors with an integrated GPU using the [preset](../configuration/ffmpeg_presets.md):
Here is an example configuration with hardware acceleration configured to work with most Intel processors with an integrated GPU using the [preset](../configuration/ffmpeg_presets.md):
`docker-compose.yml` (after modifying, you will need to run `docker compose up -d` to apply changes)
```yaml
version: "3.9"
services:
frigate:
...
devices:
- /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
...
```
`config.yml`
```yaml
mqtt: ...
@@ -53,6 +206,19 @@ cameras:
By default, Frigate will use a single CPU detector. If you have a USB Coral, you will need to add a detectors section to your config.
`docker-compose.yml` (after modifying, you will need to run `docker compose up -d` to apply changes)
```yaml
version: "3.9"
services:
frigate:
...
devices:
- /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
- /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
...
```
```yaml
mqtt: ...
@@ -71,7 +237,7 @@ cameras:
More details on available detectors can be found [here](../configuration/object_detectors.md).
Restart Frigate and you should start seeing detections for `person`. If you want to track other objects, they will need to be added according to the [configuration file reference](../configuration/index.md#full-configuration-reference).
Restart Frigate and you should start seeing detections for `person`. If you want to track other objects, they will need to be added according to the [configuration file reference](../configuration/reference.md).
### Step 5: Setup motion masks
@@ -79,7 +245,7 @@ Now that you have optimized your configuration for decoding the video stream, yo
Now that you know where you need to mask, use the "Mask & Zone creator" in the options pane to generate the coordinates needed for your config file. More information about masks can be found [here](../configuration/masks.md).
:::caution
:::warning
Note that motion masks should not be used to mark out areas where you do not want objects to be detected or to reduce false positives. They do not alter the image sent to object detection, so you can still get events and detections in areas with motion masks. These only prevent motion in these areas from initiating object detection.
@@ -139,7 +305,7 @@ cameras:
If you don't have separate streams for detect and record, you would just add the record role to the list on the first input.
By default, Frigate will retain video of all events for 10 days. The full set of options for recording can be found [here](../configuration/index.md#full-configuration-reference).
By default, Frigate will retain video of all events for 10 days. The full set of options for recording can be found [here](../configuration/reference.md).
#### Snapshots
@@ -159,11 +325,17 @@ cameras:
motion: ...
```
By default, Frigate will retain snapshots of all events for 10 days. The full set of options for snapshots can be found [here](../configuration/index.md#full-configuration-reference).
By default, Frigate will retain snapshots of all events for 10 days. The full set of options for snapshots can be found [here](../configuration/reference.md).
### Step 7: Follow up guides
### Step 7: Complete config
Now that you have a working install, you can use the following guides for additional features:
At this point you have a complete config with basic functionality. You can see the [full config reference](../configuration/reference.md) for a complete list of configuration options.
1. [Configuring go2rtc](configuring_go2rtc) - Additional live view options and RTSP relay
### Follow up
Now that you have a working install, you can use the following documentation for additional features:
1. [Configuring go2rtc](configuring_go2rtc.md) - Additional live view options and RTSP relay
2. [Home Assistant Integration](../integrations/home-assistant.md) - Integrate with Home Assistant
3. [Masks](../configuration/masks.md)
4. [Zones](../configuration/zones.md)

View File

@@ -1,21 +1,22 @@
---
id: ha_network_storage
title: HA Network Storage
title: Home Assistant network storage
---
As of HomeAsisstant Core 2023.6, Network Mounted Storage is supported for addons.
As of Home Assistant Core 2023.6, Network Mounted Storage is supported for addons.
## Setting Up Remote Storage For Frigate
### Prerequisites
- HA Core 2023.6 or newer is installed
- Running HA OS 10.2 or newer OR Running Supervised with latest os-agent installed (this is required for superivsed install)
- Running HA OS 10.2 or newer OR Running Supervised with latest os-agent installed (this is required for supervised install)
### Initial Setup
1. Stop the Frigate addon
2. Update your [config](configuration/index.md) so the DB is stored in the /config directory by adding:
```yaml
database:
path: /config/frigate.db

View File

@@ -13,7 +13,7 @@ The suggested steps are:
- **Encrypt** content from the proxy webserver by installing SSL (such as with [Let's Encrypt](https://letsencrypt.org/)). Note that SSL is then not required on your Frigate webserver as the proxy encrypts all requests for you
- **Restrict** access to your Frigate instance at the proxy using, for example, password authentication
:::caution
:::warning
A reverse proxy can be used to secure access to an internal webserver but the user will be entirely reliant
on the steps they have taken. You must ensure you are following security best practices.
This page does not attempt to outline the specific steps needed to secure your internal website.
@@ -38,20 +38,20 @@ Here we access Frigate via https://cctv.mydomain.co.uk
ServerName cctv.mydomain.co.uk
ProxyPreserveHost On
ProxyPass "/" "http://frigatepi.local:5000/"
ProxyPassReverse "/" "http://frigatepi.local:5000/"
ProxyPass "/" "http://frigatepi.local:8080/"
ProxyPassReverse "/" "http://frigatepi.local:8080/"
ProxyPass /ws ws://frigatepi.local:5000/ws
ProxyPassReverse /ws ws://frigatepi.local:5000/ws
ProxyPass /ws ws://frigatepi.local:8080/ws
ProxyPassReverse /ws ws://frigatepi.local:8080/ws
ProxyPass /live/ ws://frigatepi.local:5000/live/
ProxyPassReverse /live/ ws://frigatepi.local:5000/live/
ProxyPass /live/ ws://frigatepi.local:8080/live/
ProxyPassReverse /live/ ws://frigatepi.local:8080/live/
RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://frigatepi.local:5000/$1 [P,L]
RewriteRule /(.*) ws://frigatepi.local:8080/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://frigatepi.local:5000/$1 [P,L]
RewriteRule /(.*) http://frigatepi.local:8080/$1 [P,L]
</VirtualHost>
```
@@ -87,11 +87,11 @@ There are many ways to authenticate a website but a straightforward approach is
## Nginx Reverse Proxy
This method shows a working example for subdomain type reverse proxy with SSL enabled.
This method shows a working example for subdomain type reverse proxy with SSL enabled.
### Setup server and port to reverse proxy
This is set in `$server` and `$port` this should match your ports you have exposed to your docker container. Optionally you listen on port `443` and enable `SSL`
This is set in `$server` and `$port` this should match your ports you have exposed to your docker container. Optionally you listen on port `443` and enable `SSL`
```
# ------------------------------------------------------------
@@ -101,7 +101,7 @@ This is set in `$server` and `$port` this should match your ports you have expos
server {
set $forward_scheme http;
set $server "192.168.100.2"; # FRIGATE SERVER LOCATION
set $port 5000;
set $port 8080;
listen 80;
listen 443 ssl http2;
@@ -112,7 +112,7 @@ server {
### Setup SSL (optional)
This section points to your SSL files, the example below shows locations to a default Lets Encrypt SSL certificate.
This section points to your SSL files, the example below shows locations to a default Lets Encrypt SSL certificate.
```
# Let's Encrypt SSL
@@ -122,10 +122,9 @@ This section points to your SSL files, the example below shows locations to a de
ssl_certificate_key /etc/letsencrypt/live/npm-1/privkey.pem;
```
### Setup reverse proxy settings
### Setup reverse proxy settings
Thhe settings below enabled connection upgrade, sets up logging (optional) and proxies everything from the `/` context to the docker host and port specified earlier in the configuration
The settings below enabled connection upgrade, sets up logging (optional) and proxies everything from the `/` context to the docker host and port specified earlier in the configuration
```
proxy_set_header Upgrade $http_upgrade;

View File

@@ -1,43 +0,0 @@
---
id: stationary_objects
title: Avoiding stationary objects
---
Many people use Frigate to detect cars entering their driveway, and they often run into an issue with repeated notifications or events of a parked car being repeatedly detected over the course of multiple days (for example if the car is lost at night and detected again the following morning).
You can use zones to restrict events and notifications to objects that have entered specific areas.
:::caution
It is not recommended to use masks to try and eliminate parked cars in your driveway. Masks are designed to prevent motion from triggering object detection and/or to indicate areas that are guaranteed false positives.
Frigate is designed to track objects as they move and over-masking can prevent it from knowing that an object in the current frame is the same as the previous frame. You want Frigate to detect objects everywhere and configure your events and alerts to be based on the location of the object with zones.
:::
:::info
Once a vehicle crosses the entrance into the parking area, that event will stay `In Progress` until it is no longer seen in the frame. Frigate is designed to have an event last as long as an object is visible in the frame, an event being `In Progress` does not mean the event is being constantly recorded. You can define the recording behavior by adjusting the [recording retention settings](../configuration/record.md).
:::
To only be notified of cars that enter your driveway from the street, you could create multiple zones that cover your driveway. For cars, you would only notify if `entered_zones` from the events MQTT topic has more than 1 zone.
See [this example](../configuration/zones.md#restricting-zones-to-specific-objects) from the Zones documentation to see how to restrict zones to certain object types.
![Driveway Zones](/img/driveway_zones-min.png)
To limit snapshots and events, you can list the zone for the entrance of your driveway under `required_zones` in your configuration file. Example below.
```yaml
camera:
record:
events:
required_zones:
- zone_2
zones:
zone_1:
coordinates: ... (parking area)
zone_2:
coordinates: ... (entrance to driveway)
```

View File

@@ -5,45 +5,15 @@ title: HTTP API
A web server is available on port 5000 with the following endpoints.
### `GET /api/<camera_name>`
## Management & Information
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.
### `GET /api/config`
Accepts the following query string parameters:
A json representation of your configuration
| param | Type | Description |
| ----------- | ---- | ------------------------------------------------------------------ |
| `fps` | int | Frame rate |
| `h` | int | Height in pixels |
| `bbox` | int | Show bounding boxes for detected objects (0 or 1) |
| `timestamp` | int | Print the timestamp in the upper left (0 or 1) |
| `zones` | int | Draw the zones on the image (0 or 1) |
| `mask` | int | Overlay the mask on the image (0 or 1) |
| `motion` | int | Draw blue boxes for areas with detected motion (0 or 1) |
| `regions` | int | Draw green boxes for areas where object detection was run (0 or 1) |
### `POST /api/restart`
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`.
### `GET /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:
| param | Type | Description |
| ----------- | ---- | ------------------------------------------------------------------ |
| `h` | int | Height in pixels |
| `bbox` | int | Show bounding boxes for detected objects (0 or 1) |
| `timestamp` | int | Print the timestamp in the upper left (0 or 1) |
| `zones` | int | Draw the zones on the image (0 or 1) |
| `mask` | int | Overlay the mask on the image (0 or 1) |
| `motion` | int | Draw blue boxes for areas with detected motion (0 or 1) |
| `regions` | int | Draw green boxes for areas where object detection was run (0 or 1) |
| `quality` | int | Jpeg encoding quality (0-100). Defaults to 70. |
Example parameters:
- `h=300`: resizes the image to 300 pixes tall
Restarts Frigate process.
### `GET /api/stats`
@@ -54,35 +24,37 @@ Sample response:
```json
{
/* 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
"cameras": {
"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.
@@ -139,18 +111,109 @@ Sample response:
"mnt_type": "tmpfs"
}
}
},
"cpu_usages": {
"pid": {
"cmdline": "ffmpeg...",
"cpu": "5.0",
"cpu_average": "3.0",
"mem": "0.5"
}
},
"gpu_usages": {
"gpu-type": {
"gpu": "17%",
"mem": "18%"
}
}
}
```
### `GET /api/config`
A json representation of your configuration
### `GET /api/version`
Version info
### `GET /api/ffprobe`
Get ffprobe output for camera feed paths.
| param | Type | Description |
| ------- | ------ | ---------------------------------- |
| `paths` | string | `,` separated list of camera paths |
### `GET /api/<camera_name>/ptz/info`
Get PTZ info for the camera.
## Camera Media
### `GET /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:
| param | Type | Description |
| ----------- | ---- | ------------------------------------------------------------------ |
| `fps` | int | Frame rate |
| `h` | int | Height in pixels |
| `bbox` | int | Show bounding boxes for detected objects (0 or 1) |
| `timestamp` | int | Print the timestamp in the upper left (0 or 1) |
| `zones` | int | Draw the zones on the image (0 or 1) |
| `mask` | int | Overlay the mask on the image (0 or 1) |
| `motion` | int | Draw blue boxes for areas with detected motion (0 or 1) |
| `regions` | int | Draw 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:8080/api/back?h=1080`. You can also increase the FPS by appending `fps=frame-rate` to the URL such as `http://localhost:8080/api/back?fps=10` or both with `?fps=10&h=1000`.
### `GET /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:
| param | Type | Description |
| ----------- | ---- | ------------------------------------------------------------------ |
| `h` | int | Height in pixels |
| `bbox` | int | Show bounding boxes for detected objects (0 or 1) |
| `timestamp` | int | Print the timestamp in the upper left (0 or 1) |
| `zones` | int | Draw the zones on the image (0 or 1) |
| `mask` | int | Overlay the mask on the image (0 or 1) |
| `motion` | int | Draw blue boxes for areas with detected motion (0 or 1) |
| `regions` | int | Draw green boxes for areas where object detection was run (0 or 1) |
| `quality` | int | Jpeg encoding quality (0-100). Defaults to 70. |
Example parameters:
- `h=300`: resizes the image to 300 pixels tall
### `GET /api/<camera_name>/<label>/thumbnail.jpg`
Returns the thumbnail from the latest event for the given camera and label combo. Using `any` as the label will return the latest thumbnail regardless of type.
### `GET /api/<camera_name>/<label>/clip.mp4`
Returns the clip from the latest event for the given camera and label combo. Using `any` as the label will return the latest clip regardless of type.
### `GET /api/<camera_name>/<label>/snapshot.jpg`
Returns the snapshot image from the latest event for the given camera and label combo. Using `any` as the label will return the latest thumbnail regardless of type.
### `GET /api/<camera_name>/grid.jpg`
Returns the latest camera image with the regions grid overlaid.
| param | Type | Description |
| ------------ | ----- | ------------------------------------------------------------------------------------------ |
| `color` | str | The color of the grid (red,green,blue,black,white). Defaults to "green". |
| `font_scale` | float | Font scale. Can be used to increase font size on high resolution cameras. Defaults to 0.5. |
### `GET /clips/<camera>-<id>.jpg`
JPG snapshot for the given camera and event id.
## Events
### `GET /api/events`
Events from the database. Accepts the following query string parameters:
@@ -175,16 +238,6 @@ Events from the database. Accepts the following query string parameters:
| `min_length` | float | Minimum length of the event |
| `max_length` | float | Maximum length of the event |
### `GET /api/timeline`
Timeline of key moments of an event(s) from the database. Accepts the following query string parameters:
| param | Type | Description |
| ----------- | ---- | ----------------------------------- |
| `camera` | str | Name of camera |
| `source_id` | str | ID of tracked object |
| `limit` | int | Limit the number of events returned |
### `GET /api/events/summary`
Returns summary data for events in the database. Used by the Home Assistant integration.
@@ -225,7 +278,7 @@ Sub labels must be 100 characters or shorter.
```json
{
"subLabel": "some_string",
"subLabelScore": 0.79,
"subLabelScore": 0.79
}
```
@@ -233,14 +286,18 @@ Sub labels must be 100 characters or shorter.
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.
### `GET /api/<camera_name>/<label>/thumbnail.jpg`
Returns the thumbnail from the latest event for the given camera and label combo. Using `any` as the label will return the latest thumbnail regardless of type.
### `GET /api/events/<id>/clip.mp4`
Returns the clip for the event id. Works after the event has ended.
### `GET /api/events/<id>/snapshot-clean.png`
Returns the clean snapshot image for the event id. Only works if `snapshots` and `clean_copy` are enabled in the config.
| param | Type | Description |
| ---------- | ---- | ------------------ |
| `download` | bool | Download the image |
### `GET /api/events/<id>/snapshot.jpg`
Returns the snapshot image for the event id. Works while the event is in progress and after completion.
@@ -254,75 +311,13 @@ Accepts the following query string parameters, but they are only applied when an
| `timestamp` | int | Print the timestamp in the upper left (0 or 1) |
| `crop` | int | Crop the snapshot to the (0 or 1) |
| `quality` | int | Jpeg encoding quality (0-100). Defaults to 70. |
### `GET /api/<camera_name>/<label>/snapshot.jpg`
Returns the snapshot image from the latest event for the given camera and label combo. Using `any` as the label will return the latest thumbnail regardless of type.
### `GET /api/<camera_name>/recordings/<frame_time>/snapshot.png`
Returns the snapshot image from the specific point in that cameras recordings.
### `GET /clips/<camera>-<id>.jpg`
JPG snapshot for the given camera and event id.
### `GET /vod/<year>-<month>/<day>/<hour>/<camera>/master.m3u8`
HTTP Live Streaming Video on Demand URL for the specified hour and camera. Can be viewed in an application like VLC.
### `GET /vod/event/<event-id>/index.m3u8`
HTTP Live Streaming Video on Demand URL for the specified event. Can be viewed in an application like VLC.
### `GET /vod/<camera>/start/<start-timestamp>/end/<end-timestamp>/index.m3u8`
HTTP Live Streaming Video on Demand URL for the camera with the specified time range. Can be viewed in an application like VLC.
### `POST /api/export/<camera>/start/<start-timestamp>/end/<end-timestamp>`
Export recordings from `start-timestamp` to `end-timestamp` for `camera` as a single mp4 file. These recordings will be exported to the `/media/frigate/exports` folder.
It is also possible to export this recording as a timelapse.
**Optional Body:**
```json
{
"playback": "realtime", // playback factor: realtime or timelapse_25x
}
```
### `GET /api/<camera_name>/recordings/summary`
Hourly summary of recordings data for a camera.
### `GET /api/<camera_name>/recordings`
Get recording segment details for the given timestamp range.
| param | Type | Description |
| -------- | ---- | ------------------------------------- |
| `after` | int | Unix timestamp for beginning of range |
| `before` | int | Unix timestamp for end of range |
### `GET /api/ffprobe`
Get ffprobe output for camera feed paths.
| param | Type | Description |
| ------- | ------ | ---------------------------------- |
| `paths` | string | `,` separated list of camera paths |
### `GET /api/<camera_name>/ptz/info`
Get PTZ info for the camera.
| `download` | bool | Download the image |
### `POST /api/events/<camera_name>/<label>/create`
Create a manual event with a given `label` (ex: doorbell press) to capture a specific event besides an object being detected.
:::caution
:::warning
Recording retention config still applies to manual events, if frigate is configured with `mode: motion` then the manual event will only keep recording segments when motion occurred.
@@ -361,3 +356,170 @@ Recording retention config still applies to manual events, if frigate is configu
### `PUT /api/events/<event_id>/end`
End a specific manual event without a predetermined length.
### `GET /api/events/<id>/preview.gif`
Gif covering the first 20 seconds of a specific event.
## Previews
Previews are low res / fps videos that are quickly scrubbable and can be used for notifications or time-lapses.
### `GET /api/preview/<camera>/start/<start-timestamp>/end/<end-timestamp>`
Metadata about previews for this time range.
### `GET /api/preview/<year>-<month>/<day>/<hour>/<camera>/<timezone>`
Metadata about previews for this hour
### `GET /api/preview/<camera>/start/<start-timestamp>/end/<end-timestamp>`
List of frames in the preview cache for the time range. Previews are only kept in the cache until they are combined into an mp4 at the end of the hour.
### `GET /api/preview/<file_name>/thumbnail.jpg`
Specific preview frame from preview cache.
### `GET /<camera>/start/<start-timestamp>/end/<end-timestamp>/preview.gif`
Gif made from preview video / frames during this time range
## Recordings
### `GET /vod/<year>-<month>/<day>/<hour>/<camera>/master.m3u8`
HTTP Live Streaming Video on Demand URL for the specified hour and camera. Can be viewed in an application like VLC.
### `GET /vod/event/<event-id>/index.m3u8`
HTTP Live Streaming Video on Demand URL for the specified event. Can be viewed in an application like VLC.
### `GET /vod/<camera>/start/<start-timestamp>/end/<end-timestamp>/index.m3u8`
HTTP Live Streaming Video on Demand URL for the camera with the specified time range. Can be viewed in an application like VLC.
### `POST /api/export/<camera>/start/<start-timestamp>/end/<end-timestamp>`
Export recordings from `start-timestamp` to `end-timestamp` for `camera` as a single mp4 file. These recordings will be exported to the `/media/frigate/exports` folder.
It is also possible to export this recording as a time-lapse.
**Optional Body:**
```json
{
"playback": "realtime" // playback factor: realtime or timelapse_25x
}
```
### `DELETE /api/export/<export_name>`
Delete an export from disk.
### `PATCH /api/export/<export_name_current>/<export_name_new>`
Renames an export.
### `GET /api/<camera_name>/recordings/summary`
Hourly summary of recordings data for a camera.
### `GET /api/<camera_name>/recordings`
Get recording segment details for the given timestamp range.
| param | Type | Description |
| -------- | ---- | ------------------------------------- |
| `after` | int | Unix timestamp for beginning of range |
| `before` | int | Unix timestamp for end of range |
### `GET /api/<camera_name>/recordings/<frame_time>/snapshot.png`
Returns the snapshot image from the specific point in that cameras recordings.
## Reviews
### `GET /api/review`
Reviews from the database. Accepts the following query string parameters:
| param | Type | Description |
| ---------- | ---- | -------------------------------------------------------------- |
| `before` | int | Epoch time |
| `after` | int | Epoch time |
| `cameras` | str | , separated list of cameras |
| `labels` | str | , separated list of labels |
| `reviewed` | int | Include items that have been reviewed (0 or 1) |
| `limit` | int | Limit the number of events returned |
| `severity` | str | Limit items to severity (alert, detection, significant_motion) |
### `GET /api/review/summary`
Summary of reviews for the last 30 days. Accepts the following query string parameters:
| param | Type | Description |
| ---------- | ---- | --------------------------- |
| `cameras` | str | , separated list of cameras |
| `labels` | str | , separated list of labels |
| `timezone` | str | Timezone name |
### `POST /api/reviews/viewed`
Mark item(s) as reviewed.
**Required Body:**
```json
{
"ids": ["123", "456"] // , separated list of review IDs
}
```
### `DELETE /api/review/<id>/viewed`
Mark an item as not reviewed.
### `POST /api/reviews/delete`
Delete review items.
**Required Body:**
```json
{
"ids": ["123", "456"] // , separated list of review IDs
}
```
### `GET /review/activity/motion`
Get the motion activity for camera(s) during a specified time period.
| param | Type | Description |
| ---------- | ---- | -------------------------------------------------------------- |
| `before` | int | Epoch time |
| `after` | int | Epoch time |
| `cameras` | str | , separated list of cameras |
### `GET /review/activity/audio`
Get the audio activity for camera(s) during a specified time period.
| param | Type | Description |
| ---------- | ---- | -------------------------------------------------------------- |
| `before` | int | Epoch time |
| `after` | int | Epoch time |
| `cameras` | str | , separated list of cameras |
## Timeline
### `GET /api/timeline`
Timeline of key moments of an event(s) from the database. Accepts the following query string parameters:
| param | Type | Description |
| ----------- | ---- | ----------------------------------- |
| `camera` | str | Name of camera |
| `source_id` | str | ID of tracked object |
| `limit` | int | Limit the number of events returned |

View File

@@ -47,7 +47,55 @@ that card.
## Configuration
When configuring the integration, you will be asked for the `URL` of your Frigate instance which is the URL you use to access Frigate in the browser. This may look like `http://<host>:5000/`. If you are using HassOS with the addon, the URL should be one of the following depending on which addon version you are using. Note that if you are using the Proxy Addon, you do NOT point the integration at the proxy URL. Just enter the URL used to access Frigate directly from your network.
When configuring the integration, you will be asked for the `URL` of your Frigate instance which needs to be pointed at the internal unauthenticated port (`5000`) for your instance. This may look like `http://<host>:5000/`.
### Docker Compose Examples
If you are running Home Assistant Core and Frigate with Docker Compose on the same device, here are some examples.
#### Home Assistant running with host networking
It is not recommended to run Frigate in host networking mode. In this example, you would use `http://172.17.0.1:5000` when configuring the integration.
```yaml
services:
homeassistant:
container_name: hass
image: ghcr.io/home-assistant/home-assistant:stable
network_mode: host
...
frigate:
image: ghcr.io/blakeblackshear/frigate:stable
...
ports:
- "172.17.0.1:5000:5000"
...
```
#### Home Assistant _not_ running with host networking or in a separate compose file
In this example, you would use `http://frigate:5000` when configuring the integration. There is no need to map the port for the Frigate container.
```yaml
services:
homeassistant:
container_name: hass
image: ghcr.io/home-assistant/home-assistant:stable
# network_mode: host
...
frigate:
image: ghcr.io/blakeblackshear/frigate:stable
...
ports:
# - "172.17.0.1:5000:5000"
...
```
### HassOS Addon
If you are using HassOS with the addon, the URL should be one of the following depending on which addon version you are using. Note that if you are using the Proxy Addon, you do NOT point the integration at the proxy URL. Just enter the URL used to access Frigate directly from your network.
| Addon Version | URL |
| ------------------------------ | -------------------------------------- |
@@ -56,7 +104,37 @@ When configuring the integration, you will be asked for the `URL` of your Frigat
| Frigate NVR Beta | `http://ccab4aaf-frigate-beta:5000` |
| Frigate NVR Beta (Full Access) | `http://ccab4aaf-frigate-fa-beta:5000` |
<a name="options"></a>
### Frigate running on a separate machine
If you run Frigate on a separate device within your local network, Home Assistant will need access to port 5000.
#### Local network
Use `http://<frigate_device_ip>:5000` as the URL for the integration. If you want to protect access to port 5000, you can use firewall rules to limit access to the device running Home Assistant.
```yaml
services:
frigate:
image: ghcr.io/blakeblackshear/frigate:stable
...
ports:
- "5000:5000"
...
```
#### Tailscale or other private networking
Use `http://<frigate_device_tailscale_ip>:5000` as the URL for the integration.
```yaml
services:
frigate:
image: ghcr.io/blakeblackshear/frigate:stable
...
ports:
- "<tailscale_ip>:5000:5000"
...
```
## Options
@@ -64,9 +142,9 @@ When configuring the integration, you will be asked for the `URL` of your Frigat
Home Assistant > Configuration > Integrations > Frigate > Options
```
| Option | Description |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| RTSP URL Template | A [jinja2](https://jinja.palletsprojects.com/) template that is used to override the standard RTSP stream URL (e.g. for use with reverse proxies). This option is only shown to users who have [advanced mode](https://www.home-assistant.io/blog/2019/07/17/release-96/#advanced-mode) enabled. See [RTSP streams](#streams) below. |
| Option | Description |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RTSP URL Template | A [jinja2](https://jinja.palletsprojects.com/) template that is used to override the standard RTSP stream URL (e.g. for use with reverse proxies). This option is only shown to users who have [advanced mode](https://www.home-assistant.io/blog/2019/07/17/release-96/#advanced-mode) enabled. See [RTSP streams](#rtsp-stream) below. |
## Entities Provided
@@ -124,10 +202,6 @@ https://HA_URL/api/frigate/notifications/<event-id>/clip.mp4
<a name="streams"></a>
## RTMP stream
RTMP is deprecated and it is recommended to switch to use RTSP restreams.
## RTSP stream
In order for the live streams to function they need to be accessible on the RTSP
@@ -177,12 +251,12 @@ The Frigate integration seamlessly supports the use of multiple Frigate servers.
In order for multiple Frigate instances to function correctly, the
`topic_prefix` and `client_id` parameters must be set differently per server.
See [MQTT
configuration](mqtt.md)
configuration](mqtt)
for how to set these.
#### API URLs
When multiple Frigate instances are configured, [API](#api) URLs should include an
When multiple Frigate instances are configured, [API](#notification-api) URLs should include an
identifier to tell Home Assistant which Frigate instance to refer to. The
identifier used is the MQTT `client_id` parameter included in the configuration,
and is used like so:

View File

@@ -221,6 +221,10 @@ Topic to turn the PTZ autotracker for a camera on and off. Expected values are `
Topic with current state of the PTZ autotracker for a camera. Published values are `ON` and `OFF`.
### `frigate/<camera_name>/ptz_autotracker/active`
Topic to determine if PTZ autotracker is actively tracking an object. Published values are `ON` and `OFF`.
### `frigate/<camera_name>/birdseye/set`
Topic to turn Birdseye for a camera on and off. Expected values are `ON` and `OFF`. Birdseye mode

View File

@@ -19,9 +19,9 @@ Once logged in, you can generate an API key for Frigate in Settings.
### Set your API key
In Frigate, you can set the `PLUS_API_KEY` environment variable to enable the `SEND TO FRIGATE+` buttons on the events page. You can set it in your Docker Compose file or in your Docker run command. Home Assistant Addon users can set it under Settings > Addons > Frigate NVR > Configuration > Options (be sure to toggle the "Show unused optional configuration options" switch).
In Frigate, you can use an environment variable or a docker secret named `PLUS_API_KEY` to enable the `SEND TO FRIGATE+` buttons on the events page. Home Assistant Addon users can set it under Settings > Addons > Frigate NVR > Configuration > Options (be sure to toggle the "Show unused optional configuration options" switch).
:::caution
:::warning
You cannot use the `environment_vars` section of your configuration file to set this environment variable.
@@ -37,11 +37,13 @@ Snapshots must be enabled to be able to submit examples to Frigate+
:::
![Send To Plus](/img/send-to-plus.png)
![Send To Plus](/img/plus/send-to-plus.jpg)
![Submit To Plus](/img/plus/submit-to-plus.jpg)
### Annotate and verify
You can view all of your submitted images at [https://plus.frigate.video](https://plus.frigate.video). Annotations can be added by clicking an image.
You can view all of your submitted images at [https://plus.frigate.video](https://plus.frigate.video). Annotations can be added by clicking an image. For more detailed information about labeling, see the documentation on [improving your model](../plus/improving_model.md).
![Annotate](/img/annotate.png)
@@ -56,7 +58,7 @@ model:
Models are downloaded into the `/config/model_cache` folder and only downloaded if needed.
You can override the labelmap for Frigate+ models like this:
If needed, you can override the labelmap for Frigate+ models. This is not recommended as renaming labels will break the Submit to Frigate+ feature if the labels are not available in Frigate+.
```yaml
model:

View File

@@ -4,9 +4,9 @@ title: Third Party Extensions
---
Being open source, others have the possibility to modify and extend the rich functionality Frigate already offers.
This page is meant to be an overview over additions one can make to the home NVR setup. The list is not exhaustive and can be extended via PR to the Frigate docs.
This page is meant to be an overview over additions one can make to the home NVR setup. The list is not exhaustive and can be extended via PR to the Frigate docs. Most of these services are designed to interface with Frigate's unauthenticated api over port 5000.
:::caution
:::warning
This page does not recommend or rate the presented projects.
Please use your own knowledge to assess and vet them before you install anything on your system.

24
docs/docs/plus/faq.md Normal file
View File

@@ -0,0 +1,24 @@
---
id: faq
title: FAQ
---
### Are my models trained just on my image uploads? How are they built?
Frigate+ models are built by fine tuning a base model with the images you have annotated and verified. The base model is trained from scratch from a sampling of images across all Frigate+ user submissions and takes weeks of expensive GPU resources to train. If the models were built using your image uploads alone, you would need to provide tens of thousands of examples and it would take more than a week (and considerable cost) to train. Diversity helps the model generalize.
### Are my video feeds sent to the cloud for analysis when using Frigate+ models?
No. Frigate+ models are a drop in replacement for the default model. All processing is performed locally as always. The only images sent to Frigate+ are the ones you specifically submit via the `Send to Frigate+` button or upload directly.
### Can I label anything I want and train the model to recognize something custom for me?
Not currently. At the moment, the set of labels will be consistent for all users. The focus will be on expanding that set of labels before working on completely custom user labels.
### Can Frigate+ models be used offline?
Yes. Models and metadata are stored in the `model_cache` directory within the config folder. Frigate will only attempt to download a model if it does not exist in the cache. This means you can backup the directory and/or use it completely offline.
### Can I keep using my Frigate+ models even if I do not renew my subscription?
Yes. Subscriptions to Frigate+ provide access to the infrastructure used to train the models. Models trained with your subscription are yours to keep and use forever. However, do note that the terms and conditions prohibit you from sharing, reselling, or creating derivative products from the models.

View File

@@ -0,0 +1,63 @@
---
id: first_model
title: Requesting your first model
---
## Step 1: Upload and annotate your images
Before requesting your first model, you will need to upload at least 10 images to Frigate+. But for the best results, you should provide at least 100 verified images per camera. Keep in mind that varying conditions should be included. You will want images from cloudy days, sunny days, dawn, dusk, and night. Refer to the [integration docs](../integrations/plus.md#generate-an-api-key) for instructions on how to easily submit images to Frigate+ directly from Frigate.
It is recommended to submit **both** true positives and false positives. This will help the model differentiate between what is and isn't correct. You should aim for a target of 80% true positive submissions and 20% false positives across all of your images. If you are experiencing false positives in a specific area, submitting true positives for any object type near that area in similar lighting conditions will help teach the model what that area looks like when no objects are present.
For more detailed recommendations, you can refer to the docs on [improving your model](./improving_model.md).
## Step 2: Submit a model request
Once you have an initial set of verified images, you can request a model on the Models page. Each model request requires 1 of the 12 trainings that you receive with your annual subscription. This model will support all [label types available](./index.md#available-label-types) even if you do not submit any examples for those labels. Model creation can take up to 36 hours.
![Plus Models Page](/img/plus/plus-models.jpg)
## Step 3: Set your model id in the config
You will receive an email notification when your Frigate+ model is ready.
![Model Ready Email](/img/plus/model-ready-email.jpg)
Models available in Frigate+ can be used with a special model path. No other information needs to be configured because it fetches the remaining config from Frigate+ automatically.
```yaml
model:
path: plus://<your_model_id>
```
## Step 4: Adjust your object filters for higher scores
Frigate+ models generally have much higher scores than the default model provided in Frigate. You will likely need to increase your `threshold` and `min_score` values. Here is an example of how these values can be refined, but you should expect these to evolve as your model improves. For more information about how `threshold` and `min_score` are related, see the docs on [object filters](../configuration/object_filters.md#object-scores).
```yaml
objects:
filters:
dog:
min_score: .7
threshold: .9
cat:
min_score: .65
threshold: .8
face:
min_score: .7
package:
min_score: .65
threshold: .9
license_plate:
min_score: .6
amazon:
min_score: .75
ups:
min_score: .75
fedex:
min_score: .75
person:
min_score: .65
threshold: .85
car:
min_score: .65
threshold: .85
```

View File

@@ -0,0 +1,53 @@
---
id: improving_model
title: Improving your model
---
You may find that Frigate+ models result in more false positives initially, but by submitting true and false positives, the model will improve. Because a limited number of users submitted images to Frigate+ prior to this launch, you may need to submit several hundred images per camera to see good results. With all the new images now being submitted, future base models will improve as more and more users (including you) submit examples to Frigate+. Note that only verified images will be used when training your model. Submitting an image from Frigate as a true or false positive will not verify the image. You still must verify the image in Frigate+ in order for it to be used in training.
- **Submit both true positives and false positives**. This will help the model differentiate between what is and isn't correct. You should aim for a target of 80% true positive submissions and 20% false positives across all of your images. If you are experiencing false positives in a specific area, submitting true positives for any object type near that area in similar lighting conditions will help teach the model what that area looks like when no objects are present.
- **Lower your thresholds a little in order to generate more false/true positives near the threshold value**. For example, if you have some false positives that are scoring at 68% and some true positives scoring at 72%, you can try lowering your threshold to 65% and submitting both true and false positives within that range. This will help the model learn and widen the gap between true and false positive scores.
- **Submit diverse images**. For the best results, you should provide at least 100 verified images per camera. Keep in mind that varying conditions should be included. You will want images from cloudy days, sunny days, dawn, dusk, and night. As circumstances change, you may need to submit new examples to address new types of false positives. For example, the change from summer days to snowy winter days or other changes such as a new grill or patio furniture may require additional examples and training.
## Properly labeling images
For the best results, follow the following guidelines.
**Label every object in the image**: It is important that you label all objects in each image before verifying. If you don't label a car for example, the model will be taught that part of the image is _not_ a car and it will start to get confused.
**Make tight bounding boxes**: Tighter bounding boxes improve the recognition and ensure that accurate bounding boxes are predicted at runtime.
**Label the full object even when occluded**: If you have a person standing behind a car, label the full person even though a portion of their body may be hidden behind the car. This helps predict accurate bounding boxes and improves zone accuracy and filters at runtime. If an object is partly out of frame, label it only when a person would reasonably be able to recognize the object from the visible parts.
**Label objects hard to identify as difficult**: When objects are truly difficult to make out, such as a car barely visible through a bush, or a dog that is hard to distinguish from the background at night, flag it as 'difficult'. This is not used in the model training as of now, but will in the future.
**`amazon`, `ups`, and `fedex` should label the logo**: For a Fedex truck, label the truck as a `car` and make a different bounding box just for the Fedex logo. If there are multiple logos, label each of them.
![Fedex Logo](/img/plus/fedex-logo.jpg)
## False positive labels
False positives will be shown with a read box and the label will have a strike through.
![false positive](/img/plus/false-positive.jpg)
Misidentified objects should have a correct label added. For example, if a person was mistakenly detected as a cat, you should submit it as a false positive in Frigate and add a label for the person. The boxes will overlap.
![add image](/img/plus/false-positive-overlap.jpg)
## Shortcuts for a faster workflow
|Shortcut Key|Description|
|-----|--------|
|`?`|Show all keyboard shortcuts|
|`w`|Add box|
|`d`|Toggle difficult|
|`s`|Switch to the next label|
|`tab`|Select next largest box|
|`del`|Delete current box|
|`esc`|Deselect/Cancel|
|`← ↑ → ↓`|Move box|
|`Shift + ← ↑ → ↓`|Resize box|
|`-`|Zoom out|
|`=`|Zoom in|
|`f`|Hide/show all but current box|
|`spacebar`|Verify and save|

View File

@@ -1,87 +1,37 @@
---
id: index
title: Models Guide
title: Models
---
Frigate+ offers models trained from scratch and specifically designed for the way Frigate NVR analyzes video footage. These models offer higher accuracy with less resources. By uploading your own labeled examples, your model is tuned for accuracy in your specific conditions. After tuning, performance is evaluated against a broad dataset and real world examples submitted by other Frigate+ users to prevent overfitting.
<a href="https://plus.frigate.video" target="_blank" rel="nofollow">Frigate+</a> offers models trained on images submitted by Frigate+ users from their security cameras and is specifically designed for the way Frigate NVR analyzes video footage. These models offer higher accuracy with less resources. The images you upload are used to fine tune a baseline model trained from images uploaded by all Frigate+ users. This fine tuning process results in a model that is optimized for accuracy in your specific conditions.
With a subscription, and at each annual renewal, you will receive 12 model training credits that can be used to train tuned models. If you cancel your subscription, you will keep your existing credits and retain access to any trained models. Users with an active subscription can purchase additional training credits for $5 each.
:::info
Information on how to integrate Frigate+ with Frigate can be found in the [integrations docs](/integrations/plus).
The baseline model isn't directly available after subscribing. This may change in the future, but for now you will need to submit a model request with the minimum number of images.
## Frequently asked questions
:::
### Are my models trained just on my image uploads? How are they built?
With a subscription, 12 model trainings per year are included. If you cancel your subscription, you will retain access to any trained models. An active subscription is required to submit model requests or purchase additional trainings.
Frigate+ models are built by fine tuning a base model with the images you have annotated and verified. The base model is trained from scratch from a sampling of images across all Frigate+ user submissions and takes weeks of expensive GPU resources to train. If the models were built using your image uploads alone, you would need to provide tens of thousands of examples and it would take more than a week (and considerable cost) to train. Diversity helps the model generalize.
Information on how to integrate Frigate+ with Frigate can be found in the [integration docs](../integrations/plus.md).
### What is a training credit and how do I use them?
## Supported detector types
Essentially, `1 training credit = 1 trained model`. When you have uploaded, annotated, and verified additional images and you are ready to train your model, you will submit a model request which will use one credit. The model that is trained will utilize all of the verified images in your account.
:::warning
### Are my video feeds sent to the cloud for analysis when using Frigate+ models?
Frigate+ models are not supported for TensorRT or OpenVino yet.
No. Frigate+ models are a drop in replacement for the default model. All processing is performed locally as always. The only images sent to Frigate+ are the ones you specifically submit via the `Send to Frigate+` button or upload directly.
### Can I label anything I want and train the model to recognize something custom for me?
Not currently. At the moment, the set of labels will be consistent for all users. The focus will be on expanding that set of labels before working on completely custom user labels.
### Can Frigate+ models be used offline?
Yes. Models and metadata are stored in the `model_cache` directory within the config folder. Frigate will only attempt to download a model if it does not exist in the cache. This means you can backup the directory and/or use it completely offline.
### Can I keep using my Frigate+ models even if I do not renew my subscription?
Yes. Subscriptions to Frigate+ provide access to the infrastructure used to train the models. Models trained using the training credits that you purchased are yours to keep and use forever. However, do note that the terms and conditions prohibit you from sharing, reselling, or creating derivative products from the models.
## Important model information
### Supported Model Types
:::
Currently, Frigate+ models only support CPU (`cpu`) and Coral (`edgetpu`) models. OpenVino is next in line to gain support.
The models are created using the same MobileDet architecture as the default model. Additional architectures will be added in future releases as needed.
### Higher Scores
Frigate+ models generally have much higher scores than the default model provided in Frigate. You will likely need to increase your `threshold` and `min_score` values. Here is an example of how these values can be refined, but you should expect these to evolve as your model improves:
```yaml
objects:
filters:
dog:
min_score: .7
threshold: .9
cat:
min_score: .65
threshold: .8
face:
min_score: .7
package:
min_score: .65
threshold: .9
license_plate:
min_score: .6
amazon:
min_score: .75
ups:
min_score: .75
fedex:
min_score: .75
person:
min_score: .65
threshold: .85
car:
min_score: .65
threshold: .85
```
### Available label types
## Available label types
Frigate+ models support a more relevant set of objects for security cameras. Currently, only the following objects are supported: `person`, `face`, `car`, `license_plate`, `amazon`, `ups`, `fedex`, `package`, `dog`, `cat`, `deer`. Other object types available in the default Frigate model are not available. Additional object types will be added in future releases.
#### Label attributes
### Label attributes
Frigate has special handling for some labels when using Frigate+ models. `face`, `license_plate`, `amazon`, `ups`, and `fedex` are considered attribute labels which are not tracked like regular objects and do not generate events. In addition, the `threshold` filter will have no effect on these labels. You should adjust the `min_score` and other filter values as needed.
@@ -109,31 +59,3 @@ When using Frigate+ models, Frigate will choose the snapshot of a person object
`amazon`, `ups`, and `fedex` labels are used to automatically assign a sub label to car objects.
![Fedex Attribute](/img/plus/attribute-example-fedex.jpg)
## Properly labeling images
For the best results, follow the following guidelines.
**Label every object in the image**: It is important that you label all objects in each image before verifying. If you don't label a car for example, the model will be taught that part of the image is _not_ a car and it will start to get confused.
**Make tight bounding boxes**: Tighter bounding boxes improve the recognition and ensure that accurate bounding boxes are predicted at runtime.
**Label the full object even when occluded**: If you have a person standing behind a car, label the full person even though a portion of their body may be hidden behind the car. This helps predict accurate bounding boxes and improves zone accuracy and filters at runtime.
**`amazon`, `ups`, and `fedex` should label the logo**: For a Fedex truck, label the truck as a `car` and make a different bounding box just for the Fedex logo. If there are multiple logos, label each of them.
![Fedex Logo](/img/plus/fedex-logo.jpg)
## Improving your model
You may find that Frigate+ models result in more false positives initially, but by submitting true and false positives, the model will improve. This may be because your cameras don't look quite enough like the user submissions that were used to train the base model. Over time, this will improve as more and more users (including you) submit examples to Frigate+.
False positives can be reduced by submitting **both** true positives and false positives. This will help the model differentiate between what is and isn't correct.
You may find that it's helpful to lower your thresholds a little in order to generate more false/true positives near the threshold value. For example, if you have some false positives that are scoring at 68% and some true positives scoring at 72%, you can try lowering your threshold to 65% and submitting both true and false positives within that range. This will help the model learn and widen the gap between true and false positive scores.
Note that only verified images will be used when training your model. Submitting an image from Frigate as a true or false positive will not verify the image. You still must verify the image in Frigate+ in order for it to be used in training.
In order to request your first model, you will need to have annotated and verified at least 10 images. Each subsequent model request will require that 10 additional images are verified. However, this is the bare minimum. For the best results, you should provide at least 100 verified images per camera. Keep in mind that varying conditions should be included. You will want images from cloudy days, sunny days, dawn, dusk, and night.
As circumstances change, you may need to submit new examples to address new types of false positives. For example, the change from summer days to snowy winter days or other changes such as a new grill or patio furniture may require additional examples and training.

View File

@@ -0,0 +1,48 @@
---
id: edgetpu
title: Troubleshooting EdgeTPU
---
## USB Coral Not Detected
There are many possible causes for a USB coral not being detected and some are OS specific. It is important to understand how the USB coral works:
1. When the device is first plugged in and has not initialized it will appear as `1a6e:089a Global Unichip Corp.` when running `lsusb` or checking the hardware page in HA OS.
2. Once initialized, the device will appear as `18d1:9302 Google Inc.` when running `lsusb` or checking the hardware page in HA OS.
If the coral does not initialize then Frigate can not interface with it. Some common reasons for the USB based Coral not initializing are:
### Not Enough Power
The USB coral can draw up to 900mA and this can be too much for some on-device USB ports, especially for small board computers like the RPi. If the coral is not initializing then some recommended steps are:
1. Try a different port, some ports are capable of providing more power than others.
2. Make sure the port is USB3, this is important for power and to ensure the coral runs at max speed.
3. Try a different cable, some users have found the included cable to not work well.
4. Use an externally powered USB hub.
### Incorrect Device Access
The USB coral has different IDs when it is uninitialized and initialized.
- When running Frigate in a VM, Proxmox lxc, etc. you must ensure both device IDs are mapped.
- When running HA OS you may need to run the Full Access version of the Frigate addon with the `Protected Mode` switch disabled so that the coral can be accessed.
## USB Coral Detection Appears to be Stuck
The USB Coral can become stuck and need to be restarted, this can happen for a number of reasons depending on hardware and software setup. Some common reasons are:
1. Some users have found the cable included with the coral to cause this problem and that switching to a different cable fixed it entirely.
2. Running Frigate in a VM may cause communication with the device to be lost and need to be reset.
## PCIe Coral Not Detected
The most common reason for the PCIe coral not being detected is that the driver has not been installed. See [the coral docs(https://coral.ai/docs/m2/get-started/#2-install-the-pcie-driver-and-edge-tpu-runtime) for how to install the driver for the PCIe based coral.
## Only One PCIe Coral Is Detected With Coral Dual EdgeTPU
Coral Dual EdgeTPU is one card with two identical TPU cores. Each core has it's own PCIe interface and motherboard needs to have two PCIe busses on the m.2 slot to make them both work.
E-key slot implemented to full m.2 electromechanical specification has two PCIe busses. Most motherboard manufacturers implement only one PCIe bus in m.2 E-key connector (this is why only one TPU is working). Some SBCs can have only USB bus on m.2 connector, ie none of TPUs will work.
In this case it is recommended to use a Dual EdgeTPU Adapter [like the one from MagicBlueSmoke](https://github.com/magic-blue-smoke/Dual-Edge-TPU-Adapter)

View File

@@ -56,4 +56,4 @@ SQLite does not work well on a network share, if the `/media` folder is mapped t
If MQTT isn't working in docker try using the IP of the device hosting the MQTT server instead of `localhost`, `127.0.0.1`, or `mosquitto.ix-mosquitto.svc.cluster.local`.
This is because, by default, Frigate does not run in host mode so localhost points to the Frigate container and not the host device's network.
This is because, by default, Frigate does not run in host mode so localhost points to the Frigate container and not the host device's network.

View File

@@ -3,9 +3,9 @@ id: recordings
title: Troubleshooting Recordings
---
## `WARNING : Unable to keep up with recording segments in cache for {camera}. Keeping the 5 most recent segments out of 6 and discarding the rest...`
### WARNING : Unable to keep up with recording segments in cache for camera. Keeping the 5 most recent segments out of 6 and discarding the rest...
This error can be caused by a number of different issues. The first step in troubleshooting is to enable debug logging for recording, this will enable logging showing how long it takes for recordings to be moved from RAM cache to the disk.
This error can be caused by a number of different issues. The first step in troubleshooting is to enable debug logging for recording. This will enable logging showing how long it takes for recordings to be moved from RAM cache to the disk.
```yaml
logger:
@@ -21,18 +21,53 @@ DEBUG : Copied /media/frigate/recordings/{segment_path} in 0.2 seconds.
It is important to let this run until the errors begin to happen, to confirm that there is not a slow down in the disk at the time of the error.
### Copy Times > 1 second
#### Copy Times > 1 second
If the storage is too slow to keep up with the recordings then the maintainer will fall behind and purge the oldest recordings to ensure the cache does not fill up causing a crash. In this case it is important to diagnose why the copy times are slow.
#### Check Storage Type
##### Check RAM, swap, cache utilization, and disk utilization
If CPU, RAM, disk throughput, or bus I/O is insufficient, nothing inside frigate will help. It is important to review each aspect of available system resources.
On linux, some helpful tools/commands in diagnosing would be:
- docker stats
- htop
- iotop -o
- iostat -sxy --human 1 1
- vmstat 1
On modern linux kernels, the system will utilize some swap if enabled. Setting vm.swappiness=1 no longer means that the kernel will only swap in order to avoid OOM. To prevent any swapping inside a container, set allocations memory and memory+swap to be the same and disable swapping by setting the following docker/podman run parameters:
**Compose example**
```yaml
version: "3.9"
services:
frigate:
...
mem_swappiness: 0
memswap_limit: <MAXSWAP>
deploy:
resources:
limits:
memory: <MAXRAM>
```
**Run command example**
```
--memory=<MAXRAM> --memory-swap=<MAXSWAP> --memory-swappiness=0
```
NOTE: These are hard-limits for the container, be sure there is enough headroom above what is shown by `docker stats` for your container. It will immediately halt if it hits `<MAXRAM>`. In general, running all cache and tmp filespace in RAM is preferable to disk I/O where possible.
##### Check Storage Type
Mounting a network share is a popular option for storing Recordings, but this can lead to reduced copy times and cause problems. Some users have found that using `NFS` instead of `SMB` considerably decreased the copy times and fixed the issue. It is also important to ensure that the network connection between the device running Frigate and the network share is stable and fast.
#### Check mount options
##### Check mount options
Some users found that mounting a drive via `fstab` with the `sync` option caused dramatically reduce performance and led to this issue. Using `async` instead greatly reduced copy times.
### Copy Times < 1 second
#### Copy Times < 1 second
If the storage is working quickly then this error may be caused by CPU load on the machine being too high for Frigate to have the resources to keep up. Try temporarily shutting down other services to see if the issue improves.

Some files were not shown because too many files have changed in this diff Show More