Commit Graph

143 Commits

Author SHA1 Message Date
Nicolas Mowen
87144cd572
FEAT: Support for ffmpeg presets (#3840)
* Add hwaccel presets

* Use hwaccel presets

* Add input arg presets

* Use input arg presets

* Make util to clean up redundant code

* Add support for output arg presets

* Add tests

* Update camera specific to use presets

* Update hwaccel to use presets

* Format files and fix tests

* Rewrite tests to test record correctly

* Move presets from string to list to avoid manually separating into a list

* Add mjpeg cuvid decoder preset

* Fix tests

* Fix comment
2022-11-28 21:48:11 -06:00
Nicolas Mowen
6c0978498d
Abstract MQTT from communication and make mqtt optional (#4462)
* Add option for mqtt config

* Setup communication layer

* Have a dispatcher which is responsible for handling and sending messages

* Move mqtt to communication

* Separate ws communications module

* Make ws client conform to communicator

* Cleanup imports

* Migrate to new dispatcher

* Clean up

* Need to set topic prefix

* Remove references to mqtt in dispatcher

* Don't start mqtt until dispatcher is subscribed

* Cleanup

* Shorten package

* Formatting

* Remove unused

* Cleanup

* Rename mqtt to ws on web

* Fix ws mypy

* Fix mypy

* Reformat

* Cleanup if/else chain

* Catch bad set commands
2022-11-23 20:03:20 -06:00
Nicolas Mowen
4eb3e98076
Update go2rtc, simplify manual stream, and support audio for MSE & WebRTC (#4391)
* Update go2rtc to rc3

* Simplify ffmpeg / audio conversions

* Set ffmpeg bin location

* Manually set video as copied

* Run go2rtc with env vars

* Remove manual ffmpeg declaration

* Enable force_audio by default

* Fix test
2022-11-16 06:29:47 -06:00
Nicolas Mowen
9e31873520
More config checks (#4310)
* Move existing checks to own functions

* Add config check for zone objects that are not tracked

* Add tests for config error

* Formatting

* Catch case where field is defined multiple times and add test

* Add warning for rtmp
2022-11-08 19:47:45 -06:00
Nate Meyer
4383b883c0
Refactor to simplify support for additional detector types (#3656)
* Refactor EdgeTPU and CPU model handling to detector submodules.

* Fix selecting the correct detection device type from the config

* Remove detector type check when creating ObjectDetectProcess

* Fixes after rebasing to 0.11

* Add init file to detector folder

* Rename to detect_api

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

* Add unit test for LocalObjectDetector class

* Add configuration for model inputs
Support transforming detection regions to RGB or BGR.
Support specifying the input tensor shape.  The tensor shape has a standard format ["BHWC"] when handed to the detector, but can be transformed in the detector to match the model shape using the model  input_tensor config.

* Add documentation for new model config parameters

* Add input tensor transpose to LocalObjectDetector

* Change the model input tensor config to use an enumeration

* Updates for model config documentation

Co-authored-by: Nicolas Mowen <nickmowen213@gmail.com>
2022-11-03 21:23:09 -05:00
Nicolas Mowen
1bc9efd529
Support special characters in passwords, redacted logs & debug config (#4057)
* Consts for regex

* Add regex for camera username and password

* Redact user:pass from ffmpeg logs

* Redact ffmpeg commands

* Move common function to util

* Add tests

* Formatting

* Remove unused imports

* Fix test

* Add port to test

* Support special characters in passwords

* Add tests for special character handling

* Remove docs about not supporting special characters
2022-11-02 07:00:54 -05:00
banthungprong
8163afce79
Allow cameras to be disabled in config (#4162)
* add option enabled for each camera in config

* Simplified If-block and removed wrong Optional

* Update Docs enabling/disabling camera in config

* correct format for option

* Disabling Camera for processes, no config changes

* Describe effects of disabled cam in documentation

* change if-logic, obsolete copy, info disabled cam

* changed color to white, added top padding in disabled camera info

* changed indentation
2022-11-02 06:41:44 -05:00
Nicolas Mowen
d8123d2497
Add go2rtc and add restream role / live source (#4082)
* Pull go2rtc dependency

* Add go2rtc to local services and add to s6

* Add relay controller for go2rtc

* Add restream role

* Add restream role

* Add restream to nginx

* Add camera live source config

* Disable RTMP by default and use restream

* Use go2rtc for camera config

* Fix go2rtc move

* Start restream on frigate start

* Send restream to camera level

* Fix restream

* Make sure jsmpeg works as expected

* Make view rspect live size config

* Tweak player options to fit live view

* Adjust VideoPlayer to accept live option which disables irrelevant controls

* Add multiple options from restream live view

* Add base for webrtc option

* Setup specific restream modules

* Make mp4 the default streaming for now

* Expose 8554 for rtsp relay from go2rtc

* Formatting

* Update docs to suggest new restream method.

* Update docs to reflect restream role

* Update docs to reflect restream role

* Add webrtc player

* Improvements to webRTC

* Support webrtc

* Cleanup

* Adjust rtmp test and add restream test

* Fix tests

* Add restream tests

* Add live view docs and show different options

* Small docs tweak

* Support all stream types

* Update to beta 9 of go2rtc

* Formatting

* Make jsmpeg the default

* Support wss if made from https

* Support wss if made from https

* Use onEffect

* Set url outside onEffect

* Fix passed deps

* Update docs about required host mode

* Try memo instead

* Close websocket on changing camera

* Formatting

* Close pc connection

* Set video source to null on cleanup

* Use full path since go2rtc can't see PATH var

* Adjust audio codec to enable browser audio by default

* Cleanup stream creation

* Add restream tests

* Format tests

* Mock requests

* Adjust paths

* Move stream configs to restream

* Remove live source

* Remove live config

* Use live persistence for which view to use on each camera

* Fix live sizes

* Only use jsmpeg sizes for jsmpeg live

* Set max live size

* Remove access of live config

* Add selector for live view source in web view

* Remove RTMP from default list of roles

* Update docs

* Fix tests

* Fix docs for live view modes

* make default undefined to avoid race condition

* Wait until camera source is loaded to avoid race condition

* Fix tests

* Add config to go2rtc

* Work with config

* Set full path for config

* Set to use stun

* Check for mounted file

* Look for frigate-go2rtc

* Update docs to reflect webRTC configuration.

* Add link to go2rtc config

* Update docs to be more clear

* Update docs to be more clear

* Update format

Co-authored-by: Felipe Santos <felipecassiors@gmail.com>

* Update live docs

* Improve bash startup script

* Add option to force audio compatibility

* Formatting

* Fix mapping

* Fix broken link

* Update go2rtc version

* Get go2rtc webui working

* Add support for mse

* Remove mp4 option

* Undo changes to video player

* Update docs for new live view options

* Make separate path for mse

* Remove unused

* Remove mp4 path

* Try to get go2rtc proxy working

* Try to get go2rtc proxy working

* Remove unused callback

* Allow websocket on restrea dashboard

* Make mse default stream option

* Fix mse sizing

* don't assume roles is defined

* Remove nginx mapping to go2rtc ui

Co-authored-by: Felipe Santos <felipecassiors@gmail.com>
Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2022-11-02 06:36:09 -05:00
Blake Blackshear
b36b63599b update stimeout to timeout 2022-07-05 11:55:55 -05:00
Blake Blackshear
bc078fcc88 remove deprecated max_seconds config option 2022-06-01 06:50:09 -05:00
Nicolas Mowen
de244d6873
Send mqtt message when motion is detected (#3152)
* Send mqtt message when motion is detected

* Use object processing instead of passing mqtt client around

* Cleanup

* Formatting

* add comment

* Make off delay configurable.

* Handle updating each camera based on config off delay

* Formatting

* Update docker-compose.yml

* Fix processing issue

* Update mqtt docs

* Update main config docs

* Make sure multiple True values aren't published for the same motion

* Make sure multiple True values aren't published for the same motion

* Update payload to fit existing HA standard values

* Update docs to fit new values

* Update docs

* Update motion topic

* Use datetime.datetime and remove unused imports

* Cast to int

* Clarify motion detector behavior in docs

* Fix typo

Co-authored-by: Blake Blackshear <blakeb@blakeshome.com>
2022-05-15 07:03:33 -05:00
Blake Blackshear
d890217447 Merge remote-tracking branch 'origin/master' into release-0.11.0 2022-04-18 06:45:30 -05:00
Blake Blackshear
a1afade9ba fix birdseye config 2022-04-16 09:08:10 -05:00
Blake Blackshear
ec91466fe4 lint fixes 2022-04-16 09:08:10 -05:00
Nicolas Mowen
a5016afdd4
FEAT: Ability to reorder & ability to hide Cameras in UI (#2981)
* Add options for reordering and hiding cameras selectively

* Add newline at end of camera file

* Make each camera for birdseye togglable as well

* Update names to be less ambiguous

* Update defaults

* Include sidebar change

* Remove birdseye toggle (will be added in separate PR)

* Remove birdseye toggle (will be added in separate PR)

* Remove birdseye toggle (will be added in separate PR)

* Update sidebar to only sort cameras once

* Simplify sorting logic
2022-04-15 07:23:02 -05:00
Nicolas Mowen
d749cf2e6b
Allow birdseye to be overridden at the camera level (#3083)
* Add camera level processing for birdseye

* Add camera level birdseye configruation

* Propogate birdseye from global

* Update docs to show that birdseye is overridable

* Fix incorrect default factory

* Update note to indicate values that can be overridden

* Cleanup config accessing

* Add tests for birdseye config behavior

* Fix mistake on test format

* Update tests
2022-04-15 06:59:30 -05:00
Nick
045aac8933
Add object filter ratio (#2952)
* Add object ratio config parameters

Issue: #2948

* Add config test for object filter ratios

Issue: #2948

* Address review comments

- Accept `ratio` default
- Rename `bounds` to `box` for consistency
- Add migration for new field

Issue: #2948

* Fix logical errors

- field migrations require default values
- `clipped` referenced the wrong index for region, since it shifted
- missed an inclusion of `ratio` for detections in `process_frames`
- revert naming `o[2]` as `box` since it is out of scope!

This has now been test-run against a video, so I believe the kinks are
worked out.

Issue: #2948

* Update contributing notes for `make`

Issue: #2948

* Fix migration

- Ensure that defaults match between Event and migration script
- Deconflict migration script number (from rebase)

Issue: #2948

* Filter objects out of ratio bounds

Issue: #2948

* Update migration file to 009

Issue: #2948
2022-04-10 08:25:18 -05:00
Blake Blackshear
b1a2b0cda2 make dynamic contrast optional and disable by default 2022-03-10 19:46:55 -06:00
JohnMark Sill
3e07d4eddb
feat: Timeline UI (#2830) 2022-02-27 08:04:12 -06:00
Blake Blackshear
ff19cdb773 refactor stationary config into section 2022-02-18 21:18:26 -06:00
Blake Blackshear
ee5b9986ad bump default stationary_threshold to 10s 2022-02-18 21:18:26 -06:00
Blake Blackshear
190f217b13 set stationary_threshold default to 5x fps 2022-02-18 21:18:26 -06:00
Blake Blackshear
3e90f3032c make stationary_threshold configurable 2022-02-18 21:18:26 -06:00
Blake Blackshear
de58bdcc9f improve warning for retain modes 2022-02-18 21:18:26 -06:00
Blake Blackshear
cf6e66c453 allow dash in camera name 2022-02-18 21:18:26 -06:00
Blake Blackshear
34fa53afcc make motion the default retain mode 2022-02-18 21:18:26 -06:00
Blake Blackshear
f512af2563 make expire interval configurable for users wanting to minimize i/o 2022-02-18 21:18:26 -06:00
Blake Blackshear
c6445898ce default periodic checks to never 2022-02-18 21:18:26 -06:00
Blake Blackshear
69aaf1f8e6 require url safe camera names 2022-02-18 21:18:26 -06:00
Yuriy Sannikov
6eecb6780e Run python unit tests in a github actions (#2589)
* tox tests initial commit

* run tests in the Dockerfile during the build phase

* remove local tests

Co-authored-by: YS <ys@gm.com>
2022-02-18 21:18:26 -06:00
Yuriy Sannikov
80627e4989 safe refactoring (#2552)
Co-authored-by: YS <ys@gm.com>
2022-02-18 21:18:26 -06:00
Justin Goette
f91f4f0053 Allow for ".yaml" (#2244)
* allow for ".yaml"

* remove unused import
2022-02-18 21:18:26 -06:00
Blake Blackshear
01e607a14e warn when retention mismatch 2022-02-18 21:18:26 -06:00
Blake Blackshear
dcf65febba switch to retain config instead of retain_days 2022-02-18 21:18:26 -06:00
Blake Blackshear
c50e9d48bf ensure stationary interval is greater than 0 2022-02-18 21:18:26 -06:00
Blake Blackshear
273076e7f4 don't modify ffmpeg_cmd object 2022-02-18 21:18:26 -06:00
Blake Blackshear
b29b311e92 fix ffmpeg config for env vars 2022-02-18 21:18:26 -06:00
Blake Blackshear
5a9e82c4b0 create ffmpeg commands on startup 2022-02-18 21:18:26 -06:00
Blake Blackshear
294c79a271 no longer make motion settings dynamic 2022-02-18 21:18:26 -06:00
Blake Blackshear
e351e132f5 remove min frame height of 180 and increase contour area 2022-02-18 21:18:26 -06:00
Blake Blackshear
eb16de7395 config option for stationary detection interval 2022-02-18 21:18:26 -06:00
Blake Blackshear
26ae6084ea fix rtmp again 2021-10-24 13:53:43 -05:00
Blake Blackshear
a67b8ab84d validate with runtime config (fixes #2055) 2021-10-23 08:21:15 -05:00
Blake Blackshear
4cf55ad8e2 Revert switch to mpegts format and audio default 2021-10-23 08:21:15 -05:00
Blake Blackshear
2e494477a6 backwards compatibility for segment_type 2021-10-16 10:36:13 -05:00
Blake Blackshear
86a741b6e6 assign roles when single input and consolidate validation 2021-10-16 07:46:39 -05:00
Blake Blackshear
e297e02800 store audio by default 2021-10-16 06:06:49 -05:00
Blake Blackshear
c809494c98 switch to mpegts format for cache and create mp4 with faststart 2021-10-15 21:08:43 -05:00
Blake Blackshear
c3109f808c allow partial days in retention settings 2021-09-20 18:59:16 -05:00
Blake Blackshear
661f7baa21 fix global live config 2021-09-13 20:33:00 -05:00