Commit Graph

1105 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Josh Hawkins
16dc9f4bf7 update debug message 2023-10-26 17:32:58 -06:00
Josh Hawkins
52b47a3414 empty assumption for events 2023-10-26 17:32:58 -06:00
Josh Hawkins
139664e598 assumption on empty 2023-10-26 17:32:58 -06:00
Josh Hawkins
441c605312 make sure entire segment is accounted for 2023-10-26 17:32:58 -06:00
Josh Hawkins
def889e3a8 start_time is a datetime obj 2023-10-26 17:32:58 -06:00
Josh Hawkins
613f1f6bd6 check frame time for segment 2023-10-26 17:32:58 -06:00
Josh Hawkins
e173377859 change warning to debug 2023-10-26 17:32:58 -06:00
Nicolas Mowen
86c59c1722
Fix birdseye layout (#8343) 2023-10-26 18:23:39 -04:00
Josh Hawkins
a399cb09fa
Autotracking tweaks and docs update (#8345)
* refactor thresholds and reduce a duplicate call

* add camera to docs

* udpate docs
2023-10-26 18:21:58 -04:00
Nicolas Mowen
5a46c36380
Add other known birdseye aspect ratios (#8322)
* Add other known birdseye aspect ratios

* Formatting
2023-10-26 06:21:26 -05:00
Shaun Berryman
36c1e00a6b
MQTT: Birdseye enabled/disabled and mode change support (#8291)
* support enabled and mode change for birdseye via mqtt

* resolve feedback from PR review
https://github.com/blakeblackshear/frigate/pull/8291#discussion_r1370083613

* change birdseye mode topic to set

* type in the docs

* these commented out lines should have never been in here
2023-10-26 06:20:55 -05:00
Nicolas Mowen
cf2b56613f
Don't overwrite event while cleaning up expired cameras (#8320) 2023-10-26 06:20:06 -05:00
Nicolas Mowen
1a9e00ee49
Add count of audio labels to active count (#8310)
* Add count of audio labels to active count

* Formatting
2023-10-24 19:26:46 -04:00
Josh Hawkins
b9649de327
Don't generate region boxes from motion when autotracking (#8306)
* no region boxes from motion boxes when ptz moving

* debug contours and calibration

* remove debugging

* clarifying comment
2023-10-24 19:25:22 -04:00
Nicolas Mowen
823550eed3
Reduce zones for timeline (#8300) 2023-10-24 19:24:59 -04:00
Nicolas Mowen
c141362614
Use norfair uninitialized score history for tracked object and update false positive docs (#8299)
* Update docs

* Use norfair score history to start object history

* Formatting
2023-10-24 19:24:30 -04:00
Russell Troxel
e0e8a6fcc9
Add --validate-config option for CI config validation (#8222)
* add `--validate-config` option for CI config validation

Signed-off-by: Russell Troxel <russell.troxel@segment.com>

* Fix Lint

Signed-off-by: Russell Troxel <russell.troxel@segment.com>

* Add docs & test live

Signed-off-by: Russell Troxel <russell.troxel@segment.com>

* Update docs/docs/configuration/advanced.md

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

* Fix Lint

Signed-off-by: Russell Troxel <russell@troxel.io>

---------

Signed-off-by: Russell Troxel <russell.troxel@segment.com>
Signed-off-by: Russell Troxel <russell@troxel.io>
Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2023-10-23 20:33:52 -06:00
Nicolas Mowen
0b858419d1
re-enable init delay (#8283) 2023-10-23 20:50:22 -04:00
Nicolas Mowen
2fb7200fb7
Revamp object consolidation logic (#8289)
* Separate object reduction to own function and reduce confidence of boxes on edge of region

* Add tests for different scenarios

* Formatting
2023-10-23 20:20:21 -04:00
Nicolas Mowen
e9376ca285
Fix bug on bad storage stats read (#8275) 2023-10-22 13:35:19 -05:00
Josh Hawkins
9df5927ac5
Autotracking bugfixes and zooming updates (#8103)
* zoom in/out in search for lost objects

* predicted box should not be empty

* clean up and update zoom logic

* only zoom if enabled

* more cleanup

* check for valid velocity when zooming

* only try absolute zoom in if obj area has changed

* zoom logic

* don't enqueue lost object zoom if already at limit

* don't disable motion boxes during ptz moves

* velocity threshold based on move coefficients

* fix area zoom logic

* disable debug zoom

* don't process objects if ptz moving

* recalc with exponent

* change exponent

* remove lost object zooming

* increase distance threshold for stationary object

* increase distance threshold constant

* only zoom out if nonzero

* camera name in all debug logging

* add camera name to debug logging

* camera variable name consistency

* update calibration behavior and docs

* docs and better zooming

* more sensible target values

* docs wording

* fix velocity threshold variable

* zooming tweaks and remove iou for current objects

* debug and docs

* get valid velocity

* include zero

* additional debug statements

* add zoom hysteresis

* zoom on initial move if relative

* only update target box if we actually zoom

* merge dev

* use getattr instead of get

* increase distance threshold

* reverse logic

* get_camera_status after preset move to store zoom

* final tweaks and docs

* use constants and catch possible debug exception

* adjust zoom factor exponent

* don't run motion estimation when calling preset

* adjust dimension threshold

* use numpy for velocity estimate calcs

* more numpy conversion

* fix numpy shapes

* numpy zeros dimension

* more zoom out conditions

* fix velocity bug

* ensure init has been called in debug view

* ensure onvif init if enabling by mqtt

* change default hysteresis values

* recalc relative zoom value

* zoom out value

* try to zoom when object isn't moving

* try zoom when tracked object is not moving

* don't try to zoom every time

* negate zoom out condition when needed

* hysteresis constants for absolute zooming

* update zoom conditions

* don't recalc target box on zoom only

* zoom out if above area threshold

* don't print zooming debug for stationary obj

* revamp zooming to use area moving average

* zooming tweaks and expose property

* limit zoom with max target box

* use calibration to determine zoom levels

* zoom logic fix

* docs

* add tapo c200 camera

* fix initial absolute zoom

* small zoom logic fix

* better invalid velocity checks

* fix test

* really fix test this time
2023-10-22 12:59:13 -04:00
Daniël van den Berg
d102ebf855
[CHANGE] More resilient and slightly faster PTZ (#8009)
* [CHANGE] More resilient and slightly faster PTZ

* Make "Check Black" happy.

* Make "check black" happier

* Remove unused named exception

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2023-10-22 09:08:05 -05:00
Nicolas Mowen
cb3990a0ac
Catch ws reset error (#8266)
* Catch ws reset error

* Formatting
2023-10-22 06:23:31 -04:00
Blake Blackshear
9fc93c72a0
more consistent use of iterators in select queries (#8258) 2023-10-21 10:53:33 -05:00
Blake Blackshear
c8b38bdd47
address codeql scan results (#8260) 2023-10-21 08:08:03 -05:00
Nicolas Mowen
e80b6d9e5b
Use different consolidation requirement depending on label (#8249) 2023-10-20 19:29:52 -04:00
Josh Hawkins
ee1e1b748c
fix logic error in preset fetch (#8245) 2023-10-20 19:27:47 -04:00
Nicolas Mowen
0c2f3a9702
Adjust motion calibration to be more dynamic (#8250)
* Adjust motion calibration to be more dynamic

* isort
2023-10-20 19:22:38 -04:00
Nicolas Mowen
a3c0e30502
Use existing bounding box for region when object is stationary (#8248) 2023-10-20 19:21:34 -04:00
tpjanssen
facd557f8c
Change camera stats to be more structured (#8151)
* Change camera stats to be more structured

* Update stats.py

* Update stats.py

* Update System.jsx

Front end also breaks due to moved camera stats
2023-10-19 17:15:47 -05:00
Nicolas Mowen
12487b3b60
Sync stationary object checks (#8238)
* Sync stationary object checks for all objects on a camera

* Formatting
2023-10-19 17:14:33 -05:00
Sergey Krashevich
8f349a6365
use sum() instead of len() to count only enabled cameras (#8232) 2023-10-19 17:14:06 -05:00
Nicolas Mowen
91f7d67c5e
Smarter Regions (#8194)
* Smarter Regions

* Formatting

* Cleanup

* Fix motion region checking logic

* Add database table and migration for regions

* Update region grid on startup

* Revert init delay change

* Fix mypy

* Move object related functions to util

* Remove unused

* Fix tests

* Remove log

* Update the region daily at 2

* Fix logic

* Formatting

* Initialize grid before starting processing frames

* Move back to creating grid in main process

* Formatting

* Fixes

* Formating

* Fix region check

* Accept all but true

* Use regions grid for startup scan

* Add clarifying comment

* Fix new grid requests

* Add tests

* Delete stale region grids from DB
2023-10-18 18:21:52 -05:00
Nicolas Mowen
98200b7dda
Fix recording segment management (#8220)
* Fix timing error

* Downgrade logs
2023-10-18 18:18:22 -05:00
winstona
cd35481e92
Fix recording events intermittently missing (#8162)
* fix queues not emptying fully by changing gets to a blocking call with short timeout

* add extra error/warning messages when there's a possibility of missing recording segments
2023-10-18 06:52:48 -05:00
Nicolas Mowen
1bdfc380c3
Delete timeline items along with event (#8192) 2023-10-17 06:37:07 -05:00
Blake Blackshear
4469507e5b
dont set has_clip to false unless the event is older (#8179) 2023-10-15 13:31:56 -05:00
Blake Blackshear
9ea10f8541
Don't zero out motion during calibration (#8163)
* don't zero out motion boxes

* define detect resolution to speed up tests
2023-10-14 08:05:44 -04:00
Nicolas Mowen
4c7ea01137
Don't print ffprobe stdout logs (#8153) 2023-10-13 17:04:38 -05:00
Nicolas Mowen
34b315cc8c
Fix bug forcing rtsp for audio detection ffmpeg process (#8156)
* Fix forcing rtsp for audio process

* Send as list
2023-10-13 17:03:04 -05:00
Nicolas Mowen
9b687d77ce
Add support for nvidia decoder and encoder utilization stats (#8150)
* Add encoder and decoder stats to nvidia hwaccel stats

* Fix

* Fix
2023-10-13 09:44:18 -05:00
tpjanssen
e32bd4ab15
Added audio sensors to camera metrics and API stats (#8109)
* Added audio sensor to camera metrics and API stats

* Update types.py

* Update app.py
2023-10-13 06:17:41 -05:00
Nicolas Mowen
e19c0668e7
Require init delay (#8126) 2023-10-13 06:16:36 -05:00
tpjanssen
a82334ca1c
API enhancements (#8107) 2023-10-09 08:52:26 -05:00
Josh Hawkins
dbd21eb6fa
use getattr instead of get (#8094) 2023-10-08 14:30:23 -05:00
Nicolas Mowen
7f5fba08b7
Fix export name (#8090) 2023-10-07 08:40:20 -06:00
Nicolas Mowen
49e7723405
Add debug logs for audio labels (#8080) 2023-10-07 09:23:11 -05:00
Nicolas Mowen
52cc707eb8
Consider new attribute a significant change (#8054)
* Consider new attribute a significant change

* Update object_processing.py
2023-10-07 09:22:45 -05:00
tpjanssen
c47b02d2fe
Added filter option for min/max score for event to API function /events (#8079)
* Update api.md

* Update api.md

* Added filter option for min/max score for event to API function /events

* Added filter for submitted events

* Update http.py
2023-10-07 09:22:14 -05:00
Josh Hawkins
67a5a7d21a
onvif: use preset token if name is unsupported (#8046)
* onvif: use preset token if name is unsupported

* move parenthesis
2023-10-07 09:20:42 -05:00
Nicolas Mowen
8bde914939
Fix a couple bugs (#8045) 2023-10-07 09:18:34 -05:00
Josh Hawkins
fe9fcf3eaa
remove erroneous check for move threads (#8031) 2023-10-07 09:18:07 -05:00
Josh Hawkins
20c2ab39bc
disable zooming if relative zoom not supported (#8028) 2023-10-07 09:17:54 -05:00
Nicolas Mowen
08ef69bac4
Add recordings timeline entry for frigate+ attributes (#8063)
* Add attribute item to timeline

* Add face icon

* Add support for other icons

* Cleanup

* Ensure attributes are only updated once

* don't show _ in attributes
2023-10-07 09:17:18 -05:00
Nicolas Mowen
79fabbb6b0
Fix recording snapshot time range (#8073)
* Fix recording snapshot time range

* Formatting

* Formatting
2023-10-07 09:16:12 -05:00
Nicolas Mowen
8941aa5311
Ensure deleted export file name is safe (#8089)
* Ensure deleted export file name is safe

* Fix import
2023-10-07 09:12:48 -05:00
Blake Blackshear
14d2b79c72
Security fixes (#8081)
* use safeloader

* use json responses wherever possible

* remove CORS and add CSRF token

* formatting fixes

* add envjs back

* fix baseurl test
2023-10-06 22:20:30 -05:00
Nicolas Mowen
9a4f970337
Set default min score for attributes labels to 0.7 (#8001)
* Set min score for attributes to 0.7

* Allow other fields to be set
2023-09-30 07:38:15 -05:00
Nicolas Mowen
232588636f
Force birdseye to standard aspect ratio (#7994)
* Force birdseye to standard aspect ratio

* Make rounding consistent

* Formatting
2023-09-29 17:53:45 -05:00
Josh Hawkins
ead03c381b
Autotracking improvements and bugfixes (#7984)
* add zoom factor and catch motion exception

* reword error message

* check euclidean distance of estimate points

* use numpy for euclidean distance

* config entry

* use zoom factor and zoom based on velocity

* move debug inside try

* change log type to info

* logger level warning

* docs

* exception handling
2023-09-28 18:21:37 -05:00
Josh Hawkins
50f13b7196
thread lock for move queues (#7973) 2023-09-28 18:01:05 -05:00
Josh Hawkins
27144eb0b9
Autotracker: Basic zooming and moves with velocity estimation (#7713)
* don't zoom if camera doesn't support it

* basic zooming

* make zooming configurable

* zooming docs

* optional zooming in camera status

* Use absolute instead of relative zooming

* increase edge threshold

* zoom considering object area

* bugfixes

* catch onvif zooming errors

* relative zooming option for dahua/amcrest cams

* docs

* docs

* don't make small movements

* remove old logger statement

* fix small movements

* use enum in config for zooming

* fix formatting

* empty move queue first

* clear tracked object before waiting for stop

* use velocity estimation for movements

* docs updates

* add tests

* typos

* recalc every 50 moves

* adjust zoom based on estimate box if calibrated

* tweaks for fast objects and large movements

* use real time for calibration and add info logging

* docs updates

* remove area scale

* Add example video to docs

* zooming font header size the same as the others

* log an error if a ptz doesn't report a MoveStatus

* debug logging for onvif service capabilities

* ensure camera supports ONVIF MoveStatus
2023-09-27 06:19:10 -05:00
Nicolas Mowen
1aba8c1ef5
Refactor time filter (#7962)
* Add ability to filter events by start time

* Add tests

* Add time param to events

* Add time picker

* Update docs

* Catch overnight case

Update comment

* Cleanup

* Fix tests
2023-09-27 06:09:38 -05:00
Nicolas Mowen
1c27ee2d2b
Increase initial hit count for norfair tracker (#7925)
* Increase initial hit count of tracked object

* Formatting
2023-09-24 06:32:43 -05:00
Nicolas Mowen
08586f8f65
Fix case where camera is disabled but autotrack is enabled (#7914) 2023-09-24 05:05:29 -05:00
Nicolas Mowen
7d0216b8fb
Improve default timelapse args and make timelapse customizable (#7840)
* Add args to ignore audio and only process keyframes

* Add timelapse args to config

* Update docs

* Formatting

* Fix spacing

* Fix formatting

* add example of math for pts
2023-09-21 06:20:05 -06:00