RTSP Protocol

RTSP (Real-Time Streaming Protocol) sets up and controls a media session. RTP commonly carries the video and audio. During SETUP, the camera and player can negotiate separate UDP media ports or interleave RTP and RTCP on the RTSP TCP connection. A plain rtsp:// URL defaults to TCP port 554. Use the port configured on your camera or recorder.

Languages · English

What is the RTSP Protocol?

RTSP 1.0 is specified in RFC 2326. RTSP 2.0 is specified in RFC 7826.

A compatible IP camera or recorder can use RTSP to let a viewer start, pause, and end a local stream. Check the device documentation for the available stream URLs and controls.

RTSP uses HTTP-like requests and responses. The server tracks session state using a session identifier. A session can persist across control connections when the implementation supports it.

How RTSP, RTP, and RTCP work together

RTSP

Controls the session with requests such as DESCRIBE, SETUP, PLAY, and TEARDOWN. The default plain RTSP control port is TCP 554.

RTP

Real-time Transport Protocol carries encoded audio and video using the negotiated transport.

RTCP

RTP Control Protocol reports delivery statistics and provides timing information for synchronization.

With UDP, RTP and RTCP normally use separate negotiated ports. With interleaved TCP, they share the RTSP control connection and use separate channel numbers.

RTSP and RTPS

RTPS stands for Real-Time Publish-Subscribe and moves data between applications in DDS systems. For an IP camera stream, use the RTSP address documented by the camera or recorder.

OMG DDSI-RTPS specification

RTSP Protocol Methods

MethodPurpose
OPTIONSAsk which methods are supported. The server lists them in the Public header.
DESCRIBERequest a description of the media, typically in SDP.
SETUPNegotiate transport for a track and establish or join a session.
PLAYStart or resume delivery using the negotiated transport.
PAUSEPause delivery and keep the session available.
TEARDOWNEnd the stream or session and release its resources.

Example: RTSP 1.0 Session with UDP Media

This abbreviated exchange shows RTSP control on TCP port 554 and UDP media ports offered and confirmed during SETUP.

C→S: OPTIONS rtsp://192.168.1.100:554/stream RTSP/1.0 CSeq: 1 User-Agent: SmartRTSP S→C: RTSP/1.0 200 OK CSeq: 1 Public: OPTIONS, DESCRIBE, SETUP, PLAY, PAUSE, TEARDOWN C→S: DESCRIBE rtsp://192.168.1.100:554/stream RTSP/1.0 CSeq: 2 Accept: application/sdp S→C: RTSP/1.0 200 OK CSeq: 2 Content-Type: application/sdp Content-Length: 460 v=0 o=- 1 1 IN IP4 192.168.1.100 s=IP Camera m=video 0 RTP/AVP 96 a=rtpmap:96 H264/90000 a=fmtp:96 profile-level-id=42001e; ... a=control:track1 C→S: SETUP rtsp://192.168.1.100:554/stream/track1 RTSP/1.0 CSeq: 3 Transport: RTP/AVP;unicast;client_port=5004-5005 S→C: RTSP/1.0 200 OK CSeq: 3 Session: 12345678 Transport: RTP/AVP;unicast;client_port=5004-5005;server_port=6970-6971 C→S: PLAY rtsp://192.168.1.100:554/stream RTSP/1.0 CSeq: 4 Session: 12345678 S→C: RTSP/1.0 200 OK CSeq: 4 Session: 12345678 [RTP video packets now flowing to UDP port 5004] C→S: TEARDOWN rtsp://192.168.1.100:554/stream RTSP/1.0 CSeq: 5 Session: 12345678 S→C: RTSP/1.0 200 OK CSeq: 5

RTSP Control and Media Ports

ConnectionPort
RTSP control over TCP554 by default
RTSP alternative8554 if configured
RTSPS control over TLS322 by default
RTP and RTCP over UDPNegotiated during SETUP
Interleaved RTP and RTCP over TCPShares the RTSP control connection

The UDP ports 5004 and 5005 are an optional RTP and RTCP pair. The actual UDP ports depend on the negotiated transport, and some setups can share a port. Use the endpoint settings and the SETUP response to verify the ports in use.

RTSP URL Format

rtsp://host[:port]/path[?query]

Use the host and configured port of the camera or recorder that serves the stream. The path and optional query are specific to the device and stream. Enter credentials separately when your player provides login fields.

RTSP over TCP or UDP

The rtsp:// scheme identifies the control endpoint. The player offers a media transport in SETUP and the server confirms the option it supports. With interleaved TCP, both sides agree on channel numbers for RTP and RTCP.

Transport: RTP/AVP/TCP;unicast;interleaved=0-1

Some clients recognize rtspt:// as a client-specific way to request TCP media. Keep the camera’s documented rtsp:// URL and choose the player’s RTP over TCP option when available.

SDP: Session Description Protocol

A DESCRIBE response often contains an SDP description of the tracks, codecs, and parameters. The player uses these details to select a track and send SETUP.

FieldMeaning
m=video … RTP/AVP 96Media type, port, transport profile, and payload type
a=rtpmap:96 H264/90000Maps payload type 96 to H.264 and a 90 kHz clock
a=fmtp:96 profile-level-id=…Codec format parameters, such as H.264 profile and level
a=control:track1Track control URI used to form the SETUP request

RTSP 1.0 vs RTSP 2.0

RTSP 2.0 updates session handling and request pipelining. It requires reliable transport for control messages. Check the versions supported by both endpoints when troubleshooting an RTSP 1.0 camera or recorder.

RTSP Protocol Security

Plain RTSP leaves control traffic unencrypted. RTSPS uses TLS to protect the control connection and any media interleaved on it. Separate media needs its own protection, such as SRTP, when the camera and player support it.

Keep camera URLs and credentials private. Use a trusted local network or a private connection such as a VPN for remote viewing.

RTSP Protocol FAQ

What port does RTSP use?

A plain rtsp:// URL uses TCP port 554 by default. An rtsps:// endpoint uses TCP port 322 by default for TLS. Use the configured port if your device specifies one.

Does RTSP use TCP or UDP?

RTSP control normally uses TCP. The player and camera negotiate the media transport separately. Common choices are RTP over UDP and RTP and RTCP interleaved on the RTSP TCP connection.

What video codecs does RTSP support?

The media description and RTP payload identify codecs such as H.264 or H.265 video and AAC or G.711 audio. Playback requires a codec supported by both the sending device and the player.

Why does RTSP fail through NAT/firewalls?

When the control connection works but video is blank, the network may block or misroute the negotiated UDP media traffic. Try the player’s RTP over TCP option if both endpoints support it.

How is RTSP different from HLS or DASH?

HLS and DASH deliver media segments over HTTP. RTSP establishes and controls a media session, which can deliver packets using RTP. End-to-end latency depends on the encoder, network, buffering, and player.

View RTSP Streams on iPhone & Mac

Use SmartRTSP to view compatible RTSP cameras and recorders on iPhone and Mac. Enter the documented stream URL and check that your device and player support the selected transport and codec.

Download SmartRTSP