Closed hatmeh80 closed 1 year ago
RPI4 93% CPU usage with detection off ? Any help why is this ?
because you are not using hardware acceleration and it is taxing the rpi to use the CPU to decode 4 streams
But i disabled the detecion in the UI
is there any where else to disable detection ?
does not matter, the stream will always be decoded even when object detection is disabled. it is used for things like motion detection, camera snapshot api, etc.
Got it, ordered a coral and should be delivered in a couple of days. Will it help lowering the cpu usage ?
it will not help with lowering the CPU usage that you see right now, you need to use hwaccel https://docs.frigate.video/configuration/hardware_acceleration#raspberry-pi-34
Should i add this to each stream in the frigate.yml ?
ffmpeg: hwaccel_args: preset-rpi-64-h264
or you can just set it globally
Lol , Noob here , no idea how to set it globaly :)
it just means not indented, you could do it like this
mqtt:
host: 192.168.100.237
user: mqttbroker
password: *******
ffmpeg:
hwaccel_args: preset-rpi-64-h264
cameras:
frontdoor:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/frontdoor
roles:
- detect
detect:
width: 1280
height: 720
camera2:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/camera2
roles:
- detect
detect:
width: 1280
height: 720
camera4:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/camera4
roles:
- detect
detect:
width: 1280
height: 720
go2rtc:
streams:
frontdoor: rtsp://admin:Rori1411!@192.168.100.49:554/user=admin_password=******_channel=1_stream=0.sdp
camera2: rtsp://admin:Rori1411!@192.168.100.49:554/user=admin_password=******_channel=2_stream=0.sdp
camera4: rtsp://admin:Rori1411!@192.168.100.49:554/user=admin_password=******_channel=4_stream=0.sdp
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: True
# Optional: print a timestamp on the snapshots (default: shown below)
timestamp: False
# Optional: draw bounding box on the snapshots (default: shown below)
bounding_box: True
# Optional: crop the snapshot (default: shown below)
crop: False
# 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
motion:
threshold: 20
Got it, will try now
No luck , still at 95% , question does this choice in friaget card affect the cpu ?
Not substantially. What are the resolutions of your cameras streams?
detect:
width: 1280
height: 720
This is the only place i find resolution relevant config
No, I'm asking what the actual resolution of your camera streams are. You can use the ffprobe button in the frigate system page
its a 2MP dahua camera connected to a DVR
It's recommended to use substreams. Right now you are telling the pi to scale down the main stream to 1280x720 which uses a lot of CPU.
So , what should i do exactly ? Use the lower stream and remove the below detect option ?
detect: width: 1280 height: 720
use the sub stream and set
detect:
width:
height:
to the actual resolution of that stream
Sorry for these noob question , how can i know the resolution of my 2MP camera ?
I am not sure how when using a DVR
other than using ffprobe, not sure why it gave you an error
hmm ok let me investigate
opened the substream in VLC and got this info , should i use this ?
detect:
width: 352 height: 288
Or Should i use :
detect: width: 288 height: 352
for that camera it would be
detect:
width: 352
height: 288
I'd check each camera to see what it is. Also worth seeing if it supports a sub stream with resolution that is higher than that (usually see 640x480)
ok let me try
Dude , you are a genius ! cameras playing and CPU at 12%
The quality is not so great, what can i do to enhance it ?
Increase the sub stream resolution on the DVR (if possible) or get cameras that work directly over IP and support better sub streams.
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
RPI4 93% CPU usage with detection off ? Any help why is this ?
P.S : Had 4 dahuha cameras one died, replaced it with hikvision then noticed the high cpu usage, dont know if this is related I disabled the new camera and it went down to 78%
I guess i have something wrong in the config ?
Version
0.12.1-367D724
Frigate config file
Relevant log output
Frigate stats
No response
Operating system
HassOS
Install method
HassOS Addon
Coral version
CPU (no coral)
Any other information that may be helpful
No response