paukstelis / octoprint_deploy

Bash script for rapid deployment of multiple octoprint instance on a single machine
MIT License
389 stars 39 forks source link

High CPU usage with camera #150

Open JonSnow88 opened 5 months ago

JonSnow88 commented 5 months ago

I'm running octoprint on proxmox installed in a debain VM, I needed to give the VM 2 cores and its still at about 50% usage doing nothing.

I enabled the default ustreamer option with 0 during setup, how can I get the CPU usage down?

If the reason is because of software decoding in a VM, then what is the command to disable the camera feed?

On my previous setup, whenever I powered on/off my wifi plugs they issue a command to turn on/off the camera stream.

paukstelis commented 5 months ago

I can't tell you why it is high CPU usage, though if the camera doesn't have MJPEG compression it will use a lot more CPU. To disable a camera: sudo systemctl disable cam_instancename and sudo systemctl stop cam_instancename

JonSnow88 commented 5 months ago

It's a Wyze Cam v2 with webcam firmware, have used this for a few years on a Pi and haven't seen high CPU usage on it.

I've tried passing the Intel integrated GPU to the VM but it has had no effect on CPU, is there a way to enable hardware decoding for ustreamer?

sudo systemctl stop cam_instancename works with my wifi plugs, so at least the high CPU will occur when the printer is on and not 24/7/365. Not ideal but I can spare resources when printing.

Wyze Cam is supported: https://community.octoprint.org/t/usb-webcams-known-to-work-with-mjpg-streamer/21149

paukstelis commented 5 months ago

ustreamer will use hardware decode by default.

I don't use cameras at all, so I'm afraid I won't be able to give you any insight on this issue.

JonSnow88 commented 5 months ago

I may attempt to reinstall debian, with iGPU pass though before install.

That may have been my mistake