Documentation
¶
Overview ¶
Package webrtp provides RTSP to WebSocket streaming with fMP4 output.
Index ¶
- func AnnexbToAvcc(au [][]byte) []byte
- func AnnexbToNalus(data []byte) [][]byte
- func BuildFragment(seqNr uint32, dts uint64, dur uint32, isIDR bool, avcc []byte) ([]byte, error)
- func BuildInitH264(sps, pps []byte) ([]byte, error)
- func BuildInitH265(vps, sps, pps []byte) ([]byte, error)
- type Config
- type Frame
- type Hub
- func (r *Hub) Broadcast(data []byte, isKey bool)
- func (r *Hub) GetInit() []byte
- func (r *Hub) GetStartupSnapshot() ([]byte, []*Frame)
- func (r *Hub) GetStats(name string) StreamStats
- func (r *Hub) GetStatus() Status
- func (r *Hub) IsReceivingFrames() bool
- func (r *Hub) Reset()
- func (r *Hub) SetFramerate(framerate float64)
- func (r *Hub) SetInfo(codec string, width, height int, frameRate float64)
- func (r *Hub) SetInit(data []byte)
- func (r *Hub) Subscribe() chan *Frame
- func (r *Hub) SubscribeWithStartupSnapshot() ([]byte, []*Frame, chan *Frame)
- func (r *Hub) Unsubscribe(ch chan *Frame)
- type Instance
- func (r *Instance) Connect() error
- func (r *Instance) GetHub() *Hub
- func (r *Instance) HandleWebsocket(conn *websocket.Conn)
- func (r *Instance) Handler() fiber.Handler
- func (r *Instance) InstanceReady() bool
- func (r *Instance) PublishDeskViewMetadata(topic string, payload []byte) error
- func (r *Instance) RecordingStatus() RecordingStatus
- func (r *Instance) Start(addr string) error
- func (r *Instance) StartRecording(path, mode, offlineMode string) error
- func (r *Instance) Stop() error
- func (r *Instance) StopRecording() error
- func (r *Instance) UpdateKeyframeCalibration(distort, deskEnabled bool, fx, fy, scale float64, desk string) error
- type Keyframe
- type Keyframer
- type Logger
- type Recorder
- func (r *Recorder) OnOffline()
- func (r *Recorder) RecordSample(avcc []byte, dur uint32, isIDR bool)
- func (r *Recorder) SetInit(initData []byte)
- func (r *Recorder) SetSourceInfo(codec string, width, height int, frameRate float64)
- func (r *Recorder) Start(path, mode, offlineMode string) error
- func (r *Recorder) Status() RecordingStatus
- func (r *Recorder) Stop() error
- type RecordingStatus
- type Status
- type StreamStats
- type UsbCapabilityMode
- type UsbCapabilityRendition
- type UsbDevice
- type UsbDeviceCapabilities
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnexbToAvcc ¶
AnnexbToAvcc converts Annex-B NAL units to AVCC format.
func AnnexbToNalus ¶
AnnexbToNalus splits an Annex-B byte stream into NAL units.
func BuildFragment ¶
BuildFragment creates an fMP4 media fragment.
func BuildInitH264 ¶
BuildInitH264 creates an fMP4 init segment for H264 video.
func BuildInitH265 ¶
BuildInitH265 creates an fMP4 init segment for H265 video.
Types ¶
type Config ¶
type Config struct {
SourceType string
StreamName string
Rtsp string
Device string
Path string
Codec string
H264Profile string
Width int
Height int
FrameRate float64
BitrateKbps int
KeyframeSink string
KeyframeOutput string
KeyframeFormat string
KeyframeMqttURL string
KeyframeMqttTopic string
Keyframer Keyframer
Logger Logger
WriteTimeout time.Duration
ReadBufferSize int
WriteBufferSize int
}
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
func (*Hub) GetStartupSnapshot ¶
func (*Hub) GetStats ¶
func (r *Hub) GetStats(name string) StreamStats
func (*Hub) IsReceivingFrames ¶
func (*Hub) SetFramerate ¶
func (*Hub) SubscribeWithStartupSnapshot ¶
func (*Hub) Unsubscribe ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
func (*Instance) HandleWebsocket ¶
func (*Instance) InstanceReady ¶
func (*Instance) PublishDeskViewMetadata ¶
func (*Instance) RecordingStatus ¶
func (r *Instance) RecordingStatus() RecordingStatus
func (*Instance) StartRecording ¶
func (*Instance) StopRecording ¶
type Logger ¶
type Logger interface {
Print(v ...interface{})
Printf(format string, v ...interface{})
}
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
func NewRecorder ¶
func (*Recorder) RecordSample ¶
func (*Recorder) SetSourceInfo ¶
func (*Recorder) Status ¶
func (r *Recorder) Status() RecordingStatus
type RecordingStatus ¶
type RecordingStatus struct {
Active bool `json:"active"`
Path string `json:"path,omitempty"`
OfflineMode string `json:"offlineMode,omitempty"`
StartedAt time.Time `json:"startedAt,omitempty"`
BytesWritten int64 `json:"bytesWritten"`
RequestedStartAt time.Time `json:"requestedStartAt,omitempty"`
ActualStartAt time.Time `json:"actualStartAt,omitempty"`
RequestedStopAt time.Time `json:"requestedStopAt,omitempty"`
ActualStopAt time.Time `json:"actualStopAt,omitempty"`
StartDriftMs int64 `json:"startDriftMs"`
StopDriftMs int64 `json:"stopDriftMs"`
MediaDurationMs int64 `json:"mediaDurationMs"`
TrimStartMs int64 `json:"trimStartMs"`
TrimEndMs int64 `json:"trimEndMs"`
MissingStartMs int64 `json:"missingStartMs"`
MissingEndMs int64 `json:"missingEndMs"`
}
type Status ¶
type Status struct {
Streams []*StreamStats `json:"streams"`
}
type StreamStats ¶
type StreamStats struct {
Name string `json:"name"`
Ready bool `json:"ready"`
Codec string `json:"codec"`
Width int `json:"width"`
Height int `json:"height"`
Framerate float64 `json:"framerate"`
FrameNo uint64 `json:"frameNo"`
ClientCount int32 `json:"clientCount"`
BytesRecv uint64 `json:"bytesRecv"`
Bitrate float64 `json:"bitrateKbps"`
Uptime time.Duration `json:"uptime"`
}
type UsbCapabilityMode ¶
type UsbCapabilityRendition ¶
type UsbDevice ¶
func UsbDeviceList ¶
type UsbDeviceCapabilities ¶
type UsbDeviceCapabilities struct {
Device *UsbDevice `json:"device,omitempty"`
Codecs []string `json:"codecs,omitempty"`
Modes []*UsbCapabilityMode `json:"modes,omitempty"`
SuggestedRenditions []*UsbCapabilityRendition `json:"suggestedRenditions,omitempty"`
BitrateControl string `json:"bitrateControl,omitempty"`
}
func UsbDeviceCapabilitiesGet ¶
func UsbDeviceCapabilitiesGet(device string) (*UsbDeviceCapabilities, error)
Source Files
¶
- h264_encode_common.go
- h264_encode_linux.go
- handler.go
- hub.go
- keyframe_calibration.go
- keyframe_image.go
- keyframe_native_decoder.go
- keyframe_native_decoder_debug.go
- keyframe_native_encode_stub.go
- keyframe_publish.go
- keyframe_renderer.go
- keyframe_renderer_webgpu_stub.go
- keyframe_sink.go
- keyframe_worker.go
- mqtt_publisher.go
- recorder.go
- recorder_black_native.go
- recorder_policy.go
- rtsp_codec.go
- rtsp_ffmpeg.go
- rtsp_h264.go
- rtsp_h265.go
- server.go
- server_policy.go
- source.go
- usb_capabilities.go
- usb_capabilities_stub.go
- usb_devices.go
- usb_devices_linux.go
- usb_linux.go
- video.go
- webrtp.go
- webrtp_file.go
- webrtp_rtsp.go
- webrtp_util.go
Directories
¶
| Path | Synopsis |
|---|---|
|
command
|
|
|
webrtp
command
|
|
|
experiment
|
|
|
streamable
command
|
|
|
webtransport
command
|
|
Click to show internal directories.
Click to hide internal directories.
