Pi cam streaming over internet slow

What is the problem?

When connecting to Octopi over the internet streaming from my Pi-cam is incredibly slow. Over the local network it's effectively real time.

If I RDP to a machine on the local network, I can watch via the Pi-cam via RDP over the Internet and it's in real time.

What did you already try to solve it?

Nothing yet, been trying to figure out the cause of the problem, I wouldn't expect viewing the stream over RDP to be so good in performance if its terrible to stream directly. So I'm stumped.

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)

OctoPrint 1.3.8 running on OctoPi 0.15.1
18 Mb/s DSL down 1.8 MB/s DSL up
The Wifi signal strength is 87% and works great locally... just not remote.

1 Like

The stream is an MJPG Stream. MJPG doesn't compress the individual frames (whereas RDP for example does a whole ton of optimizations of the transmitted video data), hence it needs a whole lot of bandwidth. The upside of that is that it causes next to no overhead on the Pi.

Long story short: this is expected behaviour. You might have luck re-transcoding the stream if you want to have better performance via a net connection, but you really don't want to do that on the Pi.

1 Like

Or drop the resolution down to something simple.

1 Like

Or use a better codec / good on a pi you are limited.
maybe when hw encoding is available use it and choose a lower bitrate.

I've looked into html5 style streaming, I get stuck on a sane workflow more than a CPU limitation.