Skip to content
im-pingo edited this page Mar 26, 2026 · 2 revisions

English | 中文

RTSP

LiveForge provides a full RTSP server supporting both TCP interleaved and UDP transport modes for ingest and playback.

Configuration

rtsp:
  enabled: true
  listen: ":8554"
  rtp_port_range: [10000, 20000]
  # tls: true          # Optional: override global TLS setting
Field Type Default Description
enabled bool true Enable/disable the RTSP module
listen string ":8554" TCP listen address (see note below)
rtp_port_range [int, int] [10000, 20000] UDP port range for RTP media transport
tls *bool nil Per-module TLS override (see Server & TLS)

Note: The code default is :554, but the sample config (configs/liveforge.yaml) sets :8554.

When TLS is enabled, the module serves RTSPS.

Supported Methods

Method Description
OPTIONS Query supported methods
DESCRIBE Retrieve SDP for a stream (subscribe)
ANNOUNCE Provide SDP for a stream (publish)
SETUP Establish transport (TCP interleaved or UDP)
PLAY Begin playback
RECORD Begin publishing
PAUSE Pause playback
TEARDOWN End session
GET_PARAMETER Keep-alive heartbeat

Transport Modes

TCP Interleaved

RTP packets are multiplexed over the same TCP connection as RTSP signaling using $ interleaved framing. This mode is firewall-friendly and does not require additional UDP ports.

UDP

RTP packets are sent over separate UDP ports allocated from the configured rtp_port_range. This mode offers lower overhead but requires the UDP port range to be open.

Publish Examples

FFmpeg

ffmpeg -re -i input.mp4 -c copy -f rtsp rtsp://localhost:8554/live/stream1

FFmpeg with UDP transport

ffmpeg -re -i input.mp4 -c copy -f rtsp -rtsp_transport udp rtsp://localhost:8554/live/stream1

Play Examples

FFplay (TCP)

ffplay -rtsp_transport tcp rtsp://localhost:8554/live/stream1

FFplay (UDP)

ffplay rtsp://localhost:8554/live/stream1

VLC

Open Network Stream: rtsp://localhost:8554/live/stream1

Use Cases

  • IP camera ingest -- receive RTSP streams from security cameras and NVRs
  • Low-latency monitoring -- play RTSP streams directly for real-time viewing
  • Protocol bridging -- publish via RTSP and play via HLS, DASH, WebRTC, or any other protocol

Clone this wiki locally