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.
RTSP Protocol Methods
| Method | Purpose |
|---|---|
OPTIONS | Ask which methods are supported. The server lists them in the Public header. |
DESCRIBE | Request a description of the media, typically in SDP. |
SETUP | Negotiate transport for a track and establish or join a session. |
PLAY | Start or resume delivery using the negotiated transport. |
PAUSE | Pause delivery and keep the session available. |
TEARDOWN | End 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.
RTSP Control and Media Ports
| Connection | Port |
|---|---|
| RTSP control over TCP | 554 by default |
| RTSP alternative | 8554 if configured |
| RTSPS control over TLS | 322 by default |
| RTP and RTCP over UDP | Negotiated during SETUP |
| Interleaved RTP and RTCP over TCP | Shares 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
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.
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.
| Field | Meaning |
|---|---|
m=video … RTP/AVP 96 | Media type, port, transport profile, and payload type |
a=rtpmap:96 H264/90000 | Maps 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:track1 | Track 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