Commit Graph

45 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
ca4e0dbc75
Fix ffmpeg input arg parsing (#8924) 2023-12-12 10:48:09 +00:00
Nicolas Mowen
7270eef6bf
Don't fail on 0 rms (#8447) 2023-11-04 02:18:23 +00:00
Nicolas Mowen
f1efd8dbe2
Use int for drawing box (#8388) 2023-10-30 19:53:29 -04: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
Blake Blackshear
9fc93c72a0
more consistent use of iterators in select queries (#8258) 2023-10-21 10:53:33 -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
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
49e7723405
Add debug logs for audio labels (#8080) 2023-10-07 09:23:11 -05:00
Nicolas Mowen
8bde914939
Fix a couple bugs (#8045) 2023-10-07 09:18:34 -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
a2206bb177
Reduce database queries to necessary fields (#7751)
* Reduce database queries to necessary labels

* Set columns for other queries

* skip creating model instances

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2023-09-11 17:07:04 -05:00
Nicolas Mowen
bbdf5e1bee
Don't count in progress events as duplicates (#7568)
* Don't count in progress events as duplicates

* Fix sql
2023-09-01 07:02:35 -05:00
Sergey Krashevich
731743c7e5
Refactor AudioTfl class to accept the number of detection threads as a parameter in the constructor, and update the usage of the num_threads attribute accordingly (#7588) 2023-09-01 07:00:11 -05:00
Nicolas Mowen
fbed3fbb8b
Fix audio filter config (#7401) 2023-08-06 12:19:28 -05:00
Nicolas Mowen
36ccaa4cff
Improve debug logs for audio & ptz (#7387)
* Update audio.py

* Add debug log for ptz info

* Formatting

* Fix check
2023-08-05 05:47:56 -05:00
Nicolas Mowen
b7ff6735f6
Add support for stationary and active timeline entires (#7344)
* Add support for stationary and active timeline entires

* Be sure to update stored event data copy with stationary
2023-07-31 21:43:48 -05:00
Nicolas Mowen
9016a48dc7
Refactor Audio Events To Use stdout Pipe (#7291)
* Cleanup audio detection

* Read audio frames from ffmpeg process directly

* Handle case where process has stopped
2023-07-26 05:51:45 -05:00
Nicolas Mowen
bfa7a5cc60
db improvements (#7227)
* Store camera labels in dict and other optimizations

* Add max on timeout so it is at least 60

* Ensure db timeout is at least 60

* Update list once a day to ensure new labels are cleaned up

* Formatting

* Insert recordings as bulk instead of individually.

* Fix

* Refactor event and timeline cleanup

* Remove unused
2023-07-21 07:29:50 -05:00
Nicolas Mowen
c5b8d13beb
Save audio scores and add audio filter config (#7185)
* Send and save score for external events

* Add audio filters config

* Fix access

* Add docs

* Cleanup
2023-07-17 06:07:15 -05:00
Nicolas Mowen
662025a961
Remove faster_fifo (#7181)
* Remove faster_fifo

* Remove const
2023-07-16 07:42:56 -05:00
Nicolas Mowen
dfd3fcdff6
Publish audio detections (#7159)
* Send mqtt message when audio is detected

* Fix value

* Add audio topics to mqtt docs and add mqtt headers

* Use existing standard for values

* Update mqtt.md
2023-07-14 19:06:00 -05:00
Nicolas Mowen
00016b7499
Save average dBFS and retain segment with dBFS in motion mode (#7158)
* Hold audio info queue for recordings

* Add dBFS to db

* Cleanup

* Formatting

* Fix check
2023-07-14 19:05:14 -05:00
jpverdejo
b909ff4ecb
Expose dBFS when doing audio analysis (#6979)
* Expose dBFS when doing audio analysis

* Implement metadata communicator

* revert test changes

* Reverting the tests changes. For real this time

* Address feedback

* Address feedback

* Address feedback

* Address feedback
2023-07-13 19:52:33 -05:00
Blake Blackshear
7c0d25f9da
Attribute scores (#7100)
* rework attributes to get scores

* show sublabel score

* formatting
2023-07-09 11:40:39 -05:00
Nicolas Mowen
f37f034b6a
Only run audio detection when audio is above noise threshold (#7078)
* Only run audio detection when audio is above noise threshold

* Formatting

* Fix event parsing

* Update frigate/events/audio.py

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

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2023-07-08 07:16:24 -05:00
Nicolas Mowen
baf671b764
Cleanup and organize utils (#7033)
* Force birdseye cameras into standard aspect ratios

* Organize utils

* Update tests

* Formatting

* Isort

* Fix tests

* Cleanup

* isort
2023-07-06 09:28:50 -05:00
Nicolas Mowen
0f68fbc8db
Use pre capture for custom events (#7038)
* Use pre capture for custom events

* Formatting
2023-07-06 07:26:53 -05:00
Sergey Krashevich
12d4a47e3d
End audio event and update detections if successful, otherwise log a warning if ending audio event fails with a specific status code (#6984) 2023-07-03 09:50:25 -05:00
Nicolas Mowen
58c6ef1e12
Add designator when events are from the api (#6997)
* Add designator when events are custom

* Add type field and set via API
2023-07-03 09:48:00 -05:00
Nicolas Mowen
c25367221e
Fix audio events not being ended (#6981)
* Fix audio events not being ended

* Fix audio events not being ended correctly

* Clean up debug code
2023-07-01 16:33:47 -05:00
Nicolas Mowen
7ee17c7af8
Fix small audio events details (#6978)
* Fix missed audio details

* Add mqtt docs

* Delete instead of setting to None
2023-07-01 11:19:14 -05:00
Nicolas Mowen
c3b313a70d
Audio events (#6848)
* Initial audio classification model implementation

* fix mypy

* Keep audio labelmap local

* Cleanup

* Start adding config for audio

* Add the detector

* Add audio detection process keypoints

* Build out base config

* Load labelmap correctly

* Fix config bugs

* Start audio process

* Fix startup issues

* Try to cleanup restarting

* Add ffmpeg input args

* Get audio detection working

* Save event to db

* End events if not heard for 30 seconds

* Use not heard config

* Stop ffmpeg when shutting down

* Fixes

* End events correctly

* Use api instead of event queue to save audio events

* Get events working

* Close threads when stop event is sent

* remove unused

* Only start audio process if at least one camera is enabled

* Add const for float

* Cleanup labelmap

* Add audio icon in frontend

* Add ability to toggle audio with mqtt

* Set initial audio value

* Fix audio enabling

* Close logpipe

* Isort

* Formatting

* Fix web tests

* Fix web tests

* Handle cases where args are a string

* Remove log

* Cleanup process close

* Use correct field

* Simplify if statement

* Use var for localhost

* Add audio detectors docs

* Add restream docs to mention audio detection

* Add full config docs

* Fix links to other docs

---------

Co-authored-by: Jason Hunter <hunterjm@gmail.com>
2023-07-01 08:18:33 -05:00
Sergey Krashevich
e640981cc4
Performance: multiprocessing improvement (#6936)
* Add faster-fifo dependency for improved performance

* isort
2023-06-28 05:39:39 -05:00
Blake Blackshear
793fe251b9
Label attributes (#6829)
* pass attribute labels as attributes

* add label attrs to events and snapshots

* incorporate area of license_plate and face into snapshot selection

* populate sublabels for cars with logos
2023-06-17 09:56:22 -05:00
Nicolas Mowen
435d152423
Fix bug introduced in new linter (#6754)
* Fix bug introduced in new linter

* Ignore this error

* Fix more

* Ignore boolean error too
2023-06-11 07:18:47 -05:00
Martin Weinelt
ab50d0b006
Add isort and ruff linter (#6575)
* Add isort and ruff linter

Both linters are pretty common among modern python code bases.

The isort tool provides stable sorting and grouping, as well as pruning
of unused imports.

Ruff is a modern linter, that is very fast due to being written in rust.
It can detect many common issues in a python codebase.

Removes the pylint dev requirement, since ruff replaces it.

* treewide: fix issues detected by ruff

* treewide: fix bare except clauses

* .devcontainer: Set up isort

* treewide: optimize imports

* treewide: apply black

* treewide: make regex patterns raw strings

This is necessary for escape sequences to be properly recognized.
2023-05-29 05:31:17 -05:00
Nicolas Mowen
e357715a8c
Ability to manually create events through the API (#3184)
* Move to events package

* Improve handling of external events

* Handle external events in the event queue

* Pass in event processor

* Check event json

* Fix json parsing and change defaults

* Fix snapshot saving

* Hide % score when not available

* Correct docs and add json example

* Save event png db

* Adjust image

* Formatting

* Add catch for failure ending event

* Add init to modules

* Fix naming

* Formatting

* Fix http creation

* fix test

* Change to PUT and include response in docs

* Add ability to set bounding box locations in snapshot

* Support multiple box annotations

* Cleanup docs example response

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

* Cleanup docs wording

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

* Store full frame for thumbnail

* Formatting

* Set thumbnail height to 175

* Formatting

---------

Co-authored-by: Blake Blackshear <blake@frigate.video>
2023-05-19 05:16:11 -05:00