webm

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package webm provides a restricted WebM profile wrapper around Matroska.

Index

Constants

View Source
const (
	CodecOpus   = matroska.CodecOpus
	CodecVorbis = matroska.CodecVorbis
	CodecVP8    = matroska.CodecVP8
	CodecVP9    = matroska.CodecVP9
	CodecAV1    = matroska.CodecAV1
)
View Source
const (
	TrackAudio = matroska.TrackAudio
	TrackVideo = matroska.TrackVideo
)
View Source
const (
	LacingAuto  = matroska.LacingAuto
	LacingXiph  = matroska.LacingXiph
	LacingEBML  = matroska.LacingEBML
	LacingFixed = matroska.LacingFixed
)
View Source
const (
	CuePolicyDefault    = matroska.CuePolicyDefault
	CuePolicyKeyframes  = matroska.CuePolicyKeyframes
	CuePolicyAllPackets = matroska.CuePolicyAllPackets
	CuePolicyNone       = matroska.CuePolicyNone
)
View Source
const (
	ContentEncodingScopeBlock   = matroska.ContentEncodingScopeBlock
	ContentEncodingScopePrivate = matroska.ContentEncodingScopePrivate
	ContentEncodingScopeNext    = matroska.ContentEncodingScopeNext

	ContentEncodingTypeCompression = matroska.ContentEncodingTypeCompression
	ContentEncodingTypeEncryption  = matroska.ContentEncodingTypeEncryption

	ContentCompAlgoZlib            = matroska.ContentCompAlgoZlib
	ContentCompAlgoBzlib           = matroska.ContentCompAlgoBzlib
	ContentCompAlgoLZO1X           = matroska.ContentCompAlgoLZO1X
	ContentCompAlgoHeaderStripping = matroska.ContentCompAlgoHeaderStripping

	ContentEncAlgoNotEncrypted = matroska.ContentEncAlgoNotEncrypted
	ContentEncAlgoDES          = matroska.ContentEncAlgoDES
	ContentEncAlgoTripleDES    = matroska.ContentEncAlgoTripleDES
	ContentEncAlgoTwofish      = matroska.ContentEncAlgoTwofish
	ContentEncAlgoBlowfish     = matroska.ContentEncAlgoBlowfish
	ContentEncAlgoAES          = matroska.ContentEncAlgoAES

	ContentEncAESCipherModeCTR = matroska.ContentEncAESCipherModeCTR
	ContentEncAESCipherModeCBC = matroska.ContentEncAESCipherModeCBC

	ContentSigAlgoNotSigned = matroska.ContentSigAlgoNotSigned
	ContentSigAlgoRSA       = matroska.ContentSigAlgoRSA

	ContentSigHashAlgoNotSigned = matroska.ContentSigHashAlgoNotSigned
	ContentSigHashAlgoSHA1      = matroska.ContentSigHashAlgoSHA1
	ContentSigHashAlgoMD5       = matroska.ContentSigHashAlgoMD5
)

Variables

View Source
var (
	ErrUnsupportedWebMCodec           = errors.New("webm: unsupported codec")
	ErrUnsupportedWebMCodecPrivate    = errors.New("webm: unsupported codec private")
	ErrUnsupportedWebMDocType         = errors.New("webm: unsupported doc type")
	ErrUnsupportedWebMMetadata        = errors.New("webm: unsupported metadata")
	ErrUnsupportedWebMTrackMetadata   = errors.New("webm: unsupported track metadata")
	ErrUnsupportedWebMContentEncoding = errors.New("webm: unsupported content encoding")
	ErrNonMonotonicWebMTimecode       = errors.New("webm: non-monotonic timecode")
)

Functions

func Descriptor

func Descriptor() format.Descriptor

func Register

func Register(registry *format.SimpleRegistry)

Types

type AudioConfig

type AudioConfig = matroska.AudioConfig

type Chapter

type Chapter = matroska.Chapter

type ChapterDisplay

type ChapterDisplay = matroska.ChapterDisplay

type ChapterEdition

type ChapterEdition = matroska.ChapterEdition

type Codec

type Codec = matroska.Codec

type ContentCompression

type ContentCompression = matroska.ContentCompression

type ContentEncAESSettings

type ContentEncAESSettings = matroska.ContentEncAESSettings

type ContentEncoding

type ContentEncoding = matroska.ContentEncoding

type ContentEncryption

type ContentEncryption = matroska.ContentEncryption

type ContentEncryptionKey

type ContentEncryptionKey = matroska.ContentEncryptionKey

type CuePoint

type CuePoint = matroska.CuePoint

type CuePolicy

type CuePolicy = matroska.CuePolicy

type CueReference

type CueReference = matroska.CueReference

type CueTrackPosition

type CueTrackPosition = matroska.CueTrackPosition

type Demuxer

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

func NewDemuxer

func NewDemuxer(r io.Reader, opts DemuxerOptions) (*Demuxer, error)

func (*Demuxer) CanSeek

func (d *Demuxer) CanSeek() bool

CanSeek reports whether the reader can reposition (matroska.Demuxer.CanSeek).

func (*Demuxer) Chapters

func (d *Demuxer) Chapters() []ChapterEdition

func (*Demuxer) Cues

func (d *Demuxer) Cues() []CuePoint

func (*Demuxer) Info

func (d *Demuxer) Info() SegmentInfo

func (*Demuxer) ReadCuedPacketAtTime

func (d *Demuxer) ReadCuedPacketAtTime(timeNS int64, dst *Packet) error

ReadCuedPacketAtTime seeks to the first cue at or after timeNS and reads the cued packet. Exact block cues jump to the block; cluster-only cues scan within the referenced Cluster until the cue's track/time is reached. It does not scan uncued packets between cues; use ReadPacketAtTime when uncued packets should be considered too.

