High CPU usage when i view Video

So, I have a camera setup that is running on a raspi zero.

The CPU usage shoots up to 100% as soon as I start to view the video remotely. It is okay when on the home netowork, but via the cloud it goes up to 100% and the system hangs. I then start getting all sorts of timeouts and warnings.
I end up restarting the openhab2 service and all goes back okay.

I am running openhab 2.2 on an Odroid XU. Java 1.8. The video is streaming at 1024x1080 5fps and is displayed on the sitemap as mjpeg

java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) Client VM (build 25.151-b12, mixed mode)

6:49:44.014 [ERROR] [.io.openhabcloud.internal.CloudClient] - Socket.IO error: {}
io.socket.engineio.client.EngineIOException: xhr poll error
	at io.socket.engineio.client.Transport.onError(Transport.java:71) [225:org.openhab.io.openhabcloud:2.2.0]
	at io.socket.engineio.client.transports.PollingXHR.access$100(PollingXHR.java:19) [225:org.openhab.io.openhabcloud:2.2.0]
	at io.socket.engineio.client.transports.PollingXHR$6$1.run(PollingXHR.java:124) [225:org.openhab.io.openhabcloud:2.2.0]
	at io.socket.thread.EventThread$2.run(EventThread.java:80) [225:org.openhab.io.openhabcloud:2.2.0]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
	at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.io.IOException: 400
	at io.socket.engineio.client.transports.PollingXHR$Request$1.run(PollingXHR.java:218) ~[?:?]
	... 1 more
16:49:44.042 [INFO ] [.io.openhabcloud.internal.CloudClient] - Disconnected from the openHAB Cloud service (UUID = fdf03dd5-0835-4d23-b6c1-cf69a7e55471, base URL = http://localhost:8080)
16:49:44.049 [WARN ] [.io.openhabcloud.internal.CloudClient] - Jetty request 2144164 failed: null

Which system’s CPU goes to 100%. If it is the RPi 0 then it means the RPi 0 is not powerful enough to store and stream the video it is capturing. You can try to drop the resolution or the FPS until it runs more smoothly.

Sorry, should have mentioned this; it is the openhab system cpu that goes 100%.
It was set to 30fps, dropped it down to 5fps, but no material difference on the cpu.

That’s weird. Something seems missing. Is your OH doing any type of encoding? On one of my panels, I have 20+ video streams, a mixture of mjpeg and h264. The load is on the client, not OH.

there is no encoding done by the openhab server. Moreover, the issue is only when i view the video remotely; on the Android app and not on the home network.