stephendade / Rpanion-server

Web-based configurator for companion computers of MAVLink vehicles
https://www.docs.rpanion.com/software/rpanion-server
GNU General Public License v3.0
146 stars 62 forks source link

4G LTE networks results in significant screen freezing and stuttering #225

Open lida2003 opened 6 months ago

lida2003 commented 6 months ago

The use of 4G LTE networks often results in significant screen freezing and stuttering.

However, when connected via wired or Wi-Fi networks with a VPN, these issues do not occur.

Are there any solutions available? FEC/QOS ???? any configuration that can help?

EDIT:

  1. I think 4G LTE should have the same result as WiFI/wired VPN.
  2. Unlimited range HD streaming with LTE
  3. I have tested 4G LTE VPN with iperf, the result is quite OK.
    • 1Mbit Test: bandwidth:1.05 Mbits/sec packet droped:0% Jitter:3.425 ms

    • 2Mbit Test: bandwidth:2.10 Mbits/sec packet droped:0% Jitter:3.465 ms

    • 3Mbit Test: bandwidth:3.14 Mbits/sec packet droped:0% Jitter:4.807 ms

lida2003 commented 6 months ago

@stephendade Never mind, I have sort out the issue. I'll add the link the test data later.

EDIT(Test Data): ZeroTier in my region is slow. Maybe a moon node should be added to improve the performance.

PS: OV5647+Pi3B+ 720P 30FPS configuration.

lida2003 commented 6 months ago

Currently, I don't think it's packet loss or 4G LTE signal issue.

But I'm NOT sure what cause the video image has quite a lot of noise mosaic.

especially in the below situation:

  1. dark environment
  2. when moving

https://www.youtube.com/watch?v=Q-lAwk4nHVo

stephendade commented 6 months ago

The noise mosiac you're seeing is H264 compression artefacts. Does increasing the bitrate work? Otherwise, I may need to tweak the encoder settings.

lida2003 commented 6 months ago

There is not much improvement changing bitrate from 1100kbps to 2000kpbs, but latency increased. And It didn't improve either from 720P to 1080P.

Can you guide me, let me know where I can change and do the tests?

stephendade commented 6 months ago

Can you try some higher bitrates - 5000 to 10000kbps? I found that much of the noise disappears above 5000kbps.

Also, you may need to mount your camera on some anti-vibration mounts. On multirotors and fixed-wing aircraft, heavy vibration can mess with the H264 encoder.

lida2003 commented 5 months ago

Well, if I set bitrate to 5000kbps, It seems NOT good for 4GLTE and above 2000Kbps, then latency will increase.

So right now, I'm just using bitrate below 2000kbps, typically 1500kbps.

Can you tell me where I can change to tweak the encoder settings? And I can test locally, if any progress, I will update to the post.

stephendade commented 5 months ago

On the RPi, run v4l2-ctl -d 11 --list-ctrls-menu to get the x264 hardware encoder settings.

Those settings then go into here: https://github.com/stephendade/Rpanion-server/blob/master/python/rtsp-server.py#L148

Note, I recently pushed a large patch to rtsp-server.py, so you may need to git pull on your RPi.