RTSP 1.0 client and server library for the Go programming language, written for MediaMTX.
Go ≥ 1.18 is required.
Features:
- Client
- Query servers about available media streams
- Read
- Read media streams from servers with the UDP, UDP-multicast or TCP transport protocol
- Read TLS-encrypted streams (TCP only)
- Switch transport protocol automatically
- Read only selected media streams
- Pause or seek without disconnecting from the server
- Generate RTCP receiver reports (UDP only)
- Reorder incoming RTP packets (UDP only)
- Publish
- Publish media streams to servers with the UDP or TCP transport protocol
- Publish TLS-encrypted streams (TCP only)
- Switch transport protocol automatically
- Pause without disconnecting from the server
- Generate RTCP sender reports
- Server
- Handle requests from clients
- Sessions and connections are independent
- Publish
- Read media streams from clients with the UDP or TCP transport protocol
- Read TLS-encrypted streams (TCP only)
- Generate RTCP receiver reports (UDP only)
- Reorder incoming RTP packets (UDP only)
- Read
- Write media streams to clients with the UDP, UDP-multicast or TCP transport protocol
- Write TLS-encrypted streams
- Compute and provide SSRC, RTP-Info to clients
- Generate RTCP sender reports
- Utilities
- Parse RTSP elements
- Encode/decode format-specific frames into/from RTP packets
- client-query
- client-read
- client-read-options
- client-read-pause
- client-read-republish
- client-read-format-g711
- client-read-format-g722
- client-read-format-h264
- client-read-format-h264-convert-to-jpeg
- client-read-format-h264-save-to-disk
- client-read-format-h265
- client-read-format-lpcm
- client-read-format-mjpeg
- client-read-format-mpeg4audio
- client-read-format-mpeg4audio-save-to-disk
- client-read-format-opus
- client-read-format-vp8
- client-read-format-vp9
- client-publish-options
- client-publish-pause
- client-publish-format-g711
- client-publish-format-g722
- client-publish-format-h264
- client-publish-format-h265
- client-publish-format-lpcm
- client-publish-format-mjpeg
- client-publish-format-mpeg4audio
- client-publish-format-opus
- client-publish-format-vp8
- client-publish-format-vp9
- server
- server-tls
- server-h264-save-to-disk
- proxy
https://pkg.go.dev/github.com/bluenviron/gortsplib/v3#pkg-index
In RTSP, media streams are routed between server and clients by using RTP packets. In order to decode a stream, RTP packets must be converted into codec-specific frames. This conversion happens by following a RTP payload format. This library provides encoders and decoders for the following formats:
codec | format | documentation |
---|---|---|
AV1 | AV1 | link |
VP9 | VP9 | link |
VP8 | VP8 | link |
H265 | H265 | link |
H264 | H264 | link |
MPEG-4 Video (H263, Xvid) | MP4V-ES | link |
M-JPEG | JPEG | link |
codec | format | documentation |
---|---|---|
Opus | Opus | link |
MPEG-4 Audio (AAC) | mpeg4-generic | link |
MPEG-4 Audio (AAC) | MP4A-LATM | link |
MPEG-1/2 Audio (MP3) | mpeg2-audio | link |
G722 | G722 | link |
G711 (PCMA, PCMU) | G711 | link |
LPCM | LPCM | link |
- RFC2326, RTSP 1.0
- RFC7826, RTSP 2.0
- RFC8866, SDP: Session Description Protocol
- RFC3551, RTP Profile for Audio and Video Conferences with Minimal Control
- RFC2250, RTP Payload Format for MPEG1/MPEG2 Video
- RFC2435, RTP Payload Format for JPEG-compressed Video
- RFC6416, RTP Payload Format for MPEG-4 Audio/Visual Streams
- RFC6184, RTP Payload Format for H.264 Video
- RFC7798, RTP Payload Format for High Efficiency Video Coding (HEVC)
- RFC7741, RTP Payload Format for VP8 Video
- RTP Payload Format for VP9 Video
- RFC3190, RTP Payload Format for 12-bit DAT Audio and 20- and 24-bit Linear Sampled Audio
- RFC5215, RTP Payload Format for Vorbis Encoded Audio
- RFC7587, RTP Payload Format for the Opus Speech and Audio Codec
- RFC3640, RTP Payload Format for Transport of MPEG-4 Elementary Streams
- RTP Payload Format For AV1 (v1.0)
- Codec standards
- Golang project layout
Related projects