Panowie,
HA mam postawione na proxmox, na oddzielnym terminalu (dell wyse) mam zainstalowanego debiana. Chciałem postawić frigate w dokerze i skonfigurować mqtt z HA.
Instalację frigate robiłem według poradnika:
https://www.digimoot.com/frigate-nvr-linux-manual-install/
Niestety przy próbie włączenia wywala “frigate exited with code 0”
Dorzucam plik fonfiguracyjny frigate.yml oraz zrzut z błędem z frigate
- wklejaj logi i konfiguracje jako tekst, aby przy wklejaniu do posta YAML nie został rozwalony (zupełnie jak na githubie) musisz użyć linii z 3 odwrotnymi apostrofami (to ten znak spod “klawisza tyldy”) przed i po wklejonym bloku tekstu - takie coś: ```
- co ta konfiguracja jest taka ucięta? w przykładowym pliku jest tam ponad 150 linii, a prawie wszystkie błędy w tym kawałku loga dotyczą braku opcji konfiguracyjnych, które są pokazane w przykładzie
PS oczywiście wszystkie wcześniejsze punkty tutoriala wypełniłeś? (konfiguracja frigate jest tam dopiero 8 punktem)
Łączyłem się przez dodatek ssh w HA i nie umiek kopiować tekstu z terminala (zdalnie przez nabucasa)
Jak będę na miejscu to wkleję kod skopiowany z putty. Chyba, że wiesz jak skopiować tekst z ssh terminal w HA?
shift + kursor myszy?
sudo docker-compose up [65/1827]
[sudo] hasło użytkownika dell:
[+] Running 1/0
✔ Container frigate Created 0.0s
Attaching to frigate
frigate | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
frigate | [s6-init] ensuring user provided files have correct perms...exited 0.
frigate | [fix-attrs.d] applying ownership & permissions fixes...
frigate | [fix-attrs.d] done.
frigate | [cont-init.d] executing container initialization scripts...
frigate | [cont-init.d] done.
frigate | [services.d] starting services
frigate | [services.d] done.
frigate | [2023-05-15 10:09:36] frigate.app INFO : Starting Frigate (0.11.1-2eada21)
frigate | *************************************************************
frigate | *************************************************************
frigate | *** Your config file is not valid! ***
frigate | *** Please check the docs at ***
frigate | *** https://docs.frigate.video/configuration/index ***
frigate | *************************************************************
frigate | *************************************************************
frigate | *** Config Validation Errors ***
frigate | *************************************************************
frigate | 12 validation errors for FrigateConfig
frigate | cameras -> front_camera_frigate -> ffmpeg -> global_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> ffmpeg -> hwaccel_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> ffmpeg -> input_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> ffmpeg -> output_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> ffmpeg -> inputs -> 1 -> roles -> 0
frigate | cameras -> front_camera_frigate -> ffmpeg -> inputs -> 1 -> global_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> ffmpeg -> inputs -> 1 -> hwaccel_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> ffmpeg -> inputs -> 1 -> input_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> clips
frigate | extra fields not permitted (type=value_error.extra)
frigate | cameras -> front_camera_frigate -> fps
frigate | extra fields not permitted (type=value_error.extra)
frigate | cameras -> front_camera_frigate -> height
frigate | extra fields not permitted (type=value_error.extra)
frigate | cameras -> front_camera_frigate -> width
frigate | extra fields not permitted (type=value_error.extra)
frigate | Traceback (most recent call last):
frigate | File "/opt/frigate/frigate/app.py", line 332, in start
frigate | self.init_config()
frigate | File "/opt/frigate/frigate/app.py", line 82, in init_config
frigate | user_config = FrigateConfig.parse_file(config_file)
frigate | File "/opt/frigate/frigate/config.py", line 942, in parse_file
frigate | return cls.parse_obj(config)
frigate | File "pydantic/main.py", line 521, in pydantic.main.BaseModel.parse_obj
frigate | File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
frigate | pydantic.error_wrappers.ValidationError: 12 validation errors for FrigateConfig
frigate | pydantic.error_wrappers.ValidationError: 12 validation errors for FrigateConfig
frigate | cameras -> front_camera_frigate -> ffmpeg -> global_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> ffmpeg -> hwaccel_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> ffmpeg -> input_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> ffmpeg -> output_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> ffmpeg -> inputs -> 1 -> roles -> 0
frigate | value is not a valid enumeration member; permitted: 'record', 'rtmp', 'detect' (type=type_error.enum; enum_values=[<CameraRoleEnum.record: 'record'>, <CameraRoleEnum.rtmp: 'rtmp'>, <CameraRoleEnum.detect: 'detect'>])
frigate | cameras -> front_camera_frigate -> ffmpeg -> inputs -> 1 -> global_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> ffmpeg -> inputs -> 1 -> hwaccel_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> ffmpeg -> inputs -> 1 -> input_args
frigate | none is not an allowed value (type=type_error.none.not_allowed)
frigate | cameras -> front_camera_frigate -> clips
frigate | extra fields not permitted (type=value_error.extra)
frigate | cameras -> front_camera_frigate -> fps
frigate | extra fields not permitted (type=value_error.extra)
frigate | cameras -> front_camera_frigate -> height
frigate | extra fields not permitted (type=value_error.extra)
frigate | cameras -> front_camera_frigate -> width
frigate | extra fields not permitted (type=value_error.extra)
frigate |
frigate | *************************************************************
frigate | *** End Config Validation Errors ***
frigate | *************************************************************
frigate | [cmd] python3 exited 1
frigate | [cont-finish.d] executing container finish scripts...
frigate | [cont-finish.d] done.
frigate | [s6-finish] waiting for services.
frigate | [s6-finish] sending all processes the TERM signal.
frigate | [s6-finish] sending all processes the KILL signal and exiting.
frigate exited with code 0
Plik frigate.yml
mqtt:
host: 192.168.18.101
user: mqtt
password: mqtt
cameras:
# Required: name of the camera
front_camera_frigate:
# Required: ffmpeg settings for the camera
ffmpeg:
# Required: A list of input streams for the camera. See documentation for more information.
inputs:
# Required: the path to the stream
# NOTE: Environment variables that begin with 'FRIGATE_' may be referenced in {}
- path: rtsp://192.168.18.87:554/cam/realmonitor?channel=1&subtype=0
# Required: list of roles for this stream. valid values are: detect,record,clips,rtmp
# NOTICE: In addition to assigning the record, clips, and rtmp roles,
# they must also be enabled in the camera config.
roles:
- detect
- rtmp
- path: rtsp://192.168.18.87:554/cam/realmonitor?channel=1&subtype=2
roles:
- clips
# Optional: stream specific global args (default: inherit)
global_args:
# Optional: stream specific hwaccel args (default: inherit)
hwaccel_args:
# Optional: stream specific input args (default: inherit)
input_args:
# Optional: camera specific global args (default: inherit)
global_args:
# Optional: camera specific hwaccel args (default: inherit)
hwaccel_args:
# Optional: camera specific input args (default: inherit)
input_args:
# Optional: camera specific output args (default: inherit)
output_args:
# Required: width of the frame for the input with the detect role
width: 1280
# Required: height of the frame for the input with the detect role
height: 720
# Optional: desired fps for your camera for the input with the detect role
# NOTE: Recommended value of 5. Ideally, try and reduce your FPS on the camera.
# Frigate will attempt to autodetect if not specified.
fps: 5
# Optional: camera level motion config
motion:
# Optional: motion mask
# NOTE: see docs for more detailed info on creating masks
mask: 0,900,1080,900,1080,1920,0,1920
# Optional: timeout for highest scoring image before allowing it
# to be replaced by a newer image. (default: shown below)
best_image_timeout: 60
# Optional: zones for this camera
zones:
# Required: name of the zone
# NOTE: This must be different than any camera names, but can match with another zone on another
# camera.
front_steps:
# Required: List of x,y coordinates to define the polygon of the zone.
# NOTE: Coordinates can be generated at https://www.image-map.net/
coordinates: 545,1077,747,939,788,805
# Optional: Zone level object filters.
# NOTE: The global and camera filters are applied upstream.
filters:
person:
min_area: 5000
max_area: 100000
threshold: 0.7
# Optional: Camera level detect settings
detect:
# Optional: enables detection for the camera (default: True)
# This value can be set via MQTT and will be updated in startup based on retained value
enabled: True
# Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)
max_disappeared: 25
# Optional: save clips configuration
clips:
# Required: enables clips for the camera (default: shown below)
# This value can be set via MQTT and will be updated in startup based on retained value
enabled: False
# Optional: Number of seconds before the event to include in the clips (default: shown below)
pre_capture: 5
# Optional: Number of seconds after the event to include in the clips (default: shown below)
post_capture: 5
# Optional: Objects to save clips for. (default: all tracked objects)
objects:
- person
# Optional: Restrict clips to objects that entered any of the listed zones (default: no required zones)
required_zones: []
# Optional: Camera override for retention settings (default: global values)
retain:
# Required: Default retention days (default: shown below)
default: 10
# Optional: Per object retention days
objects:
person: 15
# Optional: 24/7 recording configuration
record:
# Optional: Enable recording (default: global setting)
enabled: False
# Optional: Number of days to retain (default: global setting)
retain_days: 30
# Optional: RTMP re-stream configuration
rtmp:
# Required: Enable the live stream (default: True)
enabled: True
# Optional: Configuration for the jpg snapshots written to the clips directory for each event
snapshots:
# Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
# This value can be set via MQTT and will be updated in startup based on retained value
enabled: False
# Optional: print a timestamp on the snapshots (default: shown below)
timestamp: False
# Optional: draw bounding box on the snapshots (default: shown below)
bounding_box: False
# Optional: crop the snapshot (default: shown below)
crop: False
# Optional: height to resize the snapshot to (default: original size)
height: 175
# Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
required_zones: []
# Optional: Camera override for retention settings (default: global values)
retain:
# Required: Default retention days (default: shown below)
default: 10
# Optional: Per object retention days
objects:
person: 15
# Optional: Configuration for the jpg snapshots published via MQTT
mqtt:
# Optional: Enable publishing snapshot via mqtt for camera (default: shown below)
# NOTE: Only applies to publishing image data to MQTT via 'frigate///snapshot'.
# All other messages will still be published.
enabled: True
# Optional: print a timestamp on the snapshots (default: shown below)
timestamp: True
# Optional: draw bounding box on the snapshots (default: shown below)
bounding_box: True
# Optional: crop the snapshot (default: shown below)
crop: True
# Optional: height to resize the snapshot to (default: shown below)
height: 270
# Optional: Restrict mqtt messages to objects that entered any of the listed zones (default: no required zones)
required_zones: []
# Optional: Camera level object filters config.
objects:
track:
- person
- car
# Optional: mask to prevent all object types from being detected in certain areas (default: no mask)
# Checks based on the bottom center of the bounding box of the object.
# NOTE: This mask is COMBINED with the object type specific mask below
mask: 0,0,1000,0,1000,200,0,200
filters:
person:
min_area: 5000
max_area: 100000
min_score: 0.5
threshold: 0.7
# Optional: mask to prevent this object type from being detected in certain areas (default: no mask)
# Checks based on the bottom center of the bounding box of the object
mask: 0,0,1000,0,1000,200,0,200
no masz pełno argumentów które masz puste albo błędne, to jest czyjś sampel
zrób po kroku dodając kolejne argumenty inaczej tego nie zrobisz:
Okroiłem plik frigata.yml do wersji:
mqtt:
enabled: False
cameras:
front_camera:
ffmpeg:
inputs:
- path: rtsp://192.168.18.86:554/H264?ch=1&subtype=1
roles:
- detect
detect:
enabled: False
width: 1280
height: 720
Niestety dalej wywala kontener:
frigate | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
frigate | [s6-init] ensuring user provided files have correct perms...exited 0.
frigate | [fix-attrs.d] applying ownership & permissions fixes...
frigate | [fix-attrs.d] done.
frigate | [cont-init.d] executing container initialization scripts...
frigate | [cont-init.d] done.
frigate | [services.d] starting services
frigate | [services.d] done.
frigate | [2023-05-22 13:51:14] frigate.app INFO : Starting Frigate (0.11.1-2eada21)
frigate | *************************************************************
frigate | *************************************************************
frigate | *** Your config file is not valid! ***
frigate | *** Please check the docs at ***
frigate | *** https://docs.frigate.video/configuration/index ***
frigate | *************************************************************
frigate | *************************************************************
frigate | ************************************************************* [5/1864]
frigate | *** Config Validation Errors ***
frigate | *************************************************************
frigate | 2 validation errors for FrigateConfig
frigate | mqtt -> host
frigate | field required (type=value_error.missing)
frigate | mqtt -> enabled
frigate | extra fields not permitted (type=value_error.extra)
frigate | Traceback (most recent call last):
frigate | File "/opt/frigate/frigate/app.py", line 332, in start
frigate | self.init_config()
frigate | File "/opt/frigate/frigate/app.py", line 82, in init_config
frigate | user_config = FrigateConfig.parse_file(config_file)
frigate | File "/opt/frigate/frigate/config.py", line 942, in parse_file
frigate | return cls.parse_obj(config)
frigate | File "pydantic/main.py", line 521, in pydantic.main.BaseModel.parse_obj
frigate | File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
frigate | pydantic.error_wrappers.ValidationError: 2 validation errors for FrigateConfig
frigate | mqtt -> host
frigate | field required (type=value_error.missing)
frigate | mqtt -> enabled
frigate | extra fields not permitted (type=value_error.extra)
frigate |
frigate | *************************************************************
frigate | *** End Config Validation Errors ***
frigate | *************************************************************
frigate | [cmd] python3 exited 1
frigate | [cont-finish.d] executing container finish scripts...
frigate | [cont-finish.d] done.
frigate | [s6-finish] waiting for services.
frigate | [s6-finish] sending all processes the TERM signal.
frigate | [s6-finish] sending all processes the KILL signal and exiting.
frigate exited with code 1
Nie możesz ani wyrzucać z konfiguracji opcji wymaganych oznaczonych Required (przykładowo wymagana jest poprawna konfiguracja hosta MQTT), ani wymyślać własnych (tu raczej podejrzewam “białe znaki” w pliku).
Robisz to bezmyślnie, skup sie na chwilę, przeczytaj dokumentacje frigate, która jest wybitnie napisana, wszystko w niej znajdziesz. A jak już coś Ci wywala, to przeczytaj to “COŚ” a nie wrzucasz, żeby sobie inni czytali,
przykładowo jak wół jest napisane:
frigate | mqtt -> host
frigate | field required (type=value_error.missing)
Ale to wlasnie wersja z okrojonego pliku co wrzuciles link. I tam wlasnie jest mqtt wyłączone. I wyraznie tam pisze, ze juz frigata powinna dzialas nawet jak jest mqtt wylaczone. Widzę, że nie czytales tego co wrzuciles;)
no faktycznie mają tak wpisane, ale w konsoli piszą że wymagane, więc dodaj
Panowie działa na maksymalnie okrojonym pliku frigate.yml
sudo docker-compose up
[sudo] hasło użytkownika dell:
[+] Running 1/0
✔ Container frigate Created 0.0s
Attaching to frigate
frigate | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
frigate | [s6-init] ensuring user provided files have correct perms...exited 0.
frigate | [fix-attrs.d] applying ownership & permissions fixes...
frigate | [fix-attrs.d] done.
frigate | [cont-init.d] executing container initialization scripts...
frigate | [cont-init.d] done.
frigate | [services.d] starting services
frigate | [services.d] done.
frigate | [2023-05-22 18:58:17] frigate.app INFO : Starting Frigate (0.11.1-2eada21)
frigate | Starting migrations
frigate | [2023-05-22 18:58:17] peewee_migrate INFO : Starting migrations
frigate | There is nothing to migrate
frigate | [2023-05-22 18:58:17] peewee_migrate INFO : There is nothing to migrate
frigate | [2023-05-22 18:58:17] detector.cpu INFO : Starting detection process: 216
frigate | [2023-05-22 18:58:17] frigate.app INFO : Output process started: 218
frigate | [2023-05-22 18:58:17] frigate.app INFO : Camera processor started for front_camera: 222
frigate | [2023-05-22 18:58:17] ws4py INFO : Using epoll
frigate | [2023-05-22 18:58:17] frigate.app INFO : Capture process started for front_camera: 224
frigate | [2023-05-22 18:58:17] frigate.edgetpu WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
frigate | [2023-05-22 18:58:18] ws4py INFO : Using epoll
plik frigate.yml
mqtt:
host: 192.168.18.101
user: mqtt
password: mqtt
topic_prefix: frigate
client_id: frigate
cameras:
front_camera:
ffmpeg:
#hwaccel_args: preset-vaapi
#hwaccel_args: preset-intel-qsv-h264
inputs:
- path: rtsp://xxx:xxx6@192.168.18.87:554/cam/realmonitor?channel=1&subtype=1
roles:
- detect
detect:
enabled: True
width: 1280
height: 720
Teraz można brać się za doklejanie maski i integrację z HA
Z ciekawości masz pod to podpięte jakieś GPU czy coś, co wspomaga Frigate? Bo sam Wyse to wydajnością nie grzeszy, wiec się zastanawiam jak to śmiga pod dockerem.
Zadnego korala nie posiadam. Temperatury skoczyly do 74 stopni, trzymalem testowo włączony przez tydzien, troche zwieszalo inne usługi, obecnie jest wyłączony, bede mial czas to bede sie dalej bawic, moze zainwestuje w jakiegos korala.
Musze sprawdzic czy moj dell wyse 5070 posiada dodatkowe wejscie to moze sie skuszę;P
No ja działam na NAS, wiec raczej nie mam szans na instalację Corala u siebie Ale procek mocniejszy niz ten w Wyse, wiec …
Na przykład QNAP NAS wspiera Coral M.2.
Na Synologi również, @macek pomógł uruchomić Coral
też nie mam korala, ale nie bardzo rozumiem
host: - co to za adres? kamery?
user i password co to za login i do czego?
mój rstp jest znacznie krótszy: rtsp://192.168.8.200:554/11
oczywiście login i hasło do kamery dodam, ale u Ciebie jest jeszcze dużo op adresie.
Jak to ogarnąć?