[Live-devel] RTP over TCP video stream break problem

Андрій Олексійович Радченко aoradchenko.fshn22 at kubg.edu.ua
Wed Aug 9 00:37:20 PDT 2023


Hi. I use live555 to create server and client that stream and get video and
audio respectively. I use RTP over TCP due to possible bad network. If use
UDP instead of TCP then in some situations can't get I-frames of H264
stream and nothing is decoding, showing etc, I can't afford this in my
system. I can afford some lags, gaps and so on but not "nothing".
If the callback from my MediaSink on the client side is working fast then
everything is OK. However if it hangs for example for 1-2 seconds it is
possible that some internal socket buffer becomes overwhelmed. If the
server is not live555 based server then after such lag it is recovered and
continues working. But the live555 server stops sending video and continues
sending only audio.
I set DEBUG and DEBUG_SEND defines when compiling live555 server and found
out that the problem is in 'sendRTPorRTCPPacketOverTCP' and
'sendDataOverTCP' method in RTPInterface class.

I got the essence of the algorithm:
1) Send header of packet. If sending failed then do nothing;
2) If successful then force send the packet's body.
3) If the full body didn't send then the stream got the inconsistent state
(client got header but only part of body). The question is: what to do with
such a state?

Current live5555 code just closes video's streaming. And as for me this is
illogical for the next reason.
The live555 client can recover (don't know how but it is cool) from such
inconsistent packet's data and continue to get video and audio in the
correct way. It does it with other servers and can do it with live555
server if comment 'removeStreamSocket(socketNum, 0xFF);' on 412 line of
RTPInterface.cpp.

So, I propose not to close video streaming in such cases (remove that
line). Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20230809/7ddc552b/attachment.htm>


More information about the live-devel mailing list