Versions in this module Expand all Collapse all v1 v1.1.2 Feb 2, 2026 Changes in this version + type Client struct + AnyPortEnable bool + DialContext func(ctx context.Context, network, address string) (net.Conn, error) + DisableRTCPSenderReports bool + Host string + InitialUDPReadTimeout time.Duration + ListenPacket func(network, address string) (net.PacketConn, error) + MaxPacketSize int + OnDecodeError ClientOnDecodeErrorFunc + OnPacketsLost ClientOnPacketsLostFunc + OnRequest ClientOnRequestFunc + OnResponse ClientOnResponseFunc + OnServerRequest ClientOnRequestFunc + OnServerResponse ClientOnResponseFunc + OnTransportSwitch ClientOnTransportSwitchFunc + Protocol *Protocol + ReadTimeout time.Duration + RequestBackChannels bool + Scheme string + TLSConfig *tls.Config + Tunnel Tunnel + UDPReadBufferSize int + UDPSourcePortRange [2]uint16 + UserAgent string + WriteQueueSize int + WriteTimeout time.Duration + func (c *Client) Announce(u *base.URL, desc *description.Session) (*base.Response, error) + func (c *Client) Close() + func (c *Client) Describe(u *base.URL) (*description.Session, *base.Response, error) + func (c *Client) OnPacketRTCP(medi *description.Media, cb OnPacketRTCPFunc) + func (c *Client) OnPacketRTCPAny(cb OnPacketRTCPAnyFunc) + func (c *Client) OnPacketRTP(medi *description.Media, forma format.Format, cb OnPacketRTPFunc) + func (c *Client) OnPacketRTPAny(cb OnPacketRTPAnyFunc) + func (c *Client) Options(u *base.URL) (*base.Response, error) + func (c *Client) PacketNTP(medi *description.Media, pkt *rtp.Packet) (time.Time, bool) + func (c *Client) PacketPTS(medi *description.Media, pkt *rtp.Packet) (int64, bool) + func (c *Client) Pause() (*base.Response, error) + func (c *Client) Play(ra *headers.Range) (*base.Response, error) + func (c *Client) Record() (*base.Response, error) + func (c *Client) Setup(baseURL *base.URL, media *description.Media, rtpPort int, rtcpPort int) (*base.Response, error) + func (c *Client) SetupAll(baseURL *base.URL, medias []*description.Media) error + func (c *Client) Start() error + func (c *Client) StartRecording(address string, desc *description.Session) error + func (c *Client) Stats() *ClientStats + func (c *Client) Transport() *ClientTransport + func (c *Client) Wait() error + func (c *Client) WritePacketRTCP(medi *description.Media, pkt rtcp.Packet) error + func (c *Client) WritePacketRTP(medi *description.Media, pkt *rtp.Packet) error + func (c *Client) WritePacketRTPWithNTP(medi *description.Media, pkt *rtp.Packet, ntp time.Time) error + type ClientOnDecodeErrorFunc func(err error) + type ClientOnPacketsLostFunc func(lost uint64) + type ClientOnRequestFunc func(*base.Request) + type ClientOnResponseFunc func(*base.Response) + type ClientOnTransportSwitchFunc func(err error) + type ClientStats struct + Conn ConnStats + Session SessionStats + type ClientTransport struct + Conn ConnTransport + Session *SessionTransport + type ConnStats struct + BytesReceived uint64 + BytesSent uint64 + type ConnTransport struct + Tunnel Tunnel + type OnPacketRTCPAnyFunc func(*description.Media, rtcp.Packet) + type OnPacketRTCPFunc func(rtcp.Packet) + type OnPacketRTPAnyFunc func(*description.Media, format.Format, *rtp.Packet) + type OnPacketRTPFunc func(*rtp.Packet) + type Protocol int + const ProtocolTCP + const ProtocolUDP + const ProtocolUDPMulticast + func (t Protocol) String() string + type Server struct + AuthMethods []auth.VerifyMethod + DisableRTCPSenderReports bool + Handler ServerHandler + IdleTimeout time.Duration + Listen func(network string, address string) (net.Listener, error) + ListenPacket func(network, address string) (net.PacketConn, error) + MaxPacketSize int + MulticastIPRange string + MulticastRTCPPort int + MulticastRTPPort int + RTSPAddress string + ReadTimeout time.Duration + TLSConfig *tls.Config + UDPRTCPAddress string + UDPRTPAddress string + UDPReadBufferSize int + WriteQueueSize int + WriteTimeout time.Duration + func (s *Server) Close() + func (s *Server) NetListener() net.Listener + func (s *Server) Start() error + func (s *Server) StartAndWait() error + func (s *Server) Wait() error + type ServerConn struct + func (sc *ServerConn) Close() + func (sc *ServerConn) NetConn() net.Conn + func (sc *ServerConn) Session() *ServerSession + func (sc *ServerConn) SetUserData(v any) + func (sc *ServerConn) Stats() *ConnStats + func (sc *ServerConn) Transport() *ConnTransport + func (sc *ServerConn) UserData() any + func (sc *ServerConn) VerifyCredentials(req *base.Request, expectedUser string, expectedPass string) bool + type ServerHandler any + type ServerHandlerOnAnnounce interface + OnAnnounce func(*ServerHandlerOnAnnounceCtx) (*base.Response, error) + type ServerHandlerOnAnnounceCtx struct + Conn *ServerConn + Description *description.Session + Path string + Query string + Request *base.Request + Session *ServerSession + type ServerHandlerOnConnClose interface + OnConnClose func(*ServerHandlerOnConnCloseCtx) + type ServerHandlerOnConnCloseCtx struct + Conn *ServerConn + Error error + type ServerHandlerOnConnOpen interface + OnConnOpen func(*ServerHandlerOnConnOpenCtx) + type ServerHandlerOnConnOpenCtx struct + Conn *ServerConn + type ServerHandlerOnDecodeError interface + OnDecodeError func(*ServerHandlerOnDecodeErrorCtx) + type ServerHandlerOnDecodeErrorCtx struct + Error error + Session *ServerSession + type ServerHandlerOnDescribe interface + OnDescribe func(*ServerHandlerOnDescribeCtx) (*base.Response, *ServerStream, error) + type ServerHandlerOnDescribeCtx struct + Conn *ServerConn + Path string + Query string + Request *base.Request + type ServerHandlerOnGetParameter interface + OnGetParameter func(*ServerHandlerOnGetParameterCtx) (*base.Response, error) + type ServerHandlerOnGetParameterCtx struct + Conn *ServerConn + Path string + Query string + Request *base.Request + Session *ServerSession + type ServerHandlerOnPacketsLost interface + OnPacketsLost func(*ServerHandlerOnPacketsLostCtx) + type ServerHandlerOnPacketsLostCtx struct + Lost uint64 + Session *ServerSession + type ServerHandlerOnPause interface + OnPause func(*ServerHandlerOnPauseCtx) (*base.Response, error) + type ServerHandlerOnPauseCtx struct + Conn *ServerConn + Path string + Query string + Request *base.Request + Session *ServerSession + type ServerHandlerOnPlay interface + OnPlay func(*ServerHandlerOnPlayCtx) (*base.Response, error) + type ServerHandlerOnPlayCtx struct + Conn *ServerConn + Path string + Query string + Request *base.Request + Session *ServerSession + type ServerHandlerOnRecord interface + OnRecord func(*ServerHandlerOnRecordCtx) (*base.Response, error) + type ServerHandlerOnRecordCtx struct + Conn *ServerConn + Path string + Query string + Request *base.Request + Session *ServerSession + type ServerHandlerOnRequest interface + OnRequest func(*ServerConn, *base.Request) + type ServerHandlerOnResponse interface + OnResponse func(*ServerConn, *base.Response) + type ServerHandlerOnSessionClose interface + OnSessionClose func(*ServerHandlerOnSessionCloseCtx) + type ServerHandlerOnSessionCloseCtx struct + Error error + Session *ServerSession + type ServerHandlerOnSessionOpen interface + OnSessionOpen func(*ServerHandlerOnSessionOpenCtx) + type ServerHandlerOnSessionOpenCtx struct + Conn *ServerConn + Session *ServerSession + type ServerHandlerOnSetParameter interface + OnSetParameter func(*ServerHandlerOnSetParameterCtx) (*base.Response, error) + type ServerHandlerOnSetParameterCtx struct + Conn *ServerConn + Path string + Query string + Request *base.Request + Session *ServerSession + type ServerHandlerOnSetup interface + OnSetup func(*ServerHandlerOnSetupCtx) (*base.Response, *ServerStream, error) + type ServerHandlerOnSetupCtx struct + Conn *ServerConn + Path string + Query string + Request *base.Request + Session *ServerSession + Transport *SessionTransport + type ServerHandlerOnStreamWriteError interface + OnStreamWriteError func(*ServerHandlerOnStreamWriteErrorCtx) + type ServerHandlerOnStreamWriteErrorCtx struct + Error error + Session *ServerSession + type ServerSession struct + func (ss *ServerSession) AnnouncedDescription() *description.Session + func (ss *ServerSession) Close() + func (ss *ServerSession) Medias() []*description.Media + func (ss *ServerSession) OnPacketRTCP(medi *description.Media, cb OnPacketRTCPFunc) + func (ss *ServerSession) OnPacketRTCPAny(cb OnPacketRTCPAnyFunc) + func (ss *ServerSession) OnPacketRTP(medi *description.Media, forma format.Format, cb OnPacketRTPFunc) + func (ss *ServerSession) OnPacketRTPAny(cb OnPacketRTPAnyFunc) + func (ss *ServerSession) PacketNTP(medi *description.Media, pkt *rtp.Packet) (time.Time, bool) + func (ss *ServerSession) PacketPTS(medi *description.Media, pkt *rtp.Packet) (int64, bool) + func (ss *ServerSession) Path() string + func (ss *ServerSession) Query() string + func (ss *ServerSession) SetUserData(v any) + func (ss *ServerSession) State() ServerSessionState + func (ss *ServerSession) Stats() *SessionStats + func (ss *ServerSession) Stream() *ServerStream + func (ss *ServerSession) Transport() *SessionTransport + func (ss *ServerSession) UserData() any + func (ss *ServerSession) WritePacketRTCP(medi *description.Media, pkt rtcp.Packet) error + func (ss *ServerSession) WritePacketRTP(medi *description.Media, pkt *rtp.Packet) error + type ServerSessionState int + const ServerSessionStateInitial + const ServerSessionStatePlay + const ServerSessionStatePrePlay + const ServerSessionStatePreRecord + const ServerSessionStateRecord + func (s ServerSessionState) String() string + type ServerStream struct + Desc *description.Session + MulticastParams map[*description.Media]StreamMediaMulticastParams + Server *Server + func (st *ServerStream) Close() + func (st *ServerStream) Initialize() error + func (st *ServerStream) Stats() *ServerStreamStats + func (st *ServerStream) WritePacketRTCP(medi *description.Media, pkt rtcp.Packet) error + func (st *ServerStream) WritePacketRTP(medi *description.Media, pkt *rtp.Packet) error + func (st *ServerStream) WritePacketRTPWithNTP(medi *description.Media, pkt *rtp.Packet, ntp time.Time) error + type ServerStreamStats struct + BytesSent uint64 + Medias map[*description.Media]ServerStreamStatsMedia + RTCPPacketsSent uint64 + RTPPacketsSent uint64 + type ServerStreamStatsFormat struct + LocalSSRC uint32 + RTPPacketsSent uint64 + type ServerStreamStatsMedia struct + BytesSent uint64 + Formats map[format.Format]ServerStreamStatsFormat + RTCPPacketsSent uint64 + type SessionStats struct + BytesReceived uint64 + BytesSent uint64 + Medias map[*description.Media]SessionStatsMedia + RTCPPacketsInError uint64 + RTCPPacketsReceived uint64 + RTCPPacketsSent uint64 + RTPPacketsInError uint64 + RTPPacketsJitter float64 + RTPPacketsLost uint64 + RTPPacketsReceived uint64 + RTPPacketsSent uint64 + type SessionStatsFormat struct + LocalSSRC uint32 + RTPPacketsJitter float64 + RTPPacketsLastNTP time.Time + RTPPacketsLastRTP uint32 + RTPPacketsLastSequenceNumber uint16 + RTPPacketsLost uint64 + RTPPacketsReceived uint64 + RTPPacketsSent uint64 + RemoteSSRC uint32 + type SessionStatsMedia struct + BytesReceived uint64 + BytesSent uint64 + Formats map[format.Format]SessionStatsFormat + RTCPPacketsInError uint64 + RTCPPacketsReceived uint64 + RTCPPacketsSent uint64 + RTPPacketsInError uint64 + type SessionTransport struct + Profile headers.TransportProfile + Protocol Protocol + type StreamMediaMulticastParams struct + IP net.IP + RTCPPort int + RTPPort int + type Tunnel int + const TunnelHTTP + const TunnelNone + const TunnelWebSocket