rtsp

package
v1.21.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package rtsp provides RTSP utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Credentials added in v1.12.3

func Credentials(rt *base.Request) *auth.Credentials

Credentials extracts credentials from a RTSP request.

func FindSingleMPEGTSFormat added in v1.21.0

func FindSingleMPEGTSFormat(desc *description.Session) (*description.Media, *format.MPEGTS)

FindSingleMPEGTSFormat returns the single MPEG-TS format in a description, if present.

func RequestForLog added in v1.21.0

func RequestForLog(req *base.Request) string

RequestForLog returns a string representation of a request fit for logging. Credentials are redacted.

func ToStream

func ToStream(
	source rtspSource,
	medias []*description.Media,
	pathConf *conf.Path,
	subStream **stream.SubStream,
	log logger.Writer,
)

ToStream maps a RTSP stream to a MediaMTX stream.

Types

type MPEGTSDemuxer added in v1.21.0

type MPEGTSDemuxer struct {
	Source       MPEGTSDemuxerSource
	Log          logger.Writer
	Media        *description.Media
	Format       *format.MPEGTS
	DecodeErrors *errordumper.Dumper
	OnTracks     MPEGTSDemuxerOnTracksFunc
	OnError      func(error)
	// contains filtered or unexported fields
}

MPEGTSDemuxer demuxes an MPEG-TS stream received via RTP into component streams.

func (*MPEGTSDemuxer) Close added in v1.21.0

func (d *MPEGTSDemuxer) Close()

Close closes the demuxer.

func (*MPEGTSDemuxer) Initialize added in v1.21.0

func (d *MPEGTSDemuxer) Initialize() error

Initialize initializes the demuxer.

func (*MPEGTSDemuxer) Wait added in v1.21.0

func (d *MPEGTSDemuxer) Wait(ctx context.Context) error

Wait waits until the demuxer exits.

type MPEGTSDemuxerOnTracksFunc added in v1.21.0

type MPEGTSDemuxerOnTracksFunc func(*description.Session) (*stream.SubStream, error)

MPEGTSDemuxerOnTracksFunc is called when MPEG-TS tracks have been detected.

type MPEGTSDemuxerSource added in v1.21.0

type MPEGTSDemuxerSource interface {
	OnPacketRTP(*description.Media, format.Format, gortsplib.OnPacketRTPFunc)
}

MPEGTSDemuxerSource is a source that provides MPEG-TS RTP packets.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址