Skip to content

RTSP Protocol

RTSP (Real Time Streaming Protocol) is the most commonly used protocol in the security surveillance domain. Monibuca V6 supports RTSP publishing and subscribing, with compatibility for both RTP over TCP (Interleaved) and RTP over UDP transport modes.

PropertyValue
Default Port8554
Transport LayerTCP (signaling) + TCP/UDP (media)
Publish✅ Supported
Subscribe✅ Supported
Latency0.5-2 seconds
Feature Flagrtsp
Cargo.toml
[features]
rtsp = ["dep:plugin-rtsp"]
rtsp:
enable: true
tcp:
listen_addr: ":8554"
udp_port_min: 10000
udp_port_max: 20000
OptionTypeDefaultDescription
enablebooltrueWhether to enable the RTSP plugin
tcp.listen_addrstring":8554"RTSP service listen address
udp_port_minu1610000RTP over UDP port range start
udp_port_maxu1620000RTP over UDP port range end

Multiplexes RTP data over the RTSP TCP connection, suitable for environments where firewalls restrict UDP.

Terminal window
# FFmpeg force TCP transport
ffplay -rtsp_transport tcp rtsp://localhost:8554/live/test

Uses separate UDP port pairs for RTP data transport, offering lower latency. The server automatically allocates available ports from the configured port range (default 10000-20000).

Terminal window
# FFmpeg using UDP transport (default)
ffplay -rtsp_transport udp rtsp://localhost:8554/live/test
Terminal window
# RTSP publish (TCP transport)
ffmpeg -re -i input.mp4 -c copy -rtsp_transport tcp -f rtsp rtsp://localhost:8554/live/test
# RTSP publish (UDP transport)
ffmpeg -re -i input.mp4 -c copy -f rtsp rtsp://localhost:8554/live/test
# Camera capture and publish
ffmpeg -f v4l2 -i /dev/video0 \
-c:v libx264 -preset ultrafast -tune zerolatency \
-f rtsp rtsp://localhost:8554/live/camera

Most IP cameras support RTSP output. Use Monibuca as an RTSP client to pull streams from cameras:

Terminal window
# Typical camera RTSP URL formats
# Hikvision
rtsp://admin:password@192.168.1.100:554/Streaming/Channels/101
# Dahua
rtsp://admin:password@192.168.1.100:554/cam/realmonitor?channel=1&subtype=0
Terminal window
# TCP mode subscribe
ffplay -rtsp_transport tcp rtsp://localhost:8554/live/test
# UDP mode subscribe
ffplay rtsp://localhost:8554/live/test
  1. Open VLC, select MediaOpen Network Stream
  2. Enter URL: rtsp://localhost:8554/live/test
  3. Click Play

RTSP URL format: rtsp://host:port/{app}/{stream}

For example, rtsp://localhost:8554/live/test corresponds to stream path live/test.

Streams published via RTSP can be played back through other protocols:

Terminal window
# RTSP publish
ffmpeg -re -i input.mp4 -c copy -f rtsp rtsp://localhost:8554/live/test
# Play via HTTP-FLV
ffplay http://localhost:8080/flv/live/test.flv
# Play via HLS
ffplay http://localhost:8080/hls/live/test/index.m3u8
# Play via RTMP
ffplay rtmp://localhost:1935/live/test

When connecting a large number of cameras simultaneously, you may need to expand the UDP port range:

rtsp:
udp_port_min: 10000
udp_port_max: 60000

In NAT environments, it is recommended to use TCP transport mode to avoid UDP port mapping issues.