-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 for ffmpeg process #6461
Comments
Can you give this a try? ffmpeg:
hwaccel_args:
- -c:v:1
- h264_v4l2m2m |
Hi! Glad this has been raised actually - it's on my backlog to look at - I have 6 TP-link TAPO cameras (various models) which work really well with Frigate but definitely seeing higher CPU usage that I'd like (Intel J5040 / Coral PCIE). I've had to use the 1080p stream for detect on 3 of them because I'm looking specifically to detect our cats coming and going, and on the low-res streams a cat just don't give enough pixels :) I've been using preset-intel-qsv-h264 so far, will try the setting above and see if it improves. |
@rovingclimber this issue is specific to raspberry pi and it's hardware acceleration. I would suggest making your own issue as this issue isn't really relevant to your hardware. |
I'm running into a similar problem. I have an RPi4 8GB with the follow CPU utilisations. Two cameras same model.
I'm also not getting any usage stats from GPUs (I am not running the addon - Frigate is standalone). GPU memory set to 1024MB |
The RPi does not support usage stats so that is expected |
I should have left that point out as it's not my primary question. I'm most interested, and confused, about the CPU load given hardware acceleration settings. |
I'm experiencing the same issue. My setup similar (Raspberry Pi 4 8GB). The CPU usage drops from about 45% to 13% after switching from If I read the code correctly, that preset corresponds to: frigate/frigate/ffmpeg_presets.py Line 57 in 6d0c2ec
According to the ffmpeg docs,
So, if I get the I'm not sure about the reason behind this behavior :( My GPU memory is set to $ vcgencmd get_mem gpu
gpu=76M PS: I just found #6385 that seems to be about this. |
Indeed, it looks like it would include the ":1" selector to all users of the rpi preset.
That's a good question! Is there any other optimisation somebody think off? |
In my case, the load went from 80 % to about 30 %. Nice! |
That's encouraging! Could you post a bit more details on your camera settings? (stream size, frigate config for those etc.) |
This change is included in the preset as of 0.12.1 |
Off topic perhaps but I wanted this change too. Don't understand why the new docker build isnt pulled automatically when I have |
Did you run |
No. Didn’t realise as thought the latest tag would do this next time compose was started.
Thanks
Regards
Paul
… On 12 Jun 2023, at 11:41, Blake Blackshear ***@***.***> wrote:
Did you run docker compose pull?
—
Reply to this email directly, view it on GitHub <#6461 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACDT75B565SR4AWJ5XVZKA3XK3W5LANCNFSM6AAAAAAX5IPN4M>.
You are receiving this because you commented.
|
Compose doesnt pull new images on startup |
I believe I'm also having the same issue so thought I'd join in sharing as much info as I can to help. Hardware Setup Frigate Version Frigate config file
Frigate Log On Startup
Additional Notes |
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. |
Any hope of using less CPU on raspberry, or should I upgrade the hardware? |
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
CPU usage of the ffmpeg process is high, and slighlty higher (!) with hwaccel turned on. I'd like to optimise it as I can't scale down the resolution further on some cameras (G4s) and CPU usage is still high.
I'm running on a Raspberry Pi CM4 with 8GB RAM, and I've set GPU memory to 256MB.
I'm using the cameras named "Tapo2" and "G42" just to watch the stream in Home Assistant. No detection, no recording. And most of the time, little change there. The camera named "G41" is in the middle of the house, with lots of movements, and detection enabled (processed by the Coral USB).
Tests done (G41 and G42 have very similar CPU usage despite different configs) - see pictures below
What I don't understand:
Is my configuration incorrect in some ways? Should I add other arguments to ffmpeg input/output config? Any other suggestion?
(some links from #3860 are now dead, and couldn't find another idea to try from other "high CPU usage" issues)
Thanks a lot for the guidance
Version
0.12.0-DA3E197
Frigate config file (Test number 2: low res, with hwaccel)
Relevant log output
Nothing very relevant to me here...
FFprobe output from your cameras
Frigate stats
See screen shots below
Operating system
Other Linux
Install method
Docker Compose
Coral version
USB
Network connection
Wired
Camera make and model
1x Tapo c200, 2x Ubiquiti G4, 1x ieGeek whatever
Any other information that may be helpful
The text was updated successfully, but these errors were encountered: