Commit Graph

933 Commits

Author SHA1 Message Date
Nicolas Mowen
afe3b5dd3d
Fix linter error (#7428) 2023-08-10 05:49: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
98576418a8
Improve Storage Logs (#7338)
* Make storage maintenance messages more clear

* Log when storage maintenance is happening

* Formatting
2023-08-01 06:26:45 -05:00
Andrew Reiter
e941012d48
Disambiguate 12h export filename timestamp (#7340)
* Add AM/PM to exported video filename

* Switch to 24h time
2023-08-01 06:25:43 -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
Martin Weinelt
d0b38f0a47
Reuse CACHE_DIR constant (#7306) 2023-07-29 13:19:21 -05:00
Nicolas Mowen
b79b1d9443
Fix frame not in cache error (#7313) 2023-07-29 07:11:45 -05:00
Nicolas Mowen
947ccbc654
Accept floats for export when used directly with event start / end time (#7314)
* Accept floats for export when used directly with event start / end time

* Formatting

* Formatting
2023-07-29 07:05:17 -05:00
Nicolas Mowen
f8c0f74ab8
Batch delete recordings for removed cameras as well (#7302) 2023-07-28 05:49:52 -05:00
Nicolas Mowen
961ce03835
Fix ffmpeg preset typo (#7293)
* Fix ffmpeg preset typo

* Fix qsv typo

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

---------

Co-authored-by: Sergey Krashevich <svk@svk.su>
2023-07-26 18:48:05 -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
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
Andrew Reiter
a96a951e23
Nvidia Jetson ffmpeg + TensorRT support (#6458)
* Non-Jetson changes

Required for later commits:
- Allow base image to be overridden (and don't assume its WORKDIR)
- Ensure python3.9
- Map hwaccel decode presets as strings instead of lists
Not required:
- Fix existing documentation
- Simplify hwaccel scale logic

* Prepare for multi-arch tensorrt build

* Add tensorrt images for Jetson boards

* Add Jetson ffmpeg hwaccel

* Update docs

* Add CODEOWNERS

* CI

* Change default model from yolov7-tiny-416 to yolov7-320

In my experience the tiny models perform markedly worse without being
much faster

* fixup! Update docs
2023-07-26 05:50:41 -05:00
Nicolas Mowen
d30a738960
Show status when mask is saved (#7212) 2023-07-21 07:30:22 -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
b655eca152
Set supported ptz features in init to not fail when camera has an error (#7228) 2023-07-21 07:27:07 -05:00
Nicolas Mowen
f2ff55dba2
Set timeout based on number of cameras (#7219) 2023-07-19 07:42:32 -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
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
8e584cf844
Add option for enabling sync recordings (#7169) 2023-07-15 08:38:21 -05:00
Nicolas Mowen
d0873631cc
Fix logic (#7165) 2023-07-14 20:46:01 -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
Nate Meyer
5bb5e2dc5a
Add check for valid label index for object detection (#7149) (#7164) 2023-07-14 19:01:53 -05:00
Josh Hawkins
dc2e786a6f
remove sleeps and improve queue logic (#7163) 2023-07-14 19:01:10 -05:00
Nicolas Mowen
598ae98bfe
Fix incorrect import in Config (#7157) 2023-07-14 06:32:17 -06:00
Sergey Krashevich
ce3a544ecd
Feature: automatic camera resolution configuration (#6810)
* Add auto configuration for height, width and fps in detect role

* Add auto-configuration for detect width, height, and fps for input roles with detect in the CameraConfig class in config.py

* Refactor code to retrieve video properties from input stream in CameraConfig class and add optional parameter to retrieve video duration in get_video_properties function

* format

* Set default detect dimensions to 1280x720 and update DetectConfig to use the defaults

* Revert "Set default detect dimensions to 1280x720 and update DetectConfig to use the defaults"

This reverts commit a1aed0414d.

* Add default detect dimensions if autoconfiguration failed and log a warning message

* fix warn message spelling on frigate/config.py

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

* Ensure detect height and width are not None before using them in camera configuration

* docs: initial commit

* rename streamInfo to stream_info

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

* Apply suggestions from code review

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

* Update docs

* handle case then get_video_properties returns 0x0 dimension

* Set detect resolution based on stream properties if available, else apply default values

* Update FrigateConfig to set default values for stream_info if resolution detection fails

* Update camera detection dimensions based on stream information if available

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2023-07-14 06:56:03 -05:00
Sergey Krashevich
6ac36e8436
Fix: Add limit to event query (#7108)
* Add limit to event query for fetching latest event with specified label and camera name

* Refactor the label_thumbnail function in frigate/http.py to simplify the event_query logic and improve code readability
2023-07-14 06:30:47 -05:00
Nicolas Mowen
3a0c36e8db
Refactor ff queue size (#7116)
* Refactor queue size

* Only use enabled cameras

* Formatting
2023-07-14 06:29:11 -05:00
Nicolas Mowen
6adc810145
Sub label api score (#7113)
* Support setting sub label scores via API

* Update docs

* Update docs

* Formatting

* Throw error when score is outside expected bounds

* Fix / cleanup
2023-07-14 06:28:16 -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
Josh Hawkins
c9254b256a
Autotracking: reset motion estimator (#7129)
* reset motion estimator after returning to preset

* small tweaks and a bugfix
2023-07-13 05:32:51 -05:00
Josh Hawkins
7a2d09dc35
Autotracking optimizations (#7109)
* much improved motion estimation and tracking

* docs updates

* move ptz specific mp values to ptz_metrics dict

* only check if moving at frame time

* pass full dict instead of individual values
2023-07-11 06:23:20 -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
Markus
5e772c3625
fix edgetpu device type "None" (auto) (#7097) 2023-07-08 16:04:51 -05:00
Josh Hawkins
691e9d26d2
Autotracking fixes (#7096)
* only check camera status if autotracking enabled

* a more sensible sleep time

* Only check camera status if preparing for a move

* only update tracked obj position when ptz stopped

* both pantilt *and* zoom should be idle

* check more often after moving

* No need to move pan and tilt separately
2023-07-08 16:02:54 -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
Josh Hawkins
88fc0fac8f
Basic PTZ object autotracking functionality (#6913)
* Basic functionality

* Threaded motion estimator

* Revert "Threaded motion estimator"

This reverts commit 3171801607.

* Don't detect motion when ptz is moving

* fix motion logic

* fix mypy error

* Add threaded queue for movement for slower ptzs

* Move queues per camera

* Move autotracker start to app.py

* iou value for tracked object

* mqtt callback

* tracked object should be initially motionless

* only draw thicker box if autotracking is enabled

* Init if enabled when initially disabled in config

* Fix init

* Thread names

* Always use motion estimator

* docs

* clarify fov support

* remove size ratio

* use mp event instead of value for ptz status

* update autotrack at half fps

* fix merge conflict

* fix event type for mypy

* clean up

* Clean up

* remove unused code

* merge conflict fix

* docs: update link to object_detectors page

* Update docs/docs/configuration/autotracking.md

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

* clarify wording

* pass actual instances directly

* default return preset

* fix type

* Error message when onvif init fails

* disable autotracking if onvif init fails

* disable autotracking if onvif init fails

* ptz module

* verify required_zones in config

* update util after dev merge

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2023-07-08 07:04:47 -05:00
Nicolas Mowen
d6f82f9edc
Fix queues (#7087)
* Fix queues

* Change name

* Use standard queue for limited queue

* remove unused

* isort
2023-07-08 06:46:31 -05:00
Nicolas Mowen
69630e7385
Fix incorrect respnses (#7066) 2023-07-07 07:06:42 -05:00
Nate Meyer
dd02958f7c
Upgrade TensorRT to 8.5.3 (#7006)
* Update to latest tensorrt (8.6.1) release

* Build trt libyolo_layer.so in container

* Update tensorrt_models script to convert models from the frigate container

* Fix typo in model script

* Fix paths to yolo lib and models folder

* Add S6 scripts to test and convert specified TensortRT models at startup.

Rearrange tensorrt files into a docker support folder.

* Update TensorRT documentation to reflect the new model conversion process and minimum HW support.

* Fix model_cache path to live in config directory

* Move tensorrt s6 files to the correct directory

* Fix issues in model generation script

* Disable global timeout for s6 services

* Add version folder to tensorrt model_cache path

* Include TensorRT version 8.5.3

* Add numpy requirement prior to removal of np.bool

* This TRT version uses a mixture of cuda dependencies

* Redirect stdout from noisy model conversion
2023-07-06 14:20:33 -05:00
Sergey Krashevich
30dfdf47d4
Add thread-safety to LimitedQueue by implementing a lock for put and get methods (#7053) 2023-07-06 13:54:55 -05:00
Sergey Krashevich
f48dd8c1ab
Feature: camera debug/config enhancements (#6920)
* Add functionality to update YAML config file with PUT request in HTTP endpoint

* Refactor copying of text to clipboard with Clipboard API and fallback to document.execCommand('copy') in CameraMap.jsx file

* Update YAML file from URL query parameters in frigate/http.py and add functionality to save motion masks, zones, and object masks in CameraMap.jsx

* formatting

* fix merging fuckup

* Refactor camera zone coordinate saving to use single query parameter per zone in CameraMap.jsx

* remove unnecessary print statements in util.py

* Refactor update_yaml_file function to separate the logic for updating YAML data into a new function update_yaml().

* fix merge errors

* Refactor code to improve error handling and add dependencies to useEffect hooks
2023-07-06 13:54:26 -05:00
Sergey Krashevich
cbb77e5794
Bugfix: SqliteQueueDatabase instead of SqliteDatabase and retry_interval for fetching latest frame in http.py (#7059)
* Refactor http.py to use SqliteQueueDatabase instead of SqliteDatabase and add retry interval for fetching latest frame

* isort && black
2023-07-06 13:50:22 -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
Cody Cutrer
2fae9dcb93
reduce contention on frame_queue (#6890)
* reduce contention on frame_queue

don't check if the queue is full, just attempt to add the frame
in a non-blocking manner, and then if it fails, skip it

* don't check if the frame queue is empty, just try and get from it

* Update frigate/video.py

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

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2023-07-06 08:18:39 -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
d0891e5183
Ptz cleanup (#6999)
* Use _ instead of - for ptz presets

* Update mqtt.md

* Fix

* Formatting
2023-07-06 07:42:17 -05:00