[Support]: High CPU usage simply adding second cam
See original GitHub issueDescribe the problem you are having
Here again… A strange problem is driving me crazy. I own a mini PC with Pentium J5040 al 16GB of ram, and i thought it would have been enough for 16 cams recording, but i have my CPU with very high usage just with second cam…
FIRST CONFIG: I have CAM 1 configured like attached file, and CPU stays, let’s say, al 10% (i have also Home Assistant and some other things). If i add CAM 2 (same cam as cam 1), configured as attached, my CPU makes a jump of +25%… Only for recording??? I thought that with detect enable set to “false” the only work would have been record direct stream and pass-thru RTMP stream, not so much… And here the strange part (after many tries)…
SECOND CONFIG: Cam 1 configured same way. If i enable in CAM 2 the second stream (it was not enabled since i didnt’t need it, ot at least this was what i thought…) and i: 1-put “detect” role on second low res stream and… 2-leave detect enabled “false” (like in first configuration)… CPU load is only 2-3% more!!! What?
So my question is: why it seems that ffmpeg goes crazy (i see it with command “top -i”) in first config, while adding second cam, and even third, with second config my CPU goes from 10 to 13%? What am i missing again? 😛 Is always necessary an active low res sub stream with a detect role disabled? Thanks!!!
Version
0.11.1-2eada21
Frigate config file
mqtt:
host:
port:
topic_prefix: frigate
client_id: frigate
user:
password:
stats_interval: 120
detectors:
cpu:
type: cpu
num_threads: 1
ffmpeg:
hwaccel_args: -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p
cameras:
# cam 1
cam1:
ffmpeg:
inputs:
- path: rtsp://admin:xxxxxxxx@xxxxxxxxxxxxx:554/cam/realmonitor?channel=1&subtype=0
roles:
- record
- rtmp
- path: rtsp://admin:xxxxxxxx@xxxxxxxxxxxxx:554/cam/realmonitor?channel=1&subtype=1
roles:
- detect
detect:
width: 854
height: 480
fps: 5
motion:
mask:
- 0,0,0,102,520,99,520,143,854,247,854,0
objects:
track:
- person
filters:
person:
threshold: 0.6
rtmp:
enabled: true
record:
enabled: true
expire_interval: 60
retain:
days: 10
mode: all
snapshots:
enabled: true
timestamp: false
bounding_box: true
retain:
default: 3
# cam 2
cam2:
ffmpeg:
inputs:
- path: rtsp://admin:xxxxxxxx@xxxxxxxxxxxx:554/cam/realmonitor?channel=1&subtype=0
roles:
- record
- rtmp
# - path: rtsp://admin:xxxxxxxxx@xxxxxxxxxxxx:554/cam/realmonitor?channel=1&subtype=1
# roles:
# - detect
detect:
enabled: false
# width: 854
# height: 480
# fps: 5
# objects:
# track:
# - person
# filters:
# person:
# threshold: 0.6
rtmp:
enabled: true
record:
enabled: true
expire_interval: 60
retain:
days: 10
mode: all
# snapshots:
# enabled: true
# timestamp: false
# bounding_box: true
# retain:
# default: 3
Relevant log output
.
FFprobe output from your camera
.
Frigate stats
No response
Operating system
HassOS
Install method
Docker CLI
Coral version
CPU (no coral)
Network connection
Wired
Camera make and model
Imou IPC-G22
Any other information that may be helpful
No response
Issue Analytics
- State:
- Created 9 months ago
- Comments:9
Top GitHub Comments
No, the ability to trigger recordings / snapshots via API is completely unrelated to having the detect stream optional (as far as implementing the feature goes)
https://github.com/blakeblackshear/frigate/issues/1911 is what would bring the ability to only record and not have detect.
I see similar behaviour here so thank you @NickM-27 for the explanations.
FWIW, I want to add more cameras as ‘record only’ (no detection thread, no ffmpeg resize thread, no birdseye, etc) as these cameras have their own motion/object detection. I simply want to integrate recordings into Frigate by taking motion/object signal from the cameras and start recording in Frigate via API (awaiting #1063). Basically I want to offload motion/object detection those cameras that provide this to reduce load on the host running Frigate.
Guess I’m too early giving this a go, but can we assume that ‘record only’ will be supported with #1063?