Commit Graph

1816 Commits

Author SHA1 Message Date
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
Bernt Christian Egeland
f1dc3a639c
fixed TimeAgo abbreviation (#6977)
* fixed TimeAgo abbreviation

* Update web/src/components/TimeAgo.tsx

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

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2023-07-01 08:16:19 -05:00
Blake Blackshear
2f401bd8da
update deps (#6973)
* update web deps

* update python deps
2023-07-01 07:47:16 -05:00
Nicolas Mowen
f3f9b36e07
Fix bad check on np.array (#6968) 2023-06-30 07:06:38 -06:00
Nicolas Mowen
0a8249d6fb
Fix Bad Resize For Camera Snapshot (#6797)
* Catch cases where incorrect size is requested

* Set a default if calculated height is incorrect
2023-06-30 07:34:10 -05:00
Sergey Krashevich
b6fce8f0bb
Integrate ccache into libusb and nginx build scripts for improved build speed (#6886)
* Add ccache to libusb and nginx build scripts

* Add ccache support to Dockerfile for faster builds

* Add ccache to PATH and use it for compiling nginx with Makefile in build_nginx.sh script
2023-06-30 07:28:48 -05:00
Blake Blackshear
d51197eaa2
use a different method for blur and contrast to reduce CPU (#6940)
* use a different method for blur and contrast to reduce CPU

* blur with radius instead

* use faster interpolation for motion

* improve contrast based on averages

* increase default threshold to 30

* ensure mask is applied after contrast improvement

* update opencv

* update benchmark script
2023-06-30 07:27:31 -05:00
Nicolas Mowen
d2a2643cd6
Apply zone filter before inertia (#6854)
* Apply zone filter before intertia

* Formatting
2023-06-30 07:15:55 -05:00
Nicolas Mowen
bd17e7d824
Show object attributes when hovering or tapping timeline bounding box (#6879)
* Show overlay when hovering on timeline box

* Make it work with mobile too

* Fix lint

* Fix ratio

* Update web/src/components/TimelineEventOverlay.jsx

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

* Show overlay when hovering on timeline box

* Make it work with mobile too

* Fix lint

* Fix ratio

* Remove label and make overlay respect selected theme

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2023-06-30 07:15:19 -05:00
spacebares
ed0d2be321
configurable ffmpeg timeout (#6897)
* configurable ffmpeg timeout

* configurable ffmpeg healthcheck interval

rename timeout to healthcheck_interval
only grab config value once

* configurable ffmpeg retry interval

rename healthcheck_interval to retry_interval

* add retry_interval to docs

- update retry_interval text in config.py
2023-06-30 07:14:39 -05:00
Nicolas Mowen
9137f1594b
Remove legacy recordings file cleanup (#6947)
* Remove legacy recordings file cleanup

* Remove unused
2023-06-30 07:13:00 -05:00
Cody Cutrer
ef14a43930
optimize frame-per-second calculations (#6887)
* optimize frame-per-second calculations

FPS is never calculated over differing periods for even given
counter. By only storing timestamps within the period that is
used, we avoid having to iterate 1000 entries every time it's
re-calculated (multiple times per second). 1000 entries would
normally only be needed if something is running at 100fps. A
more common speed - anywhere from 5 to 30fps, only needs 50
to 300 entries.

This isn't a huge improvement in the grand scheme, but when motion
detection is disabled, it takes nearly as much time in a flamegraph
as actually transferring the video frame.

* fix python checks
2023-06-28 05:55:53 -05:00
Cody Cutrer
ee4a133655
actually keep track of skipped frames (#6889)
* actually keep track of skipped frames

fixes #6863

* fix black errors
2023-06-28 05:53:28 -05:00
Nicolas Mowen
ece070fee1
Load labels dynamically for event filters (#6896)
* Load labels dynamically to include custom events and audio, do not include attribute labels

* Formatting

* Fix sorting

* Also filter tracked object list on camera page

* isort

* Don't fail before load
2023-06-28 05:51:53 -05:00
spacebares
3d40ed5d47
fix tooltip not showing if too far left (#6909) 2023-06-28 05:45:54 -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
9e531b0b5b
reduce grid size for contrast improvement (#6870) 2023-06-21 08:38:51 -05:00
Blake Blackshear
7c1568fcb9
use clahe for contrast improvement (#6835)
* use clahe for contrast improvement

* update tests
2023-06-18 11:56:41 -05:00
Nicolas Mowen
09cc4251f0
Fix dict getting overwritten (#6830) 2023-06-17 10:31:35 -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
2be2050d57
Don't fail to save segment when cv2 fails (#6823)
* Don't fail when cv2 fails

* Clean up exception handling
2023-06-17 09:56:00 -05:00
Nicolas Mowen
0996883a98
Add docs for annotation offset (#6824) 2023-06-16 18:00:49 -06: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
Nicolas Mowen
0592cedcde
Rewrite birdseye auto layout (#6818)
* Prefer horizontal layout to vertical

* Rewrite birdseye to use aspect ratios instead of resolutions as layout configurator

* Improve layout with slightly larger than 16:9 cameras

* Remove manual 2 camera layout

* Lint

* Remove log
2023-06-16 07:35:36 -05:00
Blake Blackshear
ca7853c087
Fix max_frames, improve stationary objects in masked areas (#6815)
* fix issue with max_frames

* dont consider stationary until the threshold

* require a stationary interval

* try to fix formatter issues
2023-06-16 07:32:43 -05:00
Sergey Krashevich
3efa77f302
Round the timestamp value read from .vacuum file to prevent potential errors caused by float values (#6800) 2023-06-14 17:19:26 -05:00
Nicolas Mowen
ff1b5c87aa
Fix stream name not being used for MSE (#6796) 2023-06-14 06:49:32 -06:00
Sergey Krashevich
a8f282515f
Bugfix: Refactor date and time initialization in Export.jsx (#6794)
* Refactor date and time initialization in Export.jsx to use local timezone

* Update error message to include specific reason for failure in Export.jsx
2023-06-14 07:32:36 -05:00
Nicolas Mowen
7e5abe7a65
Optimize Birdseye layout for portrait cameras (#6779)
* Handle vertical cameras more optimally in 2 camera layout

* Optimize portrait layout for 3+ cams

* Remove logging
2023-06-12 17:39:12 -05:00
Nicolas Mowen
ec4d79eafc
Fix bug in intersection logic (#6780)
* Fix bug in intersection logic

* Fix isort

* Remove unrelated test

* Formatting

* Fix type in test
2023-06-12 17:38:22 -05:00
Nicolas Mowen
ff90db30e6
Various Bug Fixes (#6768)
* Fix birdseye infinite loop

* Fix division by zero
2023-06-12 06:06:02 -04:00
Sergey Krashevich
dfd574beeb
Refactor storage stats calculation to use powers of 2 for more accurate values (#6765)
* "Refactor storage stats calculation to use powers of 2 for more accurate values"

* replace 1000000 to 2^20

* Refactor storage unit size display to use binary prefixes

This commit updates the display of storage unit sizes in both the camera storage stats and the Storage component in the web UI to use binary prefixes (MiB and GiB) instead of decimal prefixes (MB and GB). This provides more accurate and consistent representation of storage sizes
2023-06-11 14:49:13 -05:00
Bernt Christian Egeland
b359ff1b8e
[Feature] Add timepicker to calendar (#5183)
* added timepicker as children to calendar

* new timepicker component

* Add timepicker

* new timePicker component

* timepicker as calendar child

* hover:border and rounded

* adjusted width

* complete rework

* more code comments

* memorization

* preselect hover, transition

* numberOfDaysSelected has minimum of 1

* prefill hours when component mounts

* persist hours when component mount

* accommodate for the new timePicker

* add reset state

* scroll into view

* reuse before, after

* fix LastDayInRange when a time is selected

* do not add hours if before is zero

* use hours instead of days

* useeffect to reset hour. check timerange before scroll

* scroll to last element, not first
2023-06-11 14:48:45 -05:00
Nicolas Mowen
0f1cf67b91
Fix birdseye optimistic approach (#6764) 2023-06-11 08:47:34 -05:00
Blake Blackshear
d81dd60fef
Improve motion detection and region selection (#6741)
* refactor existing motion detector

* implement and use cnt bgsub

* pass fps to motion detector

* create a simplified motion detector

* lightning detection

* update default motion config

* lint imports

* use estimated boxes for regions

* use improved motion detector

* update test

* use a different strategy for clustering motion and object boxes

* increase alpha during calibration

* simplify object consolidation

* add some reasonable constraints to the estimated box

* adjust cluster boundary to 10%

* refactor

* add disabled debug code

* fix variable scope
2023-06-11 08:45:11 -05:00
Nicolas Mowen
32569842d3
Option to enable / disable stats that require external processes (#6615)
* Add option for network bandwidth and only calculate if enabled

* Don't show network bandwidth in system stats page if not enabled

* Formatting

* Hide other rows as well

* Add docs

* Add config options for AMD and Intel GPU stats

* Fix stats access

* Update docs

* Use correct bool syntax

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

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2023-06-11 08:26:34 -05:00
Sergey Krashevich
5c27cb7e9b
Optimization of Sync Records: Implementing Pagination and Temporary Table (#6585)
* Update pull_request.yml

* Add temporary table for deletion and use pagination to process recordings in chunks for deletion of recordings with missing files

* move RecordingsToDelete class to models.py

* recording cleanup: bugfixes

* Update cleanup.py

* improve log message in cleanup.py

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

---------

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2023-06-11 08:01:50 -05:00
Sergey Krashevich
7459a1cdde
Enhancement: Add Date and Time Inputs to Export Component with Time Validation (#6750)
* Add date and time inputs to Export component and ensure end time is larger than start time

* Update web/src/routes/Export.jsx

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

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2023-06-11 08:01:16 -05:00
Nicolas Mowen
b160abac0d
Ability to configure min frames for zone presence (#6680)
* Objects need to be in zones multiple times to be considered present in the zone

* Add a field to configure inertia per zone

* Formatting

* Use correct default method

* Clarify zone presence behavior

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

---------

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2023-06-11 08:00:53 -05:00
Nicolas Mowen
fd6eb78f41
Birdseye Autolayout (#6734)
* Calculate possible layout

* Working in ideal conditions

* Fix issues with different heights

* Remove logs

* Optimally handle cameras that don't match the canvas aspect ratio

* Make sure to copy so list is not overwritten

* Remove unused import

* Remove try catch

* Optimize layout for low amount of cameras

* Try to scale frames up if not enough space is used
2023-06-11 07:54:18 -05:00
Sergey Krashevich
8d941e5e26
Add function to get physical interfaces for bandwidth calculation (#6618)
* Add function to get physical interfaces for bandwidth calculation in get_bandwidth_stats() function

* Add telemetry configuration option for enabled network interfaces, with default values for monitoring bandwidth stats for camera ffmpeg processes, go2rtc, and object detectors. Also add support for FrigateConfig in set_bandwidth_stats function to get bandwidth stats for specified network interfaces
2023-06-11 07:34:03 -05:00
Nicolas Mowen
8bc76d19db
DB Optimizations (#6712)
* Enable auto vacuums

* Enable auto vacuum

* Fix separator

* Fix separator and remove incorrect log

* Limit to 1 row since that is all that is used

* Add index on camera + segment_size

* Formatting

* Increase timeout and cache_size

* Set DB mode to NORMAL synchronous level

* Formatting

* Vacuum every 2 weeks

* Remove fstring

* Use string

* Use consts
2023-06-11 07:23:18 -05:00
dependabot[bot]
20b52a96bc
Bump docker/login-action from 2.1.0 to 2.2.0 (#6740)
Bumps [docker/login-action](https://github.com/docker/login-action) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](f4ef78c080...465a07811f)

---
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>
2023-06-11 07:21:59 -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
Nicolas Mowen
d3949eebfa
Add API and WebUI to export recordings (#6550)
* Add ability to export frigate clips

* Add http endpoint

* Add dir to nginx

* Add webUI

* Formatting

* Cleanup unused

* Optimize timelapse

* Fix pts

* Use JSON body for params

* Use hwaccel to encode when available

* Print ffmpeg command when fail

* Print ffmpeg command when fail

* Add separate ffmpeg preset for timelapse

* Add docs outlining the export directory

* Add export docs

* Use ''

* Fix playlist max time

* Lower max playlist time

* Add api docs for export

* isort fixes
2023-06-08 07:32:35 -04:00
Michael Wei
d1701e127e
fix: don't assume build platform is amd64 (#6709) 2023-06-05 16:13:54 -05:00
dependabot[bot]
f0c1b66b0f
Bump actions/setup-python from 4.6.0 to 4.6.1 (#6609)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4.6.0...v4.6.1)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  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>
2023-06-01 07:05:39 -05:00
Blake Blackshear
699248d769
Update deps (#6669)
* fix gh host key

* python deps

* update web deps

* update docs deps
2023-06-01 06:59:50 -05:00
Nicolas Mowen
62f36b221e
Remove ffmpeg banner (#6600)
* Hide banner in maintainer

* Hide banner in event download
2023-06-01 05:46:34 -05:00
Blake Blackshear
ae0aba44dc
Improve tracking (#6516) 2023-05-31 08:12:43 -06:00