RTSP 1.0 client and server library for the Go programming language, written for rtsp-simple-server.
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. The following formats are supported:
- Video: H264, H265, M-JPEG, VP8, VP9
- Audio: G711 (PCMA, PCMU), G722, LPCM, MPEG4 Audio (AAC), Opus
- 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-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
- RTSP 1.0 https://www.rfc-editor.org/rfc/rfc2326
- RTSP 2.0 https://www.rfc-editor.org/rfc/rfc7826
- RTP Profile for Audio and Video Conferences with Minimal Control https://www.rfc-editor.org/rfc/rfc3551
- RTP Payload Format for MPEG1/MPEG2 Video https://www.rfc-editor.org/rfc/rfc2250
- RTP Payload Format for JPEG-compressed Video https://www.rfc-editor.org/rfc/rfc2435
- RTP Payload Format for H.264 Video https://www.rfc-editor.org/rfc/rfc6184
- RTP Payload Format for High Efficiency Video Coding (HEVC) https://www.rfc-editor.org/rfc/rfc7798.html
- RTP Payload Format for VP8 Video https://www.rfc-editor.org/rfc/rfc7741.html
- RTP Payload Format for VP9 Video https://datatracker.ietf.org/doc/html/draft-ietf-payload-vp9-16
- RTP Payload Format for 12-bit DAT Audio and 20- and 24-bit Linear Sampled Audio https://www.rfc-editor.org/rfc/rfc3190.html
- RTP Payload Format for the Opus Speech and Audio Codec https://www.rfc-editor.org/rfc/rfc7587.html
- RTP Payload Format for MPEG-4 Audio/Visual Streams https://www.rfc-editor.org/rfc/rfc6416
- RTP Payload Format for Transport of MPEG-4 Elementary Streams https://www.rfc-editor.org/rfc/rfc3640.html
- ITU-T Rec. H.264 (08/2021) https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-H.264-202108-I!!PDF-E&type=items
- ITU-T Rec. H.265 (08/2021) https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-H.265-202108-I!!PDF-E&type=items
- ISO 14496-3, Coding of audio-visual objects, part 3, Audio
- Golang project layout https://github.com/golang-standards/project-layout
Related projects
- rtsp-simple-server https://github.com/aler9/rtsp-simple-server
- pion/sdp (SDP library used internally) https://github.com/pion/sdp
- pion/rtp (RTP library used internally) https://github.com/pion/rtp
- pion/rtcp (RTCP library used internally) https://github.com/pion/rtcp