func (*Demuxer) ReadCuedTrackPacketAtTime

func (d *Demuxer) ReadCuedTrackPacketAtTime(trackID uint32, timeNS int64, dst *Packet) error

ReadCuedTrackPacketAtTime seeks to the first cue for trackID at or after timeNS and reads that cued packet. Exact block cues jump to the block; cluster-only cues scan within the referenced Cluster until the cue's track/time is reached. It does not scan uncued packets between cues; use ReadTrackPacketAtTime when uncued packets should be considered too.

func (*Demuxer) ReadPacket

func (d *Demuxer) ReadPacket(dst *Packet) error

ReadPacket reads the next packet into dst and validates WebM packet timing. It keeps the matroska zero-allocation contract: the payload is written into dst.Data's existing capacity, and a payload that does not fit is refused with matroska.ErrPayloadTooSmall instead of growing the buffer.

func (*Demuxer) ReadPacketAtTime

func (d *Demuxer) ReadPacketAtTime(timeNS int64, dst *Packet) error

ReadPacketAtTime seeks to the nearest preceding cue and reads forward until it finds the first packet at or after timeNS.

func (*Demuxer) ReadTrackPacketAtTime

func (d *Demuxer) ReadTrackPacketAtTime(trackID uint32, timeNS int64, dst *Packet) error

ReadTrackPacketAtTime seeks to the nearest preceding cue for trackID and reads forward until it finds the first packet for trackID at or after timeNS.

func (*Demuxer) SeekEntries

func (d *Demuxer) SeekEntries() []SeekEntry

func (*Demuxer) SeekToTime

func (d *Demuxer) SeekToTime(timeNS int64) error

func (*Demuxer) SeekToTrackTime

func (d *Demuxer) SeekToTrackTime(trackID uint32, timeNS int64) error

func (*Demuxer) Tags

func (d *Demuxer) Tags() []Tag

func (*Demuxer) Tracks

func (d *Demuxer) Tracks() []Track

func (*Demuxer) UnknownSegmentElements

func (d *Demuxer) UnknownSegmentElements() []UnknownElement

func (*Demuxer) UnknownTracksElements

func (d *Demuxer) UnknownTracksElements() []UnknownElement

type DemuxerFactory

type DemuxerFactory struct{}

func (DemuxerFactory) NewDemuxer

func (DemuxerFactory) NewDemuxer(ctx context.Context, result format.ProbeResult) (format.Demuxer, error)

type DemuxerOptions

type DemuxerOptions = matroska.DemuxerOptions

type FormatDemuxer

type FormatDemuxer struct {
	*matroska.FormatDemuxer
}

FormatDemuxer adapts the WebM demuxer to format.Demuxer: the Matroska adapter reading through WebM's profile-checked Demuxer.

func NewFormatDemuxer

func NewFormatDemuxer() *FormatDemuxer

NewFormatDemuxer returns the WebM format.Demuxer.

type FormatMuxer

type FormatMuxer struct {
	*matroska.FormatMuxer
}

FormatMuxer adapts the WebM muxer to format.Muxer: the Matroska adapter writing through WebM's profile-checked Muxer.

func NewFormatMuxer

func NewFormatMuxer() *FormatMuxer

NewFormatMuxer returns the WebM format.Muxer.

type LacedPacket

type LacedPacket = matroska.LacedPacket

type LacingMode

type LacingMode = matroska.LacingMode

type Muxer

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

func NewMuxer

func NewMuxer(w io.Writer, opts MuxerOptions) (*Muxer, error)

func (*Muxer) AddTrack

func (m *Muxer) AddTrack(track Track) (uint32, error)

func (*Muxer) Close

func (m *Muxer) Close() error

func (*Muxer) WriteLacedPacket

func (m *Muxer) WriteLacedPacket(packet LacedPacket) error

func (*Muxer) WritePacket

func (m *Muxer) WritePacket(packet Packet) error

type MuxerFactory

type MuxerFactory struct{}

func (MuxerFactory) NewMuxer

func (MuxerFactory) NewMuxer(ctx context.Context, id av.FormatID) (format.Muxer, error)

type MuxerOptions

type MuxerOptions struct {
	MuxingApp                  string
	WritingApp                 string
	Info                       SegmentInfo
	TimecodeScaleNS            int64
	ClusterMaxDurationNS       int64
	Streaming                  bool
	CuePolicy                  CuePolicy
	WriteCRC32                 bool
	Chapters                   []ChapterEdition
	Tags                       []Tag
	UnknownSegmentElements     []UnknownElement
	UnknownTracksElements      []UnknownElement
	ContentEncryptionKeys      []ContentEncryptionKey
	ContentEncryptionInitialIV []byte
}

type Packet

type Packet = matroska.Packet

type Prober

type Prober struct{}

func (Prober) Probe

type SeekEntry

type SeekEntry = matroska.SeekEntry

type SegmentInfo

type SegmentInfo = matroska.SegmentInfo

type SimpleTag

type SimpleTag = matroska.SimpleTag

type Tag

type Tag = matroska.Tag

type TagTarget

type TagTarget = matroska.TagTarget

type Track

type Track = matroska.Track

type TrackType

type TrackType = matroska.TrackType

type UnknownElement

type UnknownElement = matroska.UnknownElement

type VideoColourConfig

type VideoColourConfig = matroska.VideoColourConfig

type VideoConfig

type VideoConfig = matroska.VideoConfig

type VideoMasteringMetadataConfig

type VideoMasteringMetadataConfig = matroska.VideoMasteringMetadataConfig

type VideoProjectionConfig

type VideoProjectionConfig = matroska.VideoProjectionConfig

Jump to

Keyboard shortcuts

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