Skip to content
Advertisement

Live555 RTSP server does not use UDP

I have a pretty basic live555 RTSP server and client to stream a h264 stream written in c++.

Here’s the code I have for the client (adapted from testProgs/testRTSPClient.cpp, bundled with live555)

JavaScript

Here’s the code I have for the server (adapted from testProgs/testOnDemandRTSPServer.cpp, bundled with live555)

JavaScript

I was under the assumption that live555 by default used UDP to transport data to the client from the server, which is what I wanted for it’s latency benefits over TCP. However while running the server client I happened to check netstat and I found this:

JavaScript

It is however showing that the communications are going through TCP not UDP. I am a bit confused here, am I mis-interpreting netstat here?

Is there anything I need to tune in my c++ code to force the communication to go through UDP not TCP?

Advertisement

Answer

Okay so I figured out the answer. To help anyone else who is curious about this, the code is actually all correct. There is also no mis-interpretation of netstat. RTSP does indeed run over TCP not UDP. However the transport method of the A/V data runs on RTP, a connection that RTSP simply negotiates and instantiates. RTP almost always will run over UDP. To figure out what port and protocol the A/V data stream is going over you will need to sniff the packets sent out via RTSP. In my case the A/V data stream was indeed still going over UDP.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement