recorder

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: LGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFsPermissions added in v0.10.0

func CheckFsPermissions(cfg config.Recorder) error

func GetVP8KFDimension

func GetVP8KFDimension(packet *rtp.Packet) (int, int)

func IsVP8KeyFrame

func IsVP8KeyFrame(packet *rtp.Packet) bool

func ValidateAndPrepareFile

func ValidateAndPrepareFile(ctx context.Context, cfg config.Recorder, file string) (string, os.FileMode, error)

Types

type AudioTrackStats

type AudioTrackStats struct {
	BaseTrackStats
}

AudioTrackStats contains audio-specific metrics

type BaseTrackStats

type BaseTrackStats struct {
	StartTime           int64             `json:"startTime"`
	EndTime             int64             `json:"endTime"`
	StartPTS            int64             `json:"startPts"`
	EndPTS              int64             `json:"endPts"`
	AvgSampleDurationMs time.Duration     `json:"avgSampleDurationMs"`
	MaxSampleDurationMs time.Duration     `json:"maxSampleDurationMs"`
	TotalSamples        int               `json:"totalSamples"`
	WrittenSamples      int               `json:"writtenSamples"`
	RTPDiscontInfo      DiscontinuityInfo `json:"rtpDiscontInfo"`
	// contains filtered or unexported fields
}

BaseTrackStats contains metrics common to both audio and video tracks

type DiscontinuityInfo

type DiscontinuityInfo struct {
	Count    int    `json:"count"`
	MinGap   uint16 `json:"minGap"`
	MaxGap   uint16 `json:"maxGap"`
	AvgGap   uint16 `json:"avgGap"`
	TotalGap uint16 `json:"totalGap"`
}

type IVFWriter

type IVFWriter struct {
	// contains filtered or unexported fields
}

func NewIVFWriter

func NewIVFWriter(basePath string) (*IVFWriter, error)

VP8 only for now

func (*IVFWriter) Close

func (writer *IVFWriter) Close() error

func (*IVFWriter) UpdateDimensions

func (writer *IVFWriter) UpdateDimensions(width, height uint16) error

func (*IVFWriter) WriteFrame

func (writer *IVFWriter) WriteFrame(frameData []byte, timestamp uint32, isKeyFrame bool) error

type KeyframeRequester

type KeyframeRequester = interfaces.KeyframeRequester

KeyframeRequester defines the interface for requesting keyframes

type RTPPacketWithMeta

type RTPPacketWithMeta struct {
	Payload    []byte
	Timestamp  uint32
	SequenceNo uint16
	IsKeyFrame bool
	Marker     bool
}

type Recorder

type Recorder interface {
	GetFilePath() string
	GetStats() *RecorderStats
	PushVideo(rtp *rtp.Packet)
	PushAudio(rtp *rtp.Packet)
	NotifySkippedPacket(seq uint16)
	WithContext(ctx context.Context)
	VideoTimestamp() time.Duration
	AudioTimestamp() time.Duration
	SetHasAudio(hasAudio bool)
	SetHasVideo(hasVideo bool)
	SetKeyframeRequester(requester KeyframeRequester)
	GetHasAudio() bool
	GetHasVideo() bool
	Close() time.Duration
}

func NewRecorder

func NewRecorder(ctx context.Context, cfg config.Recorder, file string) (Recorder, error)

type RecorderStats

type RecorderStats struct {
	Audio *RecorderTrackStats `json:"audio,omitempty"`
	Video *RecorderTrackStats `json:"video,omitempty"`
}

type RecorderTrackStats

type RecorderTrackStats struct {
	BaseTrackStats
	CorruptedFrames     int               `json:"corruptedFrames,omitempty"`
	AvgFrameSizeBytes   int               `json:"avgFrameSizeBytes,omitempty"`
	MaxFrameSizeBytes   int               `json:"maxFrameSizeBytes,omitempty"`
	KeyframeCount       int               `json:"keyframeCount,omitempty"`
	VP8PicIDDiscontInfo DiscontinuityInfo `json:"vp8PicIdDiscontInfo,omitempty"`
}

VideoTrackStats contains video-specific metrics

type VP8FrameInfo

type VP8FrameInfo struct {
	// contains filtered or unexported fields
}

This is more of a debugging thing than anything else

type VP8PartitionTracker

type VP8PartitionTracker struct {
	// contains filtered or unexported fields
}

type WebmRecorder

type WebmRecorder struct {
	// contains filtered or unexported fields
}

func NewWebmRecorder

func NewWebmRecorder(
	file string,
	fileMode os.FileMode,
	videoPacketQueueSize uint16,
	audioPacketQueueSize uint16,
	useCustomSampler bool,
	writeIVFCopy bool,
) *WebmRecorder

func (*WebmRecorder) AudioTimestamp

func (r *WebmRecorder) AudioTimestamp() time.Duration

func (*WebmRecorder) Close

func (r *WebmRecorder) Close() time.Duration

func (*WebmRecorder) GetFilePath

func (r *WebmRecorder) GetFilePath() string

func (*WebmRecorder) GetHasAudio

func (r *WebmRecorder) GetHasAudio() bool

func (*WebmRecorder) GetHasVideo

func (r *WebmRecorder) GetHasVideo() bool

func (*WebmRecorder) GetStats

func (r *WebmRecorder) GetStats() *RecorderStats

func (*WebmRecorder) NotifySkippedPacket

func (r *WebmRecorder) NotifySkippedPacket(seq uint16)

func (*WebmRecorder) PushAudio

func (r *WebmRecorder) PushAudio(p *rtp.Packet)

func (*WebmRecorder) PushVideo

func (r *WebmRecorder) PushVideo(p *rtp.Packet)

func (*WebmRecorder) RequestKeyframe

func (r *WebmRecorder) RequestKeyframe()

func (*WebmRecorder) SetHasAudio

func (r *WebmRecorder) SetHasAudio(hasAudio bool)

func (*WebmRecorder) SetHasVideo

func (r *WebmRecorder) SetHasVideo(hasVideo bool)

func (*WebmRecorder) SetKeyframeRequester

func (r *WebmRecorder) SetKeyframeRequester(requester KeyframeRequester)

func (*WebmRecorder) VideoTimestamp

func (r *WebmRecorder) VideoTimestamp() time.Duration

func (*WebmRecorder) WithContext

func (r *WebmRecorder) WithContext(ctx context.Context)

Jump to

Keyboard shortcuts

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