webm

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: Apache-2.0 Imports: 4 Imported by: 45

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Audio

type Audio struct {
	SamplingFrequency float64 `ebml:"SamplingFrequency"`
	Channels          uint64  `ebml:"Channels"`
}

Audio represents Audio element struct

type Cluster

type Cluster struct {
	Timecode   uint64 `ebml:"Timecode"`
	PrevSize   uint64 `ebml:"PrevSize,omitempty"`
	BlockGroup []struct {
		BlockDuration uint64       `ebml:"BlockDuration"`
		Block         []ebml.Block `ebml:"Block"`
	} `ebml:"BlockGroup"`
	SimpleBlock []ebml.Block `ebml:"SimpleBlock"`
}

Cluster represents Cluster element struct

type CuePoint added in v0.1.0

type CuePoint struct {
	CueTime           uint64             `ebml:"CueTime"`
	CueTrackPositions []CueTrackPosition `ebml:"CueTrackPositions"`
}

type CueTrackPosition added in v0.1.0

type CueTrackPosition struct {
	CueTrack           uint64 `ebml:"CueTrack"`
	CueClusterPosition uint64 `ebml:"CueClusterPosition"`
	CueBlockNumber     uint64 `ebml:"CueBlockNumber,omitempty"`
}

type Cues added in v0.1.0

type Cues struct {
	CuePoint []CuePoint `ebml:"CuePoint"`
}

type EBMLHeader

type EBMLHeader struct {
	EBMLVersion        uint64 `ebml:"EBMLVersion"`
	EBMLReadVersion    uint64 `ebml:"EBMLReadVersion"`
	EBMLMaxIDLength    uint64 `ebml:"EBMLMaxIDLength"`
	EBMLMaxSizeLength  uint64 `ebml:"EBMLMaxSizeLength"`
	DocType            string `ebml:"EBMLDocType"`
	DocTypeVersion     uint64 `ebml:"EBMLDocTypeVersion"`
	DocTypeReadVersion uint64 `ebml:"EBMLDocTypeReadVersion"`
}

EBMLHeader represents EBML header struct

type FrameWriter added in v0.0.2

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

FrameWriter is a stream frame writer. It's simillar to io.Writer, but having additional arguments keyframe flag and timestamp.

func NewSimpleWriter added in v0.0.2

func NewSimpleWriter(w0 io.WriteCloser, tracks []TrackEntry) ([]*FrameWriter, error)

NewSimpleWriter creates FrameWriter for each track specified as tracks argument. Resultant WebM is written to given io.WriteCloser. io.WriteCloser will be closed automatically; don't close it by yourself.

func (*FrameWriter) Close added in v0.0.2

func (w *FrameWriter) Close() error

Close closes a stream frame writer. Output WebM will be closed after closing all FrameWriter.

func (*FrameWriter) Write added in v0.0.2

func (w *FrameWriter) Write(keyframe bool, timestamp int64, b []byte) (int, error)

Write writes a stream frame to the connected WebM writer. timestamp is in millisecond.

type Info

type Info struct {
	TimecodeScale uint64    `ebml:"TimecodeScale"`
	MuxingApp     string    `ebml:"MuxingApp,omitempty"`
	WritingApp    string    `ebml:"WritingApp,omitempty"`
	Duration      float64   `ebml:"Duration,omitempty"`
	DateUTC       time.Time `ebml:"DateUTC,omitempty"`
}

Info represents Info element struct

type SeekHead

type SeekHead struct {
	Seek []struct {
		SeekID       []byte `ebml:"SeekID"`
		SeekPosition uint64 `ebml:"SeekPosition"`
	} `ebml:"Seek"`
}

SeekHead represents SeekHead element struct

type Segment

type Segment struct {
	SeekHead *SeekHead `ebml:"SeekHead"`
	Info     Info      `ebml:"Info"`
	Tracks   Tracks    `ebml:"Tracks"`
	Cluster  []Cluster `ebml:"Cluster"`
	Cues     *Cues     `ebml:"Cues"`
}

Segment represents Segment element struct

type SegmentStream

type SegmentStream struct {
	SeekHead *SeekHead `ebml:"SeekHead"`
	Info     Info      `ebml:"Info"`
	Tracks   Tracks    `ebml:"Tracks"`
	Cluster  []Cluster `ebml:"Cluster,inf"`
}

SegmentStream represents Segment element struct for streaming

type TrackEntry

type TrackEntry struct {
	Name            string `ebml:"Name,omitempty"`
	TrackNumber     uint64 `ebml:"TrackNumber"`
	TrackUID        uint64 `ebml:"TrackUID"`
	CodecID         string `ebml:"CodecID"`
	CodecPrivate    []byte `ebml:"CodecPrivate,omitempty"`
	CodecDelay      uint64 `ebml:"CodecDelay,omitempty"`
	TrackType       uint64 `ebml:"TrackType"`
	DefaultDuration uint64 `ebml:"DefaultDuration,omitempty"`
	SeekPreRoll     uint64 `ebml:"SeekPreRoll,omitempty"`
	Audio           *Audio `ebml:"Audio"`
	Video           *Video `ebml:"Video"`
}

TrackEntry represents TrackEntry element struct

type Tracks

type Tracks struct {
	TrackEntry []TrackEntry `ebml:"TrackEntry"`
}

Tracks represents Tracks element struct

type Video

type Video struct {
	PixelWidth  uint64 `ebml:"PixelWidth"`
	PixelHeight uint64 `ebml:"PixelHeight"`
}

Video represents Video element struct

Jump to

Keyboard shortcuts

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