matroska

package
v0.20.18 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoBlockWriter  = errors.New("no black writer")
	ErrNotFoundTrack  = errors.New("no found track")
	ErrNoTracks       = errors.New("no tracks")
	ErrH264PacketSize = errors.New("packet size error")
	ErrNotAnnexBData  = errors.New("not AnnexB format data")
)

Functions

func NewFuncOption added in v0.20.6

func NewFuncOption[T any](f func(T)) *funcOption[T]

Types

type EmptyOption added in v0.20.6

type EmptyOption[T any] struct{}

func (EmptyOption[T]) Apply added in v0.20.6

func (EmptyOption[T]) Apply(T)

type Matroska

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

func Open

func Open(w WriteSeekCloser, tracks ...Track) (*Matroska, error)

func (*Matroska) Close

func (m *Matroska) Close()

func (*Matroska) FileSize added in v0.20.16

func (m *Matroska) FileSize() int

func (*Matroska) GetTracks

func (m *Matroska) GetTracks() []Track

func (*Matroska) WriteAudio

func (m *Matroska) WriteAudio(timestamp time.Duration, b []byte) (int, error)

func (*Matroska) WriteTrack

func (m *Matroska) WriteTrack(t Track, timestamp time.Duration, b []byte, keyframe ...bool) (int, error)

func (*Matroska) WriteVideo

func (m *Matroska) WriteVideo(timestamp time.Duration, b []byte) (int, error)

type Option added in v0.20.6

type Option[T any] interface {
	Apply(T)
}

func WithH264SPSPPS added in v0.20.1

func WithH264SPSPPS(sps, pps []byte) Option[*trackH264]

WithH264SPSPPS sps/pps 00 00 00 01 ...

func WithH265SPSPPS added in v0.20.1

func WithH265SPSPPS(vps, sps, pps []byte) Option[*trackH265]

WithH265SPSPPS vps/sps/pps 00 00 00 01 ...

type Track

type Track interface {
	IsVideo() bool
	IsAudio() bool
	GetTrackEntry() *webm.TrackEntry
	Write(timestamp time.Duration, b []byte, keyframe ...bool) (int, error)

	GetWriter() webm.BlockWriteCloser
	// contains filtered or unexported methods
}

func NewTrackAAC

func NewTrackAAC(samplingFrequency int, channels int) Track

func NewTrackG726

func NewTrackG726(sampleRate int, channels int) Track

func NewTrackH264

func NewTrackH264(opts ...Option[*trackH264]) Track

func NewTrackH265

func NewTrackH265(opts ...Option[*trackH265]) Track

func NewTrackOpus

func NewTrackOpus(channels int) Track

func NewTrackPCMA

func NewTrackPCMA(sampleRate int, channels int) Track

type UnimplementedTrack

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

func (*UnimplementedTrack) GetTrackEntry

func (c *UnimplementedTrack) GetTrackEntry() *webm.TrackEntry

func (*UnimplementedTrack) GetWriter

func (c *UnimplementedTrack) GetWriter() webm.BlockWriteCloser

func (*UnimplementedTrack) IsAudio

func (c *UnimplementedTrack) IsAudio() bool

func (*UnimplementedTrack) IsVideo

func (c *UnimplementedTrack) IsVideo() bool

func (*UnimplementedTrack) Write

func (c *UnimplementedTrack) Write(timestamp time.Duration, b []byte, keyframe ...bool) (int, error)

type WriteSeekCloser added in v0.20.1

type WriteSeekCloser interface {
	io.Writer
	io.Seeker
	io.Closer
}

Jump to

Keyboard shortcuts

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