RTSP Server URL Parameters

Dynamically control your RTSP stream's video, audio, and transport settings at runtime using URL parameters.

Dynamic Stream Configuration

Our RTSP server supports URL parameters, allowing you to dynamically configure the stream output without changing the server's configuration file.

This is ideal for scenarios where different clients need different stream profiles (e.g., high-res for desktop, low-res for mobile).

Client A (Desktop): High Quality →
rtsp://server/stream?ve=h264&w=1920&h=1080&vb=4000

Client B (Mobile): Low Bandwidth →
rtsp://server/stream?ve=h264&w=640&h=480&vb=800

Parameter Priority

URL parameters have the highest priority. If a parameter is specified in the URL, it overrides any value set in the server's configuration file.

This enables true runtime control and per-client customization.

Supported Parameters

Parameters are appended to the RTSP URL after a ?, separated by &.

Format: rtsp://[serverip]:[serverport]/[path]?param1=value1&param2=value2

Video Parameters

Parameter Description Values
ve Video Encoding H264, H265, JPEG, MP4
w Video Width (pixels) e.g., 1920, 1280, 640
h Video Height (pixels) e.g., 1080, 720, 480
fps Frame Rate (frames per second) e.g., 30, 25, 15
vb Video Bitrate (kbps) e.g., 4000, 2000, 800

Audio Parameters

Parameter Description Values
ae Audio Encoding PCMU, PCMA, G726, G722, OPUS, AAC
sr Sample Rate (Hz) e.g., 44100, 48000, 8000
ch Number of Channels 1 (Mono), 2 (Stereo)
ab Audio Bitrate (kbps) e.g., 128, 64, 32

Transport Parameters

Parameter Description Values
p Transport Protocol udp, tcp
t Transmission Method unicast, multicast
srtp Enable SRTP Encryption 0 (disable), 1 (enable)

Comprehensive Example

Request a high-quality H.264 stream with AAC audio over TCP:

RTSP URL Example
rtsp://192.168.1.100:554/test.mp4?t=unicast&p=tcp&ve=h264&w=1920&h=1080&fps=30&vb=4000&ae=aac&sr=44100&ch=2

This URL requests a 1080p30 H.264 video at 4000 kbps and stereo AAC audio at 44.1kHz, transmitted via unicast RTP over TCP.

Best Practices

  • Client-Side Control: Use URL parameters to let clients request their optimal stream profile.
  • Bandwidth Adaptation: Offer multiple URLs with different w, h, and vb for adaptive streaming.
  • Firewall Friendly: Use p=tcp to traverse firewalls that block UDP.
  • Security: Combine srtp=1 with secure authentication for encrypted streams.
  • Testing: Use URL parameters to quickly test different configurations without restarting the server.