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
Base URL of the stream. Populated when the session is received from a server; read-only.
string
Optional human-readable title of the stream. Maps to the SDP
s= field.bool
When
true, the SDP connection address is set to a multicast address (224.1.0.0).*mikey.Message
Optional MIKEY key-management attribute (
a=key-mgmt). Used for SRTP streams.[]SessionFECGroup
Forward Error Correction groups as defined in RFC 5109. Each group is a slice of media IDs.
[]*Media
required
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
MediaType
required
The type of this media stream:
MediaTypeVideo, MediaTypeAudio, or MediaTypeApplication.string
Optional media identifier (
a=mid). Must be alphanumeric. Used when multiple media sections
are bundled (RFC 5888).bool
When
true, the media is a back channel (e.g., two-way audio on an IP camera). Serialized
as a=sendonly in SDP.headers.TransportProfile
The RTP profile:
TransportProfileAVP (default) or TransportProfileSAVP (for SRTP).*mikey.Message
Optional per-media MIKEY key-management attribute.
string
The
a=control attribute value. Used to build the per-media RTSP URL for SETUP requests.[]format.Format
required
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.
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.