[Config Support]: CPU usage and tips to improve #13189
-
Describe the problem you are havingWhere does the CPU value at the bottom come from? I'm worried about it hitting 50%, but only go2rtc and recording seem to contribute noticeably. Are my values ok? I've removed detection sub streams and started using main streams since I got the Coral, as I noticed quite an improvement in detections when using the full resolution stream. But CPU use increases quite a bit (not in detection, just the total %). Version0.14.0-da913d8 Frigate config filemqtt:
host: core-mosquitto
user: frigate
password: redacted
# logger:
# logs:
# frigate.record.util: debug
go2rtc:
log:
#level: trace
#api: trace
#exec: trace
#ngrok: trace
#rtsp: trace
#streams: trace
#webrtc: trace
# AAC Audio required for recordings and detection, Opus required only for webRTC Live View (2-way audio)
streams:
doorbell: # Reolink Doorbell WiFi
- rtsp:https://admin:[email protected]:554/h264Preview_01_main
- ffmpeg:doorbell#audio=aac#audio=volume
- ffmpeg:doorbell#audio=opus#audio=volume # Opus required for 2-way audio
# doorbell_sub: # 640x480, 7fps, 64K br 1x ifi
# - rtsp:https://admin:[email protected]:554/h264Preview_01_sub
# - ffmpeg:doorbell_sub#audio=aac#audio=volume
reolink: # Reolink E1 Pro broken night vision
- rtsp:https://admin:[email protected]:554/h264Preview_01_main
- ffmpeg:reolink#audio=aac#audio=volume
# reolink_sub: # 640x360, 7fps, 64K br
# - rtsp:https://admin:[email protected]:554/h264Preview_01_sub
# - ffmpeg:reolink_sub#audio=aac#audio=volume
bedroom: # Reolink E1 Pro
- rtsp:https://admin:[email protected]:554/h264Preview_01_main
- ffmpeg:bedroom#audio=aac#audio=volume
# bedroom_sub: # 640x360, 7fps, 64K br
# - rtsp:https://admin:[email protected]:554/h264Preview_01_sub
# - ffmpeg:bedroom_sub#audio=aac#audio=volume
backgarden: # Foscam R5
- ffmpeg:rtsp:https://foscamadmin:[email protected]:88/videoMain
- ffmpeg:backgarden#audio=aac#audio=volume
# backgarden_sub: # 640x480, 5fps, 50K br, 10 ifi
# - ffmpeg:rtsp:https://foscamadmin:[email protected]:88/videoSub
# - ffmpeg:backgarden_sub#audio=aac#audio=volume
livingroom: # Foscam R5
- ffmpeg:rtsp:https://foscamadmin:[email protected]:88/videoMain
- ffmpeg:livingroom#audio=aac#audio=volume
# livingroom_sub: # 640x480, 5fps, 50K br, 10 ifi
# - ffmpeg:rtsp:https://foscamadmin:[email protected]:88/videoSub
# - ffmpeg:livingroom_sub#audio=aac#audio=volume
## Frigate docs recommend HTTP+FLV connection for Reolink Doorbell, but only RTSP allows for 2-way audio
## #video=copy is needed for a single line ffmpeg config when using audio tags, or else video stream is dropped
## THIS INCREASES VOL AND PREVENTS THE AUDIO COMING OUT FROM THE CAMERA SOUNDING MUFFLED
## Source https://www.youtube.com/watch?v=upXyBVMR4RM
ffmpeg:
bin: ffmpeg
volume: -af "volume=30dB"
cameras:
doorbell:
# enabled: false
ffmpeg:
inputs:
- path: rtsp:https://127.0.0.1:8554/doorbell
roles:
- record
- detect
- audio
live:
stream_name: doorbell
detect: # Using main stream but downscaled
width: 960
height: 720
fps: 5
#birdseye:
# order: 1
zones:
Front_garden:
coordinates:
0.143,0.527,0.143,0.561,0.373,0.563,0.613,0.56,0.609,0.523,0.885,0.557,0.874,0.704,0.993,0.751,0.995,0.999,0.002,0.999,0,0.557
Driveway/Neighbours:
coordinates:
0.851,0.516,0.898,0.502,1,0.502,1,0.588,0.973,0.732,0.876,0.703,0.887,0.555,0.834,0.545
review:
detections:
required_zones:
- Front_garden
- Driveway/Neighbours
motion:
mask:
0,0.429,0.122,0.421,0.198,0.33,0.56,0.331,0.589,0.434,0.871,0.412,0.896,0.389,0.975,0.436,0.999,0.436,0.999,0.003,0.002,0
bedroom:
# enabled: false
ffmpeg:
inputs:
- path: rtsp:https://127.0.0.1:8554/bedroom
roles:
- record
# - path: rtsp:https://127.0.0.1:8554/bedroom_sub
# roles:
- detect
- audio
live:
stream_name: bedroom
# detect:
# width: 640
# height: 360
# fps: 7
#birdseye:
# order: 2
onvif:
host: 192.168.1.216
port: 8000
user: admin
password: redacted
objects:
filters:
person:
min_area: 1500
reolink:
# enabled: false
ffmpeg:
inputs:
- path: rtsp:https://127.0.0.1:8554/reolink
roles:
- record
# - path: rtsp:https://127.0.0.1:8554/reolink_sub
# roles:
- detect
- audio
live:
stream_name: reolink
# detect:
# width: 640
# height: 360
# fps: 7
#birdseye:
# order: 2
onvif:
host: 192.168.1.138
port: 8000
user: admin
password: redacted
backgarden:
# enabled: false
ffmpeg:
inputs:
- path: rtsp:https://127.0.0.1:8554/backgarden
roles:
- record
# - path: rtsp:https://127.0.0.1:8554/backgarden_sub
# roles:
- detect
- audio
live:
stream_name: backgarden
# detect:
# width: 640
# height: 480
# fps: 5
#birdseye:
# order: 3
onvif:
host: 192.168.1.177
port: 888
user: foscamadmin
password: redacted
motion:
mask:
0,0,0,0.394,0.363,0.373,0.377,0.417,0.372,0.436,0.441,0.442,0.564,0.463,0.715,0.511,0.899,0.456,0.894,0.07,0.882,0
livingroom:
# enabled: false
ffmpeg:
inputs:
- path: rtsp:https://127.0.0.1:8554/livingroom
roles:
- record
# - path: rtsp:https://127.0.0.1:8554/livingroom_sub
# roles:
- detect
- audio
live:
stream_name: livingroom
# detect:
# width: 640
# height: 480
# fps: 5
#birdseye:
# order: 4
onvif:
host: 192.168.1.239
port: 888
user: foscamadmin
password: redacted
# debugcam:
# ffmpeg:
# inputs:
# - path: /media/frigate/exports/doorbell_z97atv.mp4
# input_args: -re -stream_loop -1 -fflags +genpts
# roles:
# - detect
# - audio
## Intel N5095, SSD 256GB, 8GB RAM
ffmpeg:
hwaccel_args: preset-vaapi
input_args: preset-rtsp-restream-low-latency
output_args:
record: preset-record-generic-audio-aac
detectors:
coral:
type: edgetpu
device: usb
record:
enabled: true
# sync_recordings: true
retain:
days: 1 #default=0
mode: motion #default
events:
retain:
default: 5
mode: motion
export:
# Optional: Timelapse Output Args (default: shown below).
# NOTE: The default args are set to fit 24 hours of recording into 1 hour playback.
# See https://stackoverflow.com/a/58268695 for more info on how these args work.
# As an example: if you wanted to go from 24 hours to 30 minutes that would be going
# from 86400 seconds to 1800 seconds which would be 1800 / 86400 = 0.02.
# The -r (framerate) dictates how smooth the output video is.
# So the args would be -vf setpts=0.02*PTS -r 30 in that case.
# x4=0.25, x8=0.125, x16=0.0625
timelapse_args: -vf setpts=0.125*PTS
motion:
threshold: 50 # 0-255 default=30 Less is more sensitive (was using 150 for months)
improve_contrast: true
snapshots:
enabled: true
retain:
default: 10 #days
detect:
enabled: true
objects:
track:
- person
- cat
filters:
person:
threshold: 0.8
min_score: 0.65
# cat:
# threshold: 0.8
review:
alerts:
labels:
- bark #placeholder so person is not classed as an alert
audio:
enabled: true
listen:
- scream
- yell
- laughter
#birdseye:
# enabled: True
# mode: continuous
#ui:
#live_mode: webrtc
camera_groups:
Outdoors:
order: 2
icon: LuTrees
cameras:
- backgarden
- doorbell
Indoors:
order: 1
icon: LuHome
cameras:
- bedroom
- livingroom
- reolink
version: 0.14 Relevant log output2024-08-19 12:06:36.668587374 [INFO] Preparing Frigate...
2024-08-19 12:06:36.724415441 [INFO] Starting Frigate...
2024-08-19 12:06:39.813420268 [2024-08-19 13:06:39] frigate.app INFO : Starting Frigate (0.14.0-da913d8)
2024-08-19 12:06:39.813503351 [2024-08-19 13:06:39] frigate.app INFO : Creating directory: /tmp/cache
2024-08-19 12:06:39.814364019 [2024-08-19 13:06:39] frigate.util.config INFO : Checking if frigate config needs migration...
2024-08-19 12:06:39.871461100 [2024-08-19 13:06:39] frigate.util.config INFO : frigate config does not need migration...
2024-08-19 12:06:59.657400452 [2024-08-19 13:06:59] peewee_migrate.logs INFO : Starting migrations
2024-08-19 12:06:59.658441044 [2024-08-19 13:06:59] peewee_migrate.logs INFO : There is nothing to migrate
2024-08-19 12:06:59.662424650 [2024-08-19 13:06:59] frigate.app INFO : Running database vacuum
2024-08-19 12:07:03.887057678 [2024-08-19 13:07:03] frigate.app INFO : Recording process started: 416
2024-08-19 12:07:03.887280037 [2024-08-19 13:07:03] frigate.app INFO : Recording process started: 418
2024-08-19 12:07:03.890241436 [2024-08-19 13:07:03] frigate.app INFO : go2rtc process pid: 96
2024-08-19 12:07:03.922006155 [2024-08-19 13:07:03] detector.coral INFO : Starting detection process: 446
2024-08-19 12:07:03.925447805 [2024-08-19 13:07:03] frigate.app INFO : Output process started: 448
2024-08-19 12:07:03.928663361 [2024-08-19 13:07:03] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb
2024-08-19 12:07:04.001015774 [2024-08-19 13:07:03] frigate.app INFO : Camera processor started for doorbell: 465
2024-08-19 12:07:04.001020760 [2024-08-19 13:07:03] frigate.app INFO : Camera processor started for bedroom: 467
2024-08-19 12:07:04.001026694 [2024-08-19 13:07:03] frigate.app INFO : Camera processor started for reolink: 468
2024-08-19 12:07:04.001028614 [2024-08-19 13:07:03] frigate.app INFO : Camera processor started for backgarden: 475
2024-08-19 12:07:04.002788931 [2024-08-19 13:07:04] frigate.app INFO : Camera processor started for livingroom: 489
2024-08-19 12:07:04.018462210 [2024-08-19 13:07:04] frigate.app INFO : Capture process started for doorbell: 497
2024-08-19 12:07:04.038790827 [2024-08-19 13:07:04] frigate.app INFO : Capture process started for bedroom: 517
2024-08-19 12:07:04.062444861 [2024-08-19 13:07:04] frigate.app INFO : Capture process started for reolink: 525
2024-08-19 12:07:04.076721984 [2024-08-19 13:07:04] frigate.app INFO : Capture process started for backgarden: 532
2024-08-19 12:07:04.119797011 [2024-08-19 13:07:04] frigate.app INFO : Capture process started for livingroom: 539
2024-08-19 12:07:04.123120059 [2024-08-19 13:07:04] frigate.app INFO : Audio process started: 552
2024-08-19 12:07:04.174602117 [2024-08-19 13:07:04] frigate.comms.dispatcher INFO : Turning off detection for bedroom
2024-08-19 12:07:04.176309465 [2024-08-19 13:07:04] frigate.comms.dispatcher INFO : Turning off detection for livingroom
2024-08-19 12:07:06.552822131 [2024-08-19 13:07:06] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found
2024-08-19 12:09:14.091656779 [h264 @ 0x7f21a01a4e80] negative number of zero coeffs at 93 12
2024-08-19 12:09:14.091661682 [h264 @ 0x7f21a01a4e80] error while decoding MB 93 12
2024-08-19 12:09:14.309644240 [h264 @ 0x7f21a01283c0] Invalid level prefix
2024-08-19 12:09:14.309649185 [h264 @ 0x7f21a01283c0] error while decoding MB 1 102
2024-08-19 12:53:01.899426769 [h264 @ 0x7f21a0016640] corrupted macroblock 43 19 (total_coeff=-1)
2024-08-19 12:53:01.899432427 [h264 @ 0x7f21a0016640] error while decoding MB 43 19
2024-08-19 13:01:51.927944294 [h264 @ 0x7f21a0322c00] corrupted macroblock 37 113 (total_coeff=-1)
2024-08-19 13:01:51.927949333 [h264 @ 0x7f21a0322c00] error while decoding MB 37 113
2024-08-19 13:19:42.791497752 [h264 @ 0x7f21a01b3680] cbp too large (3199971767) at 51 37
2024-08-19 13:19:42.791505004 [h264 @ 0x7f21a01b3680] error while decoding MB 51 37
2024-08-19 13:30:48.483953824 [h264 @ 0x7f21a0017b80] error while decoding MB 5 67, bytestream -5
2024-08-19 13:37:03.765284743 [h264 @ 0x7f21a01147c0] corrupted macroblock 26 117 (total_coeff=-1)
2024-08-19 13:37:03.765293555 [h264 @ 0x7f21a01147c0] error while decoding MB 26 117 Frigate statsNo response Operating systemHassOS Install methodHassOS Addon Object DetectorCoral Any other information that may be helpfulNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
the value in the status bar is the cumulative CPU usage across all cores. the values shown for each process is % of a single core. You would want to check the cameras tab as that is the most likely to have higher CPU usage. |
Beta Was this translation helpful? Give feedback.
that is quite high resolution to run detect at, the CPU must be used to change the pixel format so that makes sense. I would suggest that you change the detect resolution to be something more reasonable like
this will still have good detection results while not running ffmpeg so hard