First Look RTSP

Sems Kurtoglu
6 min readNov 5, 2023

--

Photo by Ján Čorba on Unsplash

Introduction

Real-Time Streaming Protocol (RTSP) is an important communication protocol used for real-time transmission of video and audio streams. In this article, we will examine and discuss what RTSP is, how it works, in which areas it is used, its advantages and weaknesses.

What is RTSP and How Does It Work?

RTSP is a protocol for controlling and routing media streams. This protocol is defined in the Internet standard draft RFC 2326. Despite of its name RTSP actually does not transport any media like video and audio. RTSP is a companion protocol for RTP which is doing the actual work of the media transport. RTSP covers all aspects for the control of an RTP streaming session. A player connects to the RTSP connection handler of a streaming server and exchanges RTSP requests with the server. These requests and their responses are defined in RFC 2326. For example the RTSP requests are used to

  • select the streams which the client would like to play,
  • query the format of the stream (codecs) and the transport method (for example UDP or TCP based),
  • start and stop a streaming session

An RTSP/RTP server starts a stream after some requests from the client when the client sends an RTSP PLAY request. To handle RTSP requests from the client a streaming server must implement an RTSP parser to interpret the client messages.

Its basic functions include:

  • Establishing a Connection and Sending a Request to the Media Server: The client connects to the media server using the RTSP protocol and makes a request for media streaming.
  • Control of Media Streaming: RTSP performs operations such as starting, stopping, routing, and accelerating the media stream. This allows users to control the media stream.
  • Communication Between Media Server and Client: RTSP provides communication between the media server and the client. The media server controls the transmission of the media stream to clients.

Protocol acts as a remote control for networks, establishing and controlling media streams synchronized over time, such as continuous media like audio and video, between client devices and servers. It does not broadcast the multimedia itself but communicates with the server that broadcasts multimedia data. For example, when a user pauses a video stream, RTSP conveys the user’s pause request to the video streaming server.

Photo by Scott Rodgerson on Unsplash

RTP provides end-to-end network transport functions suitable for applications transmitting real-time data, such as audio, video or simulation data, over multicast or unicast network services. RTP does not address resource reservation and does not guarantee quality-of- service for real-time services. The data transport is augmented by a control protocol (RTCP) to allow monitoring of the data delivery in a manner scalable to large multicast networks, and to provide minimal control and identification functionality. RTP and RTCP are designed to be independent of the underlying transport and network layers.

Relationship between RTP and RSTP

RTP and RTSP are two protocols for real-time video and audio streaming. However, they have fundamentally different functions.

RTSP (Real-Time Streaming Protocol) is a control protocol. It is used to start, stop and control video streaming. RTP (Real-Time Transport Protocol) is a transport protocol. It is used to transport video and audio data.

The main features of RTSP are:

  • It is used to start, stop and control the video stream.
  • It can work over TCP or UDP.
  • It is a protocol similar to HTTP.

The main features of RTP are:

  • It is used to carry video and audio data.
  • It works over UDP.

In summary, RTSP and RTP are two different protocols used for real-time video and audio streaming. RTSP is a control protocol and is used to start, stop and control the video stream. RTP is a transport protocol and is used to transport video and audio data.

Photo by Paul Hanaoka on Unsplash

Key components of RTSP

RTSP has a number of key components, including:

  • Options. An options request is sent to the server to determine the request types that the media server supports.
  • Describe. A describe request includes a URL and describes the replay data.
  • Setup. A setup request describes how to transport the bitstream.
  • Teardown. A teardown request ends the streaming media session.
  • Redirect. A redirect request tells the client to connect to a different media server.
  • Play. The play request starts the specified media.
  • Pause. The pause request freezes the specified media until the user presses play.
  • Record. The record request starts a recording of the media.
  • Set_Parameter. Set_Parameter can test whether the client or server is active. It also reveals the values of the presentation or stream guidelines that the Uniform Resource Identifier (URI), which contains the characters that identify the resource, provides.[1]

History and development

RTSP is based on a 1997 proposal written by Anup Rao of Netscape Communications — later renamed New Aurora Corp. and sold to Facebook — and Rob Lanphier of Progressive Networks — now known as RealNetworks. The Multiparty Multimedia Session Control (MMUSIC) Working Group of the Internet Engineering Task Force (IETF) published it as Remote Function Call 2326.

Rao, Lanphier and others proposed RTSP Version 2.0 as RFC 7826 in December 2016. This version introduced some new header values in an effort to shorten the roundtrip communications with the media server. Version 2.0 also addresses some of the issues associated with Network Address Translation (NAT) traversal.[1]

Why is RTSP significant?

RTSP initially emerged as a solution to enable users to stream audio and video directly from the internet, eliminating the need to download media files to their devices. This protocol has found applications in diverse fields, ranging from internet camera platforms to online education and internet radio broadcasting.

RTSP leverages the same foundational principles as basic HTTP, making it seamlessly compatible with existing HTTP networks. Moreover, it offers a high degree of adaptability. Clients can request specific features they wish to employ, determining whether the media server can support them. Likewise, whoever owns the media can deliver media streams from multiple servers. The protocol is also designed to accommodate for future growth of the media so the media creator can amend the protocol moving forward if necessary.

Advantages of RTSP:

  • Real-Time Control: Users can control, start and stop media streaming in real time.
  • Remote Access: It provides remote access on IP-based systems, so users can monitor media streams from anywhere.
  • Various Usage Areas: RTSP can be used in various fields such as video monitoring, video conferencing, and media broadcasts.

It is among the important protocol options, especially in relevant IoT applications.

Weaknesses of RTSP:

  • Vulnerabilities: RTSP may contain security vulnerabilities and requires protection against malicious use.
  • Connectivity Issues: Low bandwidth or network problems can interrupt media streaming.

Consequences

RTSP is an important communication protocol for routing and controlling real-time media streams. That is why it is an essential component of IP-based video surveillance, video conferencing and media broadcasting. However, it should be used with caution considering its weaknesses such as security and connectivity issues.

--

--

Sems Kurtoglu

Electronic and Telecommunication Engineer & AI Developer