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.
Basic Information
Section titled “Basic Information”| Property | Value |
|---|---|
| Default Port | 8554 |
| Transport Layer | TCP (signaling) + TCP/UDP (media) |
| Publish | ✅ Supported |
| Subscribe | ✅ Supported |
| Latency | 0.5-2 seconds |
| Feature Flag | rtsp |
Configuration
Section titled “Configuration”Feature Activation
Section titled “Feature Activation”[features]rtsp = ["dep:plugin-rtsp"]Configuration File
Section titled “Configuration File”rtsp: enable: true tcp: listen_addr: ":8554" udp_port_min: 10000 udp_port_max: 20000| Option | Type | Default | Description |
|---|---|---|---|
enable | bool | true | Whether to enable the RTSP plugin |
tcp.listen_addr | string | ":8554" | RTSP service listen address |
udp_port_min | u16 | 10000 | RTP over UDP port range start |
udp_port_max | u16 | 20000 | RTP over UDP port range end |
Transport Modes
Section titled “Transport Modes”RTP over TCP (Interleaved)
Section titled “RTP over TCP (Interleaved)”Multiplexes RTP data over the RTSP TCP connection, suitable for environments where firewalls restrict UDP.
# FFmpeg force TCP transportffplay -rtsp_transport tcp rtsp://localhost:8554/live/testRTP over UDP
Section titled “RTP over UDP”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).
# FFmpeg using UDP transport (default)ffplay -rtsp_transport udp rtsp://localhost:8554/live/testPublishing
Section titled “Publishing”Publishing with FFmpeg
Section titled “Publishing with FFmpeg”# 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 publishffmpeg -f v4l2 -i /dev/video0 \ -c:v libx264 -preset ultrafast -tune zerolatency \ -f rtsp rtsp://localhost:8554/live/cameraCamera Integration
Section titled “Camera Integration”Most IP cameras support RTSP output. Use Monibuca as an RTSP client to pull streams from cameras:
# Typical camera RTSP URL formats# Hikvisionrtsp://admin:password@192.168.1.100:554/Streaming/Channels/101
# Dahuartsp://admin:password@192.168.1.100:554/cam/realmonitor?channel=1&subtype=0Subscribing
Section titled “Subscribing”Subscribing with FFplay
Section titled “Subscribing with FFplay”# TCP mode subscribeffplay -rtsp_transport tcp rtsp://localhost:8554/live/test
# UDP mode subscribeffplay rtsp://localhost:8554/live/testSubscribing with VLC
Section titled “Subscribing with VLC”- Open VLC, select Media → Open Network Stream
- Enter URL:
rtsp://localhost:8554/live/test - Click Play
Stream Path Format
Section titled “Stream Path Format”RTSP URL format: rtsp://host:port/{app}/{stream}
For example, rtsp://localhost:8554/live/test corresponds to stream path live/test.
Cross-Protocol Forwarding
Section titled “Cross-Protocol Forwarding”Streams published via RTSP can be played back through other protocols:
# RTSP publishffmpeg -re -i input.mp4 -c copy -f rtsp rtsp://localhost:8554/live/test
# Play via HTTP-FLVffplay http://localhost:8080/flv/live/test.flv
# Play via HLSffplay http://localhost:8080/hls/live/test/index.m3u8
# Play via RTMPffplay rtmp://localhost:1935/live/testInsufficient UDP Ports
Section titled “Insufficient UDP Ports”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: 60000NAT Traversal Issues
Section titled “NAT Traversal Issues”In NAT environments, it is recommended to use TCP transport mode to avoid UDP port mapping issues.