MJPEG stream has a terribly slow framerate in HA, works fine in other platform

I’m using an MJPEG stream (from mjpeg-streamer, running on a Raspberry Pi with Raspberry Pi cam) to monitor my 3D printer.

I have that stream implemented in Octoprint where it correctly plays at ~30 fps, but when I integrate it to HA via camera.mjpeg it drops down to a terribly slow framerate. Is HA trying to transcode the stream in any way? Also why would that happen if it is compatible with MJPEG streams?

Both are of course using the same URL and mjpeg-streamer fps is set to 30.

Did you ever manage to figure it out. I have the same problem with my cameras I am exposing through Blue Iris. The mjpeg stream links works flawlessly in a browser window but refreshes very poorly inside HA.

My theory is that it is an issue with RaPi hardware. I am using Pi4 with 4GB RAM. For trial, I spun a new Home Assistant instance on my windows desktop using a docker container and same cameras work real time there.

Did you try adding

camera_view: live

To your card config ?

It worked fine in HA on a lower res camera. When I switched to an raspi camera with 1080p 30Hz I experienced the same.

To get good quality image and framerates on octopi I had to increase gpu memory from 128 to 256. Maybe the same needs to be done on HA?. Problem is I don’t know how to on hassos.