RTSP 1.0 client and server library for the Go programming language, written for MediaMTX.
Go ≥ 1.19 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 selected media streams only
- Pause or seek without disconnecting from the server
- Get PTS (relative) timestamp of incoming packets
- Get NTP (absolute) timestamp of incoming packets
- 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
- Server
- Handle requests from clients
- Publish
- Read media streams from clients with the UDP or TCP transport protocol
- Read TLS-encrypted streams (TCP only)
- Get PTS (relative) timestamp of incoming packets
- Get NTP (absolute) timestamp of incoming packets
- Read
- Write media streams to clients with the UDP, UDP-multicast or TCP transport protocol
- Write TLS-encrypted streams (TCP only)
- Compute and provide SSRC, RTP-Info to clients
- Utilities
- Parse RTSP elements
- Encode/decode codec-specific frames into/from RTP packets
- client-query
- client-read
- client-read-timestamp
- client-read-options
- client-read-pause
- client-read-republish
- client-read-format-av1
- 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-h265-convert-to-jpeg
- client-read-format-h265-save-to-disk
- 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
Click to open the API Documentation
In RTSP, media streams are routed between server and clients by using RTP packets, which are encoded in a specific, codec-dependent, format, that is declared during the handshake. This library supports the following formats:
format | documentation | encoder and decoder available |
---|---|---|
AV1 | link | ✔️ |
VP9 | link | ✔️ |
VP8 | link | ✔️ |
H265 | link | ✔️ |
H264 | link | ✔️ |
MPEG-4 Video (H263, Xvid) | link | ✔️ |
MPEG-1/2 Video | link | ✔️ |
M-JPEG | link | ✔️ |
format | documentation | encoder and decoder available |
---|---|---|
Opus | link | ✔️ |
Vorbis | link | |
MPEG-4 Audio (AAC) | link | ✔️ |
MPEG-1/2 Audio (MP3) | link | ✔️ |
AC-3 | link | ✔️ |
Speex | link | |
G726 | link | |
G722 | link | ✔️ |
G711 (PCMA, PCMU) | link | ✔️ |
LPCM | link | ✔️ |
format | documentation | encoder and decoder available |
---|---|---|
MPEG-TS | link |