Import path:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/bluenviron/gortsplib/llms.txt
Use this file to discover all available pages before exploring further.
github.com/bluenviron/gortsplib/v5/pkg/description
Session
ASession is the top-level description of an RTSP stream. It maps directly to an SDP session description and holds one or more Media entries.
Fields
Base URL of the stream. Populated when the session is received from a server; read-only.
Optional human-readable title of the stream. Maps to the SDP
s= field.When
true, the SDP connection address is set to a multicast address (224.1.0.0).Optional MIKEY key-management attribute (
a=key-mgmt). Used for SRTP streams.Forward Error Correction groups as defined in RFC 5109. Each group is a slice of media IDs.
The list of media streams in this session. At least one entry is required for a valid SDP.
Methods
FindFormat
forma (a pointer to the target format variable) and returns the owning *Media. Returns nil if no matching format is found.
Marshal
Unmarshal
Media
AMedia represents a single media stream (e.g., one video track or one audio track) within a session.
Fields
The type of this media stream:
MediaTypeVideo, MediaTypeAudio, or MediaTypeApplication.Optional media identifier (
a=mid). Must be alphanumeric. Used when multiple media sections
are bundled (RFC 5888).When
true, the media is a back channel (e.g., two-way audio on an IP camera). Serialized
as a=sendonly in SDP.The RTP profile:
TransportProfileAVP (default) or TransportProfileSAVP (for SRTP).Optional per-media MIKEY key-management attribute.
The
a=control attribute value. Used to build the per-media RTSP URL for SETUP requests.The RTP payload formats carried by this media stream. At least one format is required.
Methods
FindFormat
Formats slice for a format whose concrete type matches the element
type of forma. On success, sets *forma and returns true.
URL
contentBase (the
Content-Base header from the server). Returns an error when contentBase is nil.
Marshal
MediaDescription.
Unmarshal
MediaDescription.
MediaType
MediaType is a string type used to classify a media stream.
| Constant | Value | Description |
|---|---|---|
MediaTypeVideo | "video" | Video stream |
MediaTypeAudio | "audio" | Audio stream |
MediaTypeApplication | "application" | Application data stream (e.g., metadata, KLV) |
SessionFECGroup
SessionFECGroup is a slice of media IDs that form a Forward Error Correction group
(RFC 5109). Groups are serialized as a=group:FEC <id1> <id2> ... in SDP.