gortsplib
RTSP client and server library for the Go programming language, written for MediaMTX.
Go ≥ 1.26 is required.
Features:
- Client
- Server
- Utilities
Table of contents
Examples
- client-query
- client-play
- client-play-timestamp
- client-play-options
- client-play-pause
- client-play-backchannel
- client-play-format-av1
- client-play-format-av1-to-jpeg
- client-play-format-g711
- client-play-format-h264
- client-play-format-h264-to-jpeg
- client-play-format-h264-to-disk
- client-play-format-h264-mpeg4audio-to-disk
- client-play-format-h265
- client-play-format-h265-to-jpeg
- client-play-format-h265-to-disk
- client-play-format-lpcm
- client-play-format-mjpeg
- client-play-format-mpeg4audio
- client-play-format-mpeg4audio-to-disk
- client-play-format-opus
- client-play-format-opus-to-disk
- client-play-format-vp8
- client-play-format-vp9
- client-record-options
- client-record-pause
- client-record-format-av1
- client-record-format-g711
- client-record-format-h264
- client-record-format-h264-from-disk
- client-record-format-h265
- client-record-format-lpcm
- client-record-format-mjpeg
- client-record-format-mpeg4audio
- client-record-format-opus
- client-record-format-vp8
- client-record-format-vp9
- client-record-format-klv
- client-republish
- server
- server-secure
- server-auth
- server-record-format-h264-to-disk
- server-play-format-h264-from-disk
- server-play-backchannel
- proxy
- proxy-backchannel
API Documentation
Click to open the API Documentation
RTP Payload Formats
In RTSP, media streams are transmitted by using RTP packets, which are encoded in a specific, codec-dependent, format. This library supports the following formats:
Video
| format | documentation | encoder and decoder available | | ------------------------- | ----------------------------------------------------------------------------------- | ----------------------------- | | AV1 | link | :heavy_check_mark: | | VP9 | link | :heavy_check_mark: | | VP8 | link | :heavy_check_mark: | | H265 | link | :heavy_check_mark: | | H264 | link | :heavy_check_mark: | | MPEG-4 Video (H263, Xvid) | link | :heavy_check_mark: | | MPEG-1/2 Video | link | :heavy_check_mark: | | M-JPEG | link | :heavy_check_mark: |
Audio
| format | documentation | encoder and decoder available | | ---------------------------- | --------------------------------------------------------------------------------------- | ----------------------------- | | Opus | link | :heavy_check_mark: | | Vorbis | link | | | MPEG-4 Audio (AAC) | link | :heavy_check_mark: | | MPEG-4 Audio LATM (AAC-LATM) | link | :heavy_check_mark: | | MPEG-1/2 Audio (MP3) | link | :heavy_check_mark: | | AC-3 | link | :heavy_check_mark: | | Speex | link | | | G726 | link | | | G722 | link | :heavy_check_mark: | | G711 (PCMA, PCMU) | link | :heavy_check_mark: | | LPCM | link | :heavy_check_mark: |
Other
| format | documentation | encoder and decoder available | | ------- | ------------------------------------------------------------------------------- | ----------------------------- | | MPEG-TS | link | :heavy_check_mark: | | KLV | link | :heavy_check_mark: |
Specifications
| name | area | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------- | | RFC2326, RTSP 1.0 | protocol | | RFC7826, RTSP 2.0 | protocol | | ONVIF Streaming Specification 23.06 | protocol | | RFC8866, SDP: Session Description Protocol | SDP | | RFC4567, Key Management Extensions for Session Description Protocol (SDP) and Real Time Streaming Protocol (RTSP) | secure variants | | RFC3830, MIKEY: Multimedia Internet KEYing | secure variants | | RFC4568, SDP Security Descriptions for Media Streams | secure variants | | RFC2069, An Extension to HTTP : Digest Access Authentication | digest authentication | | RFC7616, HTTP Digest Access Authentication | digest authentication | | RTP Payload Format For AV1 (v1.0) | payload formats / AV1 | | RFC9628, RTP Payload Format for VP9 Video | payload formats / VP9 | | RFC7741, RTP Payload Format for VP8 Video | payload formats / VP8 | | RFC7798, RTP Payload Format for High Efficiency Video Coding (HEVC) | payload formats / H265 | | RFC6184, RTP Payload Format for H.264 Video | payload formats / H264 | | RFC3640, RTP Payload Format for Transport of MPEG-4 Elementary Streams | payload formats / MPEG-4 audio, MPEG-4 video | | RFC2250, RTP Payload Format for MPEG1/MPEG2 Video | payload formats / MPEG-1/2 video, MPEG-1/2 audio, MPEG-TS | | RFC2435, RTP Payload Format for JPEG-compressed Video | payload formats / M-JPEG | | RFC7587, RTP Payload Format for the Opus Speech and Audio Codec | payload formats / Opus | | Multiopus in libwebrtc | payload formats / Opus | | RFC5215, RTP Payload Format for Vorbis Encoded Audio | payload formats / Vorbis | | RFC4184, RTP Payload Format for AC-3 Audio | payload formats / AC-3 | | RFC6416, RTP Payload Format for MPEG-4 Audio/Visual Streams | payload formats / MPEG-4 audio LATM | | RFC5574, RTP Payload Format for the Speex Codec | payload formats / Speex | | RFC3551, RTP Profile for Audio and Video Conferences with Minimal Control | payload formats / G726, G722, G711, LPCM | | RFC3190, RTP Payload Format for 12-bit DAT Audio and 20- and 24-bit Linear Sampled Audio | payload formats / LPCM | | RFC6597, RTP Payload Format for Society of Motion Picture and Television Engineers (SMPTE) ST 336 Encoded Data | payload formats / KLV | | Codec specifications | codecs | | Golang project layout | project layout |