rtsp

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Author: Benehiko Modified Date: 2020/12/10 Contact: alanoterblanche@gmail.com | https://github.com/Benehiko

RtspClient is greatly inspired by github.com/deepch/RTSPtoWebRTC RtspClient only wraps and simplifies their code to fit inside this library.

Author: Benehiko Modified Date: 2020/12/10 Contact: alanoterblanche@gmail.com | https://github.com/Benehiko

WebRtcClient is greatly inspired by github.com/deepch/RTSPtoWebRTC WebRtcClient only wraps and simplifies their code to fit inside this library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OptionRtspClient

type OptionRtspClient interface {
	// contains filtered or unexported methods
}

func WithDebug

func WithDebug(debug bool) OptionRtspClient

func WithEndpoint

func WithEndpoint(endpoint string) OptionRtspClient

func WithHost

func WithHost(host string) OptionRtspClient

Change the rtsp connection host (ip address or domain)

func WithPassword

func WithPassword(password string) OptionRtspClient

func WithPort

func WithPort(port int) OptionRtspClient

func WithRetry

func WithRetry(retryCount int) OptionRtspClient

func WithTimeout

func WithTimeout(timeout int) OptionRtspClient

Change the network timeout in seconds

func WithUsername

func WithUsername(username string) OptionRtspClient

type RtspClient

type RtspClient struct {
	UUID   string
	Stream *Stream
	// contains filtered or unexported fields
}

func NewRtspClient

func NewRtspClient(host string, opts ...OptionRtspClient) *RtspClient

Create a new RTSP client Defaults: Timeout: 10 * time.Second Debug: false RetryCount: 5 Port: 554

func (*RtspClient) OpenStream

func (rc *RtspClient) OpenStream()

type Stream

type Stream struct {
	Codecs  []av.CodecData
	Packets map[string]chan av.Packet
}

stream contains all the necessary information of the stream. stream packet contains audio and video

type WebRtcClient

type WebRtcClient struct {
	Ready chan bool
	SDP   chan string
	RTSP  *RtspClient
}

func NewWebRtcClient

func NewWebRtcClient(rtspClient *RtspClient) *WebRtcClient

func (*WebRtcClient) OpenWebRtcStream

func (wrtc *WebRtcClient) OpenWebRtcStream(sdpData string)

Open a WebRTC Stream from the RTSP Stream Credit for most of this code goes to deepch https://github.com/deepch/RTSPtoWebRTC

Jump to

Keyboard shortcuts

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