[Live-devel] UDP RTSP Stream
Warren Young
warren at etr-usa.com
Tue Feb 19 13:23:02 PST 2019
On Feb 19, 2019, at 11:57 AM, Kevin Bailey <kevin at advantaacomputer.com> wrote:
>
> I wanted my RTSP stream to be UDP based not TCP based to take advantage of the latency advantage UDP has over TCP. However I noticed the following when I took a look at netstat while my program was running:
>
> ~# netstat | grep 8554
> tcp 0 0 x.x.x.x:8554 wsip-x-x-x-x:39224 ESTABLISHED
>
> 8554 is the port I am using for the RTSP server. Why does it list tcp at the beginning? Does that mean my stream is going over TCP? How can I adjust it to use UDP? And if it is using UDP and I mis-understanding the output of netstat?
You’re confusing two unrelated things.
RTSP is a TCP protocol. Period. Always.
But, RTSP is just the “VCR buttons” protocol for your stream: put this media in the player, play it, pause it, fast forward it…
The part you’re concerned about is the stream that’s negotiated via RTSP, which is most probably going to be either RTP — which almost always runs over UDP — or raw UDP. You have to go out of your way in Live555 to get RTP-over-HTTP, which is the only TCP-based protocol I believe Live555 supports.
To find out what protocol your actual A/V stream goes over, you’ll need to sniff the RTSP protocol negotiation and read the messages. What gets negotiated depends on how Live555 is configured and the capabilities of the client. You’re in control of the first, but not the second. If your client demands RTP-over-HTTP, then that’s what Live555 will deliver, if it can.
As for latency, you’re going to find that TCP’s latency is swamped by the encoding latency of your video codec most of the time.
More information about the live-devel
mailing list