Commit Graph

55 Commits

Author SHA1 Message Date
Nicolas Mowen
45e9030358
Round robin SHM management (#15027)
* Output frame name to frames processor

* Finish implementing round robin

* Formatting
2024-11-16 16:00:19 -07:00
Nicolas Mowen
ac8ddada0b
Various fixes (#14703)
* Fix not retaining custom events

* Fix media apis
2024-10-31 07:31:01 -05:00
Nicolas Mowen
3879fde06d
Don't allow unlimited unprocessed segments to stay in cache (#14341)
* Don't allow unlimited unprocessed frames to stay in cache

* Formatting
2024-10-14 16:11:43 -06:00
gtsiam
54900ae318
Properly call super() in subclasses (#14124) 2024-10-02 19:35:46 -06:00
Nicolas Mowen
75d531285a
Don't consider segments containing unprocessed frames in segment count (#14120) 2024-10-02 12:55:55 -05:00
gtsiam
edababa88e
Work through most of the cspell warnings in python (#13794) 2024-09-17 10:41:46 -05:00
Nicolas Mowen
5ff476c6f9
Configurable ffmpeg (#13722)
* Install multiple ffmpeg versions and add config to make it configurable

* Update docs

* Run ffprobe too

* Cleanup

* Apply config to go2rtc as well

* Fix ffmpeg bin

* Docs

* Restore path

* Cleanup env var

* Fix ffmpeg path for encoding

* Fix export

* Formatting
2024-09-13 15:14:51 -05:00
Nicolas Mowen
0acbd3d5e8
Refactor recordings retention to be based on review items (#13355)
* Refactor recordings config to be based off of review items

* Update object processing logic for when an event is created

* Migrate to deciding recording retention based on review items

* Refactor recording expiration to be based off of review items

* Remove remainder of recording events access

* Handle migration automatically

* Update version and cleanup

* Update docs

* Clarify docs

* Cleanup

* Target camera config

* Safely access all fields
2024-09-02 07:22:53 -06:00
Jason Hunter
36cbffcc5e Semantic Search for Detections (#11899)
* Initial re-implementation of semantic search

* put docker-compose back and make reindex match docs

* remove debug code and fix import

* fix docs

* manually build pysqlite3 as binaries are only available for x86-64

* update comment in build_pysqlite3.sh

* only embed objects

* better error handling when genai fails

* ask ollama to pull requested model at startup

* update ollama docs

* address some PR review comments

* fix lint

* use IPC to write description, update docs for reindex

* remove gemini-pro-vision from docs as it will be unavailable soon

* fix OpenAI doc available models

* fix api error in gemini and metadata for embeddings
2024-08-29 20:19:50 -06:00
Nicolas Mowen
d28ad0f0c8
Use JSON instead of pickle for serialization (#12590) 2024-07-24 08:58:23 -06:00
Blake Blackshear
30b86271ea
move clip.mp4 backend to clips folder (#11834)
* move clip.mp4 backend to clips folder

* improve caching

* fix check
2024-06-09 13:45:26 -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
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
Nicolas Mowen
657fab2787
Save motion as motion box count (#10484) 2024-03-15 13:13:40 -06: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
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
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
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
7d157dfeb0
Set max value for pre_capture (#8656) 2023-11-18 15:37:06 -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
Nicolas Mowen
cc5357a31a
Remove iterator from recordings events (#8522) 2023-11-07 07:02:02 -07: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
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
e89dafa82e
Handle recording checks in utc (#8379)
* Handle recording checks in utc

* Formatting
2023-10-30 20:25:21 -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
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
Sergey Krashevich
8f349a6365
use sum() instead of len() to count only enabled cameras (#8232) 2023-10-19 17:14:06 -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
4c7ea01137
Don't print ffprobe stdout logs (#8153) 2023-10-13 17:04:38 -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
761daf46ea
Refactor Recordings (#7275)
* Run ffmpeg sub process & video_properties as async

* Run recording cleanup in the main process

* More cleanup

* Use inter process communication to write recordings into the DB

* Formatting
2023-07-26 05:55:08 -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
dacf45cd88
Add tests for recordings retention and fix bug (#7183)
* Add tests for segment info

* Fix logic
2023-07-16 13: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
d0873631cc
Fix logic (#7165) 2023-07-14 20:46:01 -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
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
Sergey Krashevich
c38c981cd0
Performance: multiprocessing improvement: step 2 (#6986)
* Refactored queues to use faster_fifo instead of mp.Queue

* Refactored LimitedQueue to include a counter for the number of items in the queue and updated put and get methods to use the counter

* Refactor app.py and util.py to use a custom Queue implementation called LQueue instead of the existing Queue

* Refactor put and get methods in LimitedQueue to handle queue size and blocking behavior more efficiently

* code format

* remove code from other branch (merging fuckup)
2023-07-06 07:56:38 -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
Nicolas Mowen
b66810247e
Optimize stacked recordings (#6809)
* Make camera recordings mover asynchronous

* Formatting

* Move to using cv2 instead of external ffmpeg process

* Use ffprobe if cv2 failed

* Formatting

* Fix bad access

* Formatting

* Update frigate/record/maintainer.py

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

* Update name of caller

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2023-06-16 07:09:13 -06:00