modulepackage
0.0.0-20230607064056-7860b573d9b7
Repository: https://github.com/aliveyun/gortsplib.git
Documentation: pkg.go.dev
# README
gortsplib
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. The following formats are supported:
- Video: AV1, VP9, VP8, H265, H264, MPEG-4 Video (H263, Xvid), M-JPEG
- Audio: Opus, MPEG-4 Audio (AAC), MPEG-2 Audio (MP3), G722, G711 (PCMA, PCMU), LPCM
Table of contents
Examples
- 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
API Documentation
https://pkg.go.dev/github.com/aliveyun/gortsplib#pkg-index
Standards
- 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
Links
Related projects
# Constants
Log levels.
Log levels.
Log levels.
Log levels.
states.
states.
states.
states.
states.
transport protocols.
transport protocols.
transport protocols.
# Structs
Client is a RTSP client.
Packet stores compressed audio/video data.
No description provided by the author
No description provided by the author
Server is a RTSP server.
ServerConn is a server-side RTSP connection.
ServerHandlerOnAnnounceCtx is the context of OnAnnounce.
ServerHandlerOnConnCloseCtx is the context of OnConnClose.
ServerHandlerOnConnOpenCtx is the context of OnConnOpen.
ServerHandlerOnDecodeErrorCtx is the context of OnDecodeError.
ServerHandlerOnDescribeCtx is the context of OnDescribe.
ServerHandlerOnGetParameterCtx is the context of OnGetParameter.
ServerHandlerOnPacketLostCtx is the context of OnPacketLost.
ServerHandlerOnPauseCtx is the context of OnPause.
ServerHandlerOnPlayCtx is the context of OnPlay.
ServerHandlerOnRecordCtx is the context of OnRecord.
ServerHandlerOnSessionCloseCtx is the context of ServerHandlerOnSessionClose.
ServerHandlerOnSessionOpenCtx is the context OnSessionOpen.
ServerHandlerOnSetParameterCtx is the context of OnSetParameter.
ServerHandlerOnSetupCtx is the context of OnSetup.
ServerHandlerOnWarningCtx is the context of OnWarning.
ServerSession is a server-side RTSP session.
ServerStream represents a data stream.
# Interfaces
No description provided by the author
No description provided by the author
ServerHandler is the interface implemented by all the server handlers.
ServerHandlerOnAnnounce can be implemented by a ServerHandler.
ServerHandlerOnConnClose can be implemented by a ServerHandler.
ServerHandlerOnConnOpen can be implemented by a ServerHandler.
ServerHandlerOnDecodeError can be implemented by a ServerHandler.
ServerHandlerOnDescribe can be implemented by a ServerHandler.
ServerHandlerOnGetParameter can be implemented by a ServerHandler.
ServerHandlerOnPacketLost can be implemented by a ServerHandler.
ServerHandlerOnPause can be implemented by a ServerHandler.
ServerHandlerOnPlay can be implemented by a ServerHandler.
ServerHandlerOnRecord can be implemented by a ServerHandler.
ServerHandlerOnRequest can be implemented by a ServerHandler.
ServerHandlerOnResponse can be implemented by a ServerHandler.
ServerHandlerOnSessionClose can be implemented by a ServerHandler.
ServerHandlerOnSessionOpen can be implemented by a ServerHandler.
ServerHandlerOnSetParameter can be implemented by a ServerHandler.
ServerHandlerOnSetup can be implemented by a ServerHandler.
ServerHandlerOnWarning can be implemented by a ServerHandler.
# Type aliases
ClientLogFunc is the prototype of the log function.
LogLevel is a log level.
ServerSessionState is a state of a ServerSession.
Transport is a RTSP transport protocol.