Versions in this module Expand all Collapse all v0 v0.1.1 Sep 10, 2026 Changes in this version + var ErrChannelNoCodec = errors.New("channel codec not ready") + var ErrChannelNotFound = errors.New("channel not found") + var ErrEngineClosed = errors.New("engine already shut down") + func RemuxWindowTS(hlsDir string) ([]byte, error) + func WindowHLSDir(recordDir, rel string) string + func WindowMP4Path(recordDir, rel string) string + func WriteWindowMP4(hlsDir, mp4Path string) (int64, error) + type AACSpec struct + ChannelCount int + SampleRate int + type ChannelConfig struct + Id string + Name string + OnDemand bool + RecordEnabled bool + SegmentSeconds int + Url string + type Config struct + ConnectTimeout time.Duration + Context context.Context + Log Logger + NoKeyframeAfter time.Duration + ReadTimeout time.Duration + RecordDir string + type Engine struct + func New(cfg Config, events Events) *Engine + func (e *Engine) ApplyChannel(cfg ChannelConfig) error + func (e *Engine) RemoveChannel(id string) error + func (e *Engine) RunAll(fn func() ([]ChannelConfig, error)) error + func (e *Engine) SetRecord(id string, on bool) error + func (e *Engine) SetSegment(id string, seconds int) error + func (e *Engine) Shutdown() + func (e *Engine) Snapshot(id string) (online bool, recording bool) + func (e *Engine) Subscribe(id string) (*Subscription, error) + func (e *Engine) TrackInfoContext(ctx context.Context, id string) (*TrackSpec, error) + type Events struct + OnChannelStatus func(streamId string, online bool) + OnRecordClosed func(ev RecordEvent) + type Frame struct + AU [][]byte + Key bool + Kind Kind + NTP time.Time + PTS time.Duration + SessionID uint64 + type H264Spec struct + PPS []byte + SPS []byte + type Kind uint8 + const KindAudio + const KindVideo + type Logger interface + Debugf func(format string, args ...interface{}) + Errorf func(format string, args ...interface{}) + Infof func(format string, args ...interface{}) + Warnf func(format string, args ...interface{}) + type RecordEvent struct + End time.Time + FilePath string + Segments int + Size int64 + Start time.Time + StreamId string + type Subscription struct + Cancel func() + Done <-chan struct{} + Frames <-chan *Frame + type TrackSpec struct + Audio *AACSpec + Video *H264Spec v0.1.0 Sep 10, 2026