Skip to main content

RTSP

Quick look-up table

RTSP
Type of streamingReal time streaming
Development StateNot actively maintained
Expected Latency< 1sec , < 5 seconds if TCP
Connection typeUDP or TCP
Container typeRTP
WhereCustom players
Default Port554 (5554 for MistServer)
Modern codecsAll
Difficulty of readBeginner
NotesSupported in all modern browsers

What do I need to know about RTSP?

RTSP stands for Real Time Streaming Protocol and it's one of the oldest streaming protocols around with its release in 1996. In fact RTMP and WebRTC are both based of the groundwork RTSP has created. You will most likely encounter RTSP when you deal with IP/security cameras. While it's still reliable way to get media to a server the age of the protocol has caused it to fall out of favor. There is a proposed RTSP 2.0 spec released in 2016, however it is not backwards compatible so it never managed to get any real acceptance.

When would you use RTSP?

To get a stream towards a server, because the device supports RTSP only.

RTSP is especially popular in IP/security cameras, as the protocol works really well in local networks. What you'd usually see is that cameras host their own RTSP server from which you can request the stream. Anyone that can request it with the correct url will be able to join in and watch.

A relatively uniqueness to RTSP is that it can operate both over UDP and TCP, which is handy as IP cameras with wireless connection tend to need TCP to generate any usable image, while cameras connected by wire can deliver streams subsecond to the network. It is commonly accepted that RTSP streams are unsafe as anyone could connect and watch the stream. While this is partly true due to the nature of the protocol there are also a few old RTSP servers out there that keep getting re-used that have known security issues.

The scheme for RTSP is as follows

rtsp://(account:password)@HOSTNAME:PORT/path/STREAMNAME

account:password@ This is a method to do authorization. A lot of RTSP servers come with an account/password as the RTSP protocol would be open to anyone that can reach it otherwise. HOSTNAME The server to connect towards PORT The HTTP(S) port to connect towards, left out if 554 /path/STREAMNAME the path/streamname necessary to connect to the stream endpoint the RTSP server provides. For connecting to MistServer this would just be /streamname

Some things you should know about RTSP

  • Almost every playback or connection method for RTSP has UDP as the default, but TCP as an option. If you notice your stream isn't clean or working try looking for a TCP option.
  • If you're attempting an RTSP url and it is not working while you're absolutely sure it is correct look for special characters (#,$,@,etc) and URL encode (e.g. @ becomes %40) these if they're not part of the RTSP scheme. That can help making sure the connecting device interpreters the url correctly.
  • An RTSP stream is generally available to anyone in the network, sometimes even outside. Double-check what is used and what you want to allow.

Advantages of RTSP

  • UDP or TCP as a choice, low latency or reliability if network isn't working well
  • Ease of setup, devices can just start a server and you listen in
  • Spec allows for modern codecs to just be used

Disadvantages of RTSP

  • Needs a custom player to play
  • Has security issues, partly due to old RTSP servers
  • Over the years a lot of weird implementations have been distributed

How do you get started with RTSP?

Need to use RTSP and you're unsure on how to get it to work? Feel free to contact us and we'd be happy to see how we can help. Perhaps you've got several RTSP feeds and you'd like to be able to watch them in the browser? Select your distribution protocol and start connecting.