Documentation
¶
Overview ¶
Package webm provides a restricted WebM profile wrapper around Matroska.
Index ¶
- Constants
- Variables
- func Descriptor() format.Descriptor
- func Register(registry *format.Registry)
- type AudioConfig
- type Chapter
- type ChapterDisplay
- type ChapterEdition
- type Codec
- type ContentCompression
- type ContentEncAESSettings
- type ContentEncoding
- type ContentEncryption
- type ContentEncryptionKey
- type CuePoint
- type CuePolicy
- type CueReference
- type CueTrackPosition
- type Demuxer
- func (d *Demuxer) CanSeek() bool
- func (d *Demuxer) Chapters() []ChapterEdition
- func (d *Demuxer) Cues() []CuePoint
- func (d *Demuxer) Info() SegmentInfo
- func (d *Demuxer) ReadCuedPacketAtTime(timeNS int64, dst *Packet) error
- func (d *Demuxer) ReadCuedTrackPacketAtTime(trackID uint32, timeNS int64, dst *Packet) error
- func (d *Demuxer) ReadPacket(dst *Packet) error
- func (d *Demuxer) ReadPacketAtTime(timeNS int64, dst *Packet) error
- func (d *Demuxer) ReadTrackPacketAtTime(trackID uint32, timeNS int64, dst *Packet) error
- func (d *Demuxer) SeekEntries() []SeekEntry
- func (d *Demuxer) SeekToTime(timeNS int64) error
- func (d *Demuxer) SeekToTrackTime(trackID uint32, timeNS int64) error
- func (d *Demuxer) Tags() []Tag
- func (d *Demuxer) Tracks() []Track
- func (d *Demuxer) UnknownSegmentElements() []UnknownElement
- func (d *Demuxer) UnknownTracksElements() []UnknownElement
- type DemuxerFactory
- type DemuxerOptions
- type FormatDemuxer
- type FormatMuxer
- type LacedPacket
- type LacingMode
- type Muxer
- type MuxerFactory
- type MuxerOptions
- type Packet
- type Prober
- type SeekEntry
- type SegmentInfo
- type SimpleTag
- type Tag
- type TagTarget
- type Track
- type TrackType
- type UnknownElement
- type VideoColourConfig
- type VideoConfig
- type VideoMasteringMetadataConfig
- type VideoProjectionConfig
Constants ¶
const ( CodecOpus = matroska.CodecOpus CodecVorbis = matroska.CodecVorbis CodecVP8 = matroska.CodecVP8 CodecVP9 = matroska.CodecVP9 CodecAV1 = matroska.CodecAV1 )
const ( TrackAudio = matroska.TrackAudio TrackVideo = matroska.TrackVideo )
const ( LacingAuto = matroska.LacingAuto LacingXiph = matroska.LacingXiph LacingEBML = matroska.LacingEBML LacingFixed = matroska.LacingFixed )
const ( CuePolicyDefault = matroska.CuePolicyDefault CuePolicyKeyframes = matroska.CuePolicyKeyframes CuePolicyAllPackets = matroska.CuePolicyAllPackets CuePolicyNone = matroska.CuePolicyNone )
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 ¶
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
Types ¶
type AudioConfig ¶
type AudioConfig = matroska.AudioConfig
type ChapterDisplay ¶
type ChapterDisplay = matroska.ChapterDisplay
type ChapterEdition ¶
type ChapterEdition = matroska.ChapterEdition
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 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 ¶
CanSeek reports whether the reader can reposition (matroska.Demuxer.CanSeek).
func (*Demuxer) Chapters ¶
func (d *Demuxer) Chapters() []ChapterEdition
func (*Demuxer) Info ¶
func (d *Demuxer) Info() SegmentInfo
func (*Demuxer) ReadCuedPacketAtTime ¶
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 ¶
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 ¶
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 ¶
ReadPacketAtTime seeks to the nearest preceding cue and reads forward until it finds the first packet at or after timeNS.
func (*Demuxer) ReadTrackPacketAtTime ¶
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 (*Demuxer) SeekToTime ¶
func (*Demuxer) SeekToTrackTime ¶
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 (*Muxer) WriteLacedPacket ¶
func (m *Muxer) WriteLacedPacket(packet LacedPacket) error
func (*Muxer) WritePacket ¶
type MuxerFactory ¶
type MuxerFactory struct{}
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 Prober ¶
type Prober struct{}
func (Prober) Probe ¶
func (Prober) Probe(ctx context.Context, request format.ProbeRequest) (format.ProbeResult, error)
type SegmentInfo ¶
type SegmentInfo = matroska.SegmentInfo
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