-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Support]: High CPU usage simply adding second cam #4675
Comments
whatever Resizing the stream takes considerable CPU work, most likely you are setting the wrong size (or leaving it commented out) in which case the stream is being resized and using much more CPU For example, I'd be surprised if 854x480 was the native resolution of the cam_1 substream |
Ok, but my goal is to detect (and record and RTMP) only in CAM 1, and do only recordings and RTMP in all other CAMs.... Question 2: i've set detect "width" in cam 1 in order to correct wrong aspect ratio of 640x480 stretched to 4:3 of the sub stream...
So they should be 4:3..... or is enough to set width in one cam to affect also others? |
Setting width on one camera will not affect others. This will also use more cpu resources. There is also no way to disable the detect feed (you can disable object detection, but not the detect feed itself) since this is used for the live view, motion detection, etc. |
So detect role and object detection are not the same...... |
the detect role is used for object detection, but there is currently no way to turn it off (even if object detection is off)
sub streams are recommended for reducing CPU usage of motion detection (which is needed for object detection and for record retention depending on your configuration) |
And this part of docs detect: is related to object detection or detect stream? I think the second.... If i have some cams with a main stream of 4MP and sub stream 640x480, what is best setting in order to:
With less CPU usage obviously? Now, without modifications in config, i think Frigate is resizing sub streams of CAM 1+2+3 from 640x480 to 1280x720.... or not? This is good for aspect ratio (image is not stretched), but adding cams 4, 5, 6.... and so on perhaps will be too heavy for my CPU... |
These are mutually inclusive. The width/height is for the detect stream which is used for object detection so really the answer is it is relevant for both.
Set their native resolution in detect -> width / height since there's no reason to try to correct the aspect ratio. |
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? |
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) #1911 is what would bring the ability to only record and not have detect. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Describe 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? :-P
Is always necessary an active low res sub stream with a detect role disabled?
Thanks!!!
Version
0.11.1-2eada21
Frigate config file
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
The text was updated successfully, but these errors were encountered: