What is the RTSP Protocol?
RTSP — Real-Time Streaming Protocol — is a network-level application protocol designed to establish and control media streaming sessions. It is defined in RFC 2326 (1998) and superseded by RFC 7826 (RTSP 2.0, 2016).
RTSP is used by virtually every IP security camera on the market to expose a live video stream over a local network. When a viewer app like SmartRTSP connects to a camera, it is using RTSP to negotiate the session before receiving the actual video frames via RTP.
RTSP is intentionally modeled after HTTP — its syntax is similar, and it uses a request-response model — but unlike HTTP it is stateful: the connection persists for the duration of the streaming session, and the server tracks session state across multiple requests.
The RTSP Protocol Stack: RTSP + RTP + RTCP
RTSP does not carry media data itself. It is a control plane protocol. The actual video and audio payload travels over RTP, with quality feedback over RTCP:
In practice: the RTSP client connects to TCP/554, exchanges DESCRIBE/SETUP messages, then the camera starts sending RTP packets (H.264 or H.265 frames) over a negotiated UDP port pair.
RTSP Protocol Methods
RTSP defines a set of methods similar to HTTP verbs. The six core methods used in a typical camera streaming session are:
| Method | Direction | Purpose |
|---|---|---|
OPTIONS | Client → Server | Ask the server which RTSP methods it supports. Server replies with an Allow header listing available methods. |
DESCRIBE | Client → Server | Request a description of the presentation. Server responds with an SDP (Session Description Protocol) document describing available streams, codecs, and transport parameters. |
SETUP | Client → Server | Specify transport parameters for a single stream (e.g. UDP ports for RTP/RTCP). Server responds with a session identifier and confirmed transport details. |
PLAY | Client → Server | Start or resume streaming. The server begins sending RTP packets to the negotiated address/port. |
PAUSE | Client → Server | Temporarily halt the stream without closing the session. A subsequent PLAY resumes from the paused position (for recorded streams) or the current live point. |
TEARDOWN | Client → Server | End the session and free all server resources. The server stops sending RTP packets and closes the session. |
Example: Full RTSP Session Exchange
Below is an annotated example of a complete RTSP protocol session with a typical IP camera:
RTSP Protocol Ports
| Protocol | Default Port | Transport | Notes |
|---|---|---|---|
| RTSP | 554 | TCP | Standard RTSP control port. Used by most IP cameras. |
| RTSP (alt) | 8554 | TCP | Common alternative used by budget cameras and DVR/NVR systems. |
| RTSPS | 322 | TCP (TLS) | Encrypted RTSP over TLS. Rarely used by IP cameras. |
| RTP (video) | 5004 | UDP | Negotiated per-session during SETUP. Actual video/audio data. |
| RTCP | 5005 | UDP | One port above the RTP port. Quality feedback and statistics. |
The RTP and RTCP ports (5004/5005 above) are just defaults — the client proposes a port pair in the SETUP request, and the server confirms or substitutes its own. Each RTP stream in a multi-track session gets its own port pair.
RTSP URL Format
An RTSP URL follows this structure:
| Component | Example | Notes |
|---|---|---|
| Scheme | rtsp:// | rtsps:// for TLS-encrypted, rtspt:// for TCP-forced |
| Credentials | admin:password@ | Optional. Digest or Basic auth. |
| Host | 192.168.1.100 | Camera IP or hostname |
| Port | :554 | Default 554 is often omitted |
| Path | /h264/ch1/main/av_stream | Manufacturer-specific. See camera manual. |
| Query | ?channel=1&subtype=0 | Some cameras accept parameters for stream selection |
rtspt:// — RTSP over TCP (Forced TCP Mode)
The rtspt:// URL scheme forces the media transport to use TCP instead of UDP. Standard rtsp:// negotiates UDP by default (via SETUP's Transport: RTP/AVP/UDP). The rtspt:// scheme instructs the client to use Transport: RTP/AVP/TCP from the start.
| Scheme | Transport | Use when |
|---|---|---|
| rtsp:// | UDP (default) | Camera and viewer on same LAN — lowest latency |
| rtspt:// | TCP (forced) | Firewalls block UDP; NAT traversal needed; VPN tunnels |
| rtsps:// | TCP + TLS | Encrypted stream required (port 322) |
When to use rtspt:// — Switch from rtsp:// to rtspt:// when: your stream connects but shows no video (UDP packets are being dropped); you're streaming over a VPN or WAN; or a firewall is blocking ephemeral UDP ports. SmartRTSP supports rtspt:// — simply replace the scheme in the URL field.
SDP: Session Description Protocol
When a DESCRIBE request is sent, the camera responds with an SDP document (Session Description Protocol, RFC 4566). SDP describes the available media tracks, codec parameters, and connection info. The client uses this to send a properly configured SETUP request.
Key SDP fields in a camera DESCRIBE response:
| Field | Meaning |
|---|---|
m=video … RTP/AVP 96 | Media type (video), port, profile, payload type 96 |
a=rtpmap:96 H264/90000 | Payload 96 is H.264, clock rate 90 kHz |
a=fmtp:96 profile-level-id=… | H.264 profile and level constraints; SPS/PPS in base64 |
a=control:track1 | Track URL suffix used in the SETUP request |
RTSP 1.0 vs RTSP 2.0
RTSP 1.0 (RFC 2326, 1998) is the version implemented by virtually all IP cameras. Despite being from 1998, it remains the dominant version in the security camera industry.
RTSP 2.0 (RFC 7826, 2016) is the updated specification with improved error handling, pipelining, better seek support, and more consistent state machine definitions. However, adoption by IP camera manufacturers has been slow — most cameras on the market today still implement RTSP 1.0.
SmartRTSP supports both RTSP 1.0 and RTSP 2.0. For IP cameras and NVRs, RTSP 1.0 compatibility is what matters — virtually all devices use it.
RTSP Protocol Security
By default, RTSP transmits data in plaintext — credentials included. This is generally acceptable on a private local network (LAN), where the traffic does not leave your home or office network.
RTSPS wraps RTSP over TLS (like HTTPS for HTTP), providing encryption and certificate-based authentication. Port 322 is assigned for RTSPS, though most implementations use 443 or custom ports.
For cameras on your local home or office network, plain RTSP is acceptable. Traffic never leaves your network.
For remote access to cameras, use a VPN (WireGuard, Tailscale) rather than exposing RTSP port 554 to the internet. Never port-forward RTSP to the public internet.
RTSP Protocol FAQ
Does RTSP use TCP or UDP?
RTSP control messages use TCP (port 554). The actual media data (RTP) normally flows over UDP for low latency. However, in NAT or firewall environments, the RTP stream can be tunneled inside the RTSP TCP connection — called "RTSP interleaved" or "RTP over TCP" — at a slight latency cost. SmartRTSP supports both UDP and TCP transport automatically.
What video codecs does RTSP support?
RTSP itself is codec-agnostic — it is the SDP negotiation and RTP payload types that define the codec. IP cameras most commonly use H.264 (AVC) and H.265 (HEVC). Older cameras may use MJPEG or MPEG-4. Audio, if present, is typically G.711 or AAC.
Why does RTSP fail through NAT/firewalls?
RTSP's SETUP message embeds the client's internal IP and UDP port numbers in the Transport header. Behind NAT, these are private addresses unreachable from the camera side. The fix is to use RTP over TCP (interleaved mode), which tunnels all data inside the established TCP connection. SmartRTSP falls back to TCP automatically when UDP fails.
How is RTSP different from HLS or DASH?
HLS and DASH are HTTP-based adaptive streaming protocols designed for broadcast over the internet. They introduce significant latency (5–30 seconds) due to segment buffering. RTSP is a low-latency protocol for real-time control, delivering live streams with sub-second latency — essential for security camera monitoring. RTSP cameras stay on LANs; HLS/DASH is for CDN delivery.
View RTSP Streams on iPhone & Mac
SmartRTSP is a free RTSP viewer for iOS and macOS. Supports RTSP 1.0/2.0, H.264/H.265, ONVIF auto-discovery, and multi-camera grid view — no subscription needed.
Download SmartRTSP Free