Raspberry Pi 4 Performance Issues: Slowdowns and Freezes, Motion Detection Software

November 18, 2023, 19:53

itsrocketman.

Hello 👋 I am using a Pi 4 4GB , Pi Camera V2, powered through a standard electrical outlet, running the Bullseye 64-bit image to implement motion detection software using Code::Blocks, OpenCV, C++ and GStreamer. However, the Raspberry Pi is extremely slow, suffering from delays and freezes. It becomes challenging to implement the motion detection software and add features, especially since the camera freezes as well. Overclocking is currently not an option and it even seems i dont have the option under settings. It wont let me overclock at all. <:confusedblob:1053364681575776276> I access the Pi through VNC, and I'm not sure if the performance issues are related to that, as I don't encounter any problems when working on my job tasks via VMWare. What could I do, and what might be the problem?

_krazy.

Thoughts: - VNC may lag because internet. - The code may try to process a lot of frames with some threading which causes the pi to lag if it can't process the queue. - get a lite version of the OS. - Don't use browsers, take consume RAM. - Check each software/library you have and see if they do anything on the side and don't require/import the whole library if unnecessary. - Limit processing to one frame each second. - Limit software usage. - Do top/htop/btop or whatever now exist and check computing power consumption for more details.

_krazy.

+ give some code if non of the above worked.

chekbrek

It's Windows' version of VNC basically

chekbrek

it's literally made for windows, but has better performance than VNC on linux for me at least

chekbrek

no problem

chekbrek

<:shrug:900978835816849409>

oops.se

Switch to "Raspberry Pi OS Lite" and ditch the desktop.

oops.se

I program Arduino to, but uses the Arduino IDE

oops.se

And as for the rest I uses bash or Python

oops.se

Bash is a script language its equal to "bat" in windows. But Bash is more powerful

oops.se

Isn't there a Visual Studio <-> Linux integration?