Open CV on Rpi 5 very sluggish

March 13, 2024, 19:24

.mallea

Im trying to hookup 1, if possible 2 logitech usb webcam (1920x1080). The camera works fine in vlc and processing for pi but I want to use python and the openCV library. This however does not work that smoothly, the video is lagged and also seems choppy. Anyone know any particular settings I should investigate ? (there seem to be a lot and i'm not that familiar with this) or any other tips to get it working smoothly with python ?

k9t33n

all you can really do is lower the resolution your attempting

.mallea

Thanks for the answer. The reason i wanted to use python is that it seems alot easier to run my project at boot. Lowering the resolution is really not prefferable, my next bet would be use processing for pi which I tested and runs fine, but i'm afraid i'll run into issues getting this to run at boot...

oops.se

To troubleshoot and find the issue, then is the advice to lower the resolution a darn good advice.

.mallea

..Not sure how to understand that. Obviously the rpi5 can cope with the resolution, proven with vlc and processing.

k9t33n

run libcamera-hello -t -0 and see if you like what you see

k9t33n

oh yeah btw what would be the bottleneck here <@796000224690307072>? because it doesn't cap the processing usage on the pi at all

k9t33n

is it the actual sensor?

.mallea

that gives me ERROR: no cameras available , perhaps this is for pi cameras, not usb ?

k9t33n

should work but that's fine

oops.se

I suspect that the cameras has USB2 and that will set the USB limit together with decoding the stream. But the command htop and usbtop (Needs to be installed, see https://github.com/aguinet/usbtop) could reveal the issue.