[HW Accel Support]: High CPU usage with 3 cameras #12610
-
Describe the problem you are havingI suspect that my cpu usage is relatively high. I have three cameras that are constantly consuming around 35-50 % CPU. Maybe someone could help me to optimize my configuration? Version0.13.2-6476F8A Frigate config filemqtt:
host: mqtt.lan
birdseye:
enabled: True
mode: continuous
ffmpeg:
hwaccel_args: preset-vaapi
detectors:
coral:
type: edgetpu
device: usb
record:
enabled: True
retain:
days: 7
mode: motion
events:
retain:
default: 14
mode: active_objects
go2rtc:
webrtc:
candidates:
- core.lan:8555
- stun:8555
streams:
rtsp_terrasse_lq:
- rtsp://cam-terrasse.lan:554/profile2
- "ffmpeg:rtsp_terrasse_lq#audio=aac"
rtsp_terrasse_hq:
- rtsp://cam-terrasse.lan:554/profile1
- "ffmpeg:rtsp_terrasse_hq#audio=aac"
rtsp_eingang_lq:
- rtsp://cam-eingang.lan:554/profile2
- "ffmpeg:rtsp_eingang_lq#audio=aac"
rtsp_eingang_hq:
- rtsp://cam-eingang.lan:554/profile1
- "ffmpeg:rtsp_eingang_hq#audio=aac"
rtsp_garten_lq:
- rtsp://cam-garten.lan:554/profile2
- "ffmpeg:rtsp_garten_lq#audio=aac"
rtsp_garten_hq:
- rtsp://cam-garten.lan:554/profile1
- "ffmpeg:rtsp_garten_hq#audio=aac"
snapshots:
enabled: True
cameras:
terrasse:
live:
stream_name: rtsp_terrasse_hq
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/rtsp_terrasse_lq
input_args: preset-rtsp-restream
roles:
- detect
- path: rtsp://127.0.0.1:8554/rtsp_terrasse_hq
input_args: preset-rtsp-restream
roles:
- record
detect:
width: 1280
height: 720
fps: 5
motion:
mask:
- 301,390,247,0,375,0,1035,0,966,259,694,151
record:
events:
required_zones:
- main_terrasse
- weg
- tor
snapshots:
required_zones:
- main_terrasse
- weg
- tor
mqtt:
required_zones:
- main_terrasse
- weg
- tor
zones:
main_terrasse:
coordinates: 311,394,1034,677,1121,292,691,196
tor:
coordinates: 1280,720,1280,109,1076,42,983,241,1161,304,1038,720
weg:
coordinates: 72,540,0,366,0,0,88,191,294,393
objects:
filters:
person:
mask: 301,390,247,0,375,0,1035,0,966,259,694,151
eingang:
live:
stream_name: rtsp_eingang_hq
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/rtsp_eingang_lq
input_args: preset-rtsp-restream
roles:
- detect
- path: rtsp://127.0.0.1:8554/rtsp_eingang_hq
input_args: preset-rtsp-restream
roles:
- record
record:
events:
required_zones:
- zone_auffahrt
- zone_tuer
- zone_autos
snapshots:
required_zones:
- zone_auffahrt
- zone_tuer
- zone_autos
mqtt:
required_zones:
- zone_auffahrt
- zone_tuer
- zone_autos
detect:
width: 1280
height: 720
fps: 5
motion:
mask:
- 1280,152,863,0,1280,0
- 888,256,554,97,326,170,594,396
- 0,267,0,0,60,0,278,637
zones:
zone_auffahrt:
coordinates: 779,0,1280,152,1280,337,1254,417,547,95,479,104,466,0
zone_autos:
coordinates: 56,0,235,0,262,182,109,219
zone_tuer:
coordinates: 1053,720,309,720,103,201,255,162,421,289,932,282,1259,396
objects:
filters:
car:
mask: 271,199,131,265,61,32,227,0
person:
mask:
- 418,125,445,223,620,219,557,91
- 531,445,672,458,691,255,541,244
garten:
live:
stream_name: rtsp_garten_hq
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
inputs:
- path: rtsp://127.0.0.1:8554/rtsp_garten_lq
input_args: preset-rtsp-restream
roles:
- detect
- path: rtsp://127.0.0.1:8554/rtsp_garten_hq
input_args: preset-rtsp-restream
roles:
- record
motion:
mask:
- 1280,0,1280,172,811,44,0,83,0,0
detect:
width: 1280
height: 720
fps: 5
objects:
filters:
bird:
mask:
- 0,720,1280,720,1280,0,0,0
car:
mask:
- 0,720,1280,720,1280,0,0,0
person:
mask:
- 1046,234,1096,233,1116,148,1051,140
ui:
live_mode: webrtc
objects:
track:
- person
- car
- motorcycle
- cat
- dog
- bird docker-compose file or Docker CLI commandversion: "3.9"
services:
frigate:
container_name: frigate
privileged: true
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:0.13.2
shm_size: "128mb"
devices:
- /dev/bus/usb:/dev/bus/usb
- /dev/dri/renderD128
- /dev/video10
- /dev/video11
volumes:
- /etc/localtime:/etc/localtime:ro
- ./config:/config/
- /dev/disk/external/video:/media/frigate
- type: tmpfs
target: /tmp/cache
tmpfs:
size: 2000000000
ports:
- "5000:5000"
- "8554:8554" # RTSP feeds
- "8555:8555/tcp" # WebRTC over tcp
- "8555:8555/udp" # WebRTC over udp
environment:
FRIGATE_RTSP_PASSWORD: "redacted" Relevant log output2024-07-25 16:58:32.578419207 [INFO] Preparing Frigate...
2024-07-25 16:58:34.326715832 [INFO] Starting Frigate...
2024-07-25 16:58:41.085237315 [2024-07-25 16:58:41] frigate.app INFO : Starting Frigate (0.13.2-6476f8a)
2024-07-25 16:58:41.217782506 [2024-07-25 16:58:41] peewee_migrate.logs INFO : Starting migrations
2024-07-25 16:58:41.226850818 [2024-07-25 16:58:41] peewee_migrate.logs INFO : There is nothing to migrate
2024-07-25 16:58:41.237616793 [2024-07-25 16:58:41] frigate.app INFO : Recording process started: 297
2024-07-25 16:58:41.243139023 [2024-07-25 16:58:41] frigate.app INFO : go2rtc process pid: 89
2024-07-25 16:58:41.308439190 [2024-07-25 16:58:41] frigate.app INFO : Output process started: 309
2024-07-25 16:58:41.387010917 [2024-07-25 16:58:41] frigate.app INFO : Camera processor started for terrasse: 320
2024-07-25 16:58:41.398187718 [2024-07-25 16:58:41] frigate.app INFO : Camera processor started for eingang: 330
2024-07-25 16:58:41.409991145 [2024-07-25 16:58:41] frigate.app INFO : Camera processor started for garten: 332
2024-07-25 16:58:41.421533251 [2024-07-25 16:58:41] frigate.app INFO : Capture process started for terrasse: 334
2024-07-25 16:58:41.432703793 [2024-07-25 16:58:41] frigate.app INFO : Capture process started for eingang: 338
2024-07-25 16:58:41.447690289 [2024-07-25 16:58:41] frigate.app INFO : Capture process started for garten: 342
2024-07-25 16:58:44.521578560 [2024-07-25 16:58:41] detector.coral INFO : Starting detection process: 307
2024-07-25 16:58:44.521767503 [2024-07-25 16:58:41] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb
2024-07-25 16:58:44.531437431 [2024-07-25 16:58:44] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found FFprobe output from your camera[{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"5/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","display_aspect_ratio":"16:9","height":720,"width":1280},{"avg_frame_rate":"0/0","codec_long_name":"AAC(AdvancedAudioCoding)"}]}},{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"25/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","display_aspect_ratio":"162:95","height":1520,"width":2592},{"avg_frame_rate":"0/0","codec_long_name":"AAC(AdvancedAudioCoding)"}]}}]
[{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"5/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","display_aspect_ratio":"16:9","height":720,"width":1280},{"avg_frame_rate":"0/0","codec_long_name":"AAC(AdvancedAudioCoding)"}]}},{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"5/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","display_aspect_ratio":"162:95","height":1520,"width":2592},{"avg_frame_rate":"0/0","codec_long_name":"AAC(AdvancedAudioCoding)"}]}}]
[{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"5/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","display_aspect_ratio":"16:9","height":720,"width":1280},{"avg_frame_rate":"0/0","codec_long_name":"AAC(AdvancedAudioCoding)"}]}},{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"25/1","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","display_aspect_ratio":"162:95","height":1520,"width":2592},{"avg_frame_rate":"0/0","codec_long_name":"AAC(AdvancedAudioCoding)"}]}}] Operating systemDebian Install methodDocker Compose Network connectionWired Camera make and modelPrivision ISR 340IPEN Any other information that may be helpfulIt's running on a Dell Wyse Thin Client 5070 (1.5 GHz Quad Core). |
Beta Was this translation helpful? Give feedback.
Answered by
NickM-27
Jul 25, 2024
Replies: 1 comment 5 replies
-
I think you need to use the i965 driver, add |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
NickM-27
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you need to use the i965 driver, add
LIBVA_DRIVER_NAME: i965
to the environment vars in the docker compose