简体   繁体   English

为什么当RTT很大时,基于TCP的RTSP不能很好地工作

[英]Why RTSP over TCP does not work well when RTT is large

I'm using live555 to stream H264 video from On-demand RTSP server using RTSP over TCP as follows: 我正在使用live555通过TCP通过RTSP从点播RTSP服务器流式传输H264视频,如下所示:

./openRTSP -F tcp-test -Q -d 60 -b 500000  -4 -P 62 -w 3840 -h 2160 -f 30 rtsp://ip-address:8554/h264ESVideoTest

It works well when RTT is less than 30ms. 当RTT小于30ms时,它可以很好地工作。 However, if I increase RTT to 100ms using linux's tcp tc command, then I can only get half quality video. 但是,如果我使用linux的tcp tc命令将RTT增加到100毫秒,那么我只能得到一半质量的视频。 RTSP over UDP still works fine when RTT is 100ms. 当RTT为100ms时,基于UDP的RTSP仍然可以正常工作。 Since I'm running this locally it is not matter of network traffic as I can confirm using iperf that throughput can go up to maximum even when rtt is 100ms. 因为我是在本地运行的,所以这与网络流量无关,因为我可以使用iperf确认即使rtt为100ms,吞吐量也可以达到最大值。 So I'm wondering what causes this? 所以我想知道是什么原因造成的?

After looking around a little bit, this turned out to be buffering problem. 环顾四周后,结果发现这是缓冲问题。 OpenRTSP uses 50K buffer by default which falls short when RTT is large. 默认情况下,OpenRTSP使用50K缓冲区,当RTT较大时,它会不足。 Thus, I have increased buffer size in increaseSendBufferTo() method call in liveMedia/GenericMediaServer.cpp which helped to resolve the issue. 因此,我在liveMedia / GenericMediaServer.cpp中的gainSendBufferTo ()方法调用中增加了缓冲区大小,这有助于解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM