Back to Mediamtx

RTSP clients

docs/3-publish/05-rtsp-clients.md

1.18.11.8 KB
Original Source

RTSP clients

supported codecs
videoAV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), MPEG-1/2 Video, MJPEG
audioOpus, MPEG-4 Audio (AAC), MPEG-1/2 Audio (MP3), AC-3, G726, G722, G711 (PCMA, PCMU), LPCM
otherKLV, MPEG-TS, any RTP-compatible codec

RTSP is a protocol that allows to publish and read streams. It supports several underlying transport protocols and encryption. In order to publish a stream to the server with the RTSP protocol, use this URL:

rtsp://localhost:8554/mystream

The resulting stream will be available on path /mystream.

Some clients that can publish with RTSP are FFmpeg, GStreamer, OBS Studio, Python and OpenCV.

Advanced RTSP features and settings are described in RTSP-specific features.

MPEG-TS inside RTSP

Some RTSP clients encode tracks with MPEG-TS before sending them to the server, causing the server to see a single "MPEG-TS" track, and preventing track conversion from a protocol to another.

It's possible to automatically demux these MPEG-TS-encoded streams, by toggling rtspDemuxMpegts:

yml
pathDefaults:
  # Demux MPEG-TS over RTSP into elementary streams.
  # When enabled, RTSP publishers sending MP2T/90000 will be demultiplexed
  # and their elementary streams (H.264, H.265, AAC, etc.) exposed as native tracks.
  # This allows HLS, WebRTC, and other outputs to work transparently with MPEG-TS sources.
  rtspDemuxMpegts: true