#Slow / Low FPS when viewing through mainsail

31 messages · Page 1 of 1 (latest)

kind ermine
#

Setup : Pi4b with Logitech 920 Pro
OS : MainsailOS

Issue : Framerate is extremely low through the mainsail web interface. Sometimes drops to 0FPS. Would really like to get 15FPS somewhat stable. Sometimes when first open webpage it is 15FPS but then drops within 10-15 seconds to 3-4.

History : I previously used octoprint on same hardware and was able to do 30 FPS stable.

Tried : Changing Mode, adjusting format, adjusting resolution, switching the service, setting custom tags, etc.

late lakeBOT
#

Ahoi @kind ermine!
It looks like you did not provide all the necessary information we need to help you.
Please upload your logfiles and a detailed description of your problem.
For further information see: https://docs.mainsail.xyz/faq/getting-help/discord#provide-information
Note: We only accept .log and .txt files as log files.
This is an automated message

We are glad to help and chat with you on our Community Discord, but if you need help and want the best support possible you should, follow a few simple rules:

kind ermine
#

Which logs / configs do you want?

scarlet bear
#

crowsnest.log

#

That's the only thing in play here

#

Also you mentioned you change mode. You should tell us what modes you tried and what the effects were.

#

I previously used octoprint on same hardware and was able to do 30 FPS stable.
This information is only useful if you can still get the same performance today. It's possible that things on your network changed, that influence the network bandwidth

kind ermine
#

Here is the crowsnest logs.
I have tried both the default "ustreamer" and "camera-streamer" with no perceived impact to overall performance. I did notice that the custom flag "--format=YUYV" does not work with camera-streamer (results in loss of camera display).

I have also tried setting the resolution all the way down to 640x480, changing no_proxy to true, utilizing v4l2ctl options, and nothing seems to have a consistent impact.

#

I will say that camera-streamer seems to at least stay above 2-3, while ustreamer seems to sometimes drop to 0, at least more often.

#

Here are my current webcam settings

#

I have tried the other services as well. The frame rate does change, but most of the time is never above 9-10 max and usually is 6 or less.

scarlet bear
#

Please do not compress the log and just send it here

#

--format=YUYV is a ustreamer only option. camera-streamer has --camera-format=YUYV

#

changing no_proxy to true
and then you did what? Or did you just set random things without actually using them?

kind ermine
scarlet bear
#

So setting no_proxy: true has the impact, that you can connect to the port and mitigate the proxy. But if you still use the proxy, there is no benefit ofc. So don't set random things, just for trying them out

kind ermine
# scarlet bear So setting `no_proxy: true` has the impact, that you can connect to the port and...

I did not set random things. I tested very methodically. Turned on / off each setting to try and determine where the issue may be.
I have tried WebRTC. (Will try it again)

  • When using WebRTC it seems BURSTY, where as the framerate destabilizes. It does seem to be a bit faster, but then freezes often, maybe every 3-5 seconds for at least 1/2 second or more.
    I will test and let you know if the experience this time is different.
scarlet bear
#

I tested very methodically. Turned on / off each setting to try and determine where the issue may be.
Sure it might be methodical, but you still have set things that did not have any impact on your testing method.

#

Did you test --camera-format=YUYV for camera-streamer now?

#

You could also test --allow-truncated-frames with ustreamer

#

Fyi I adjusted the issue now, that it's more clear which parameter to choose for which mode

kind ermine
#

Ok. I have confirmed. The WebRTC behavior is the same.

#

Spikes up to 12FPS but then freezes every few seconds.

#

Continues that behavior indefinately

#

I did see a post in one of the issues related : "I'd like to add to this one as a user with a C920 who has been plagued by low FPS for years until I just cracked it. I replied to the destination thread as well, but, I think the documentation could use more pointers as well.
I was getting around 1-2fps on a pi3b and moved to a pi5 with no change specifically thinking the old pi was limiting me."

--format=YUYV absolutely brought me from 2fps to 10fps which is more than I have seen in a long time. It's a great suggestion and should bein in the documentation.

The big fix for me however was instead using
--encoder=HW --allow-truncated-frames"

#

I will do the --encoder=HW --allow-truncated-frames

#

And test.

#

Should I revert the WebRTC?

#

Or leave it?

scarlet bear
#

Those parameters are for ustreamer. ustreamer has no WebRTC. So if you want to try them, remove it