webm

package module
v0.0.0-...-629e38f Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2016 License: BSD-3-Clause Imports: 7 Imported by: 0 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.

README

ebml-go // webm

Package webm implements parser, reader and seeker for files in WebM container.

WebM files consist of video streams compressed with the VP8 or VP9 video codec, audio streams compressed with the Vorbis or Opus audio codecs. The WebM file structure is based on the Matroska media container. See WebM FAQ.

The parser uses an EBML decoder for Go programming language.

Installation
$ go get github.com/ebml-go/webm
License

The BSD 3-Clause License.

Documentation

Index

Constants

View Source
const (
	BadTC = time.Duration(-1000000000000000)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Audio

type Audio struct {
	SamplingFrequency       float64 `ebml:"B5" ebmldef:"8000.0"`
	OutputSamplingFrequency float64 `ebml:"78B5" ebmldeflink:"SamplingFrequency"`
	Channels                uint    `ebml:"9F" ebmldef:"1"`
	BitDepth                uint    `ebml:"6264"`
}

type BlockGroup

type BlockGroup struct {
	Block          []byte   `ebml:"A1"`
	BlockDuration  uint     `ebml:"9B"`
	ReferenceBlock int      `ebml:"FB"`
	CodecState     []byte   `ebml:"A4"`
	Slices         []Slices `ebml:"8E"`
}

type Cluster

type Cluster struct {
	Timecode   uint       `ebml:"E7"`
	PrevSize   uint       `ebml:"AB"`
	Position   uint       `ebml:"A7"`
	BlockGroup BlockGroup `ebml:"A0" ebmlstop:"1"`
	// contains filtered or unexported fields
}

type CuePoint

type CuePoint struct {
	CueTime           int64               `ebml:"B3"`
	CueTrackPositions []CueTrackPositions `ebml:"B7"`
}

type CueTrackPositions

type CueTrackPositions struct {
	CueTrack           uint  `ebml:"F7"`
	CueClusterPosition int64 `ebml:"F1"`
	CueBlockNumber     uint  `ebml:"5378" ebmldef:"1"`
}

type Cues

type Cues struct {
	CuePoint []CuePoint `ebml:"BB"`
}
type Header struct {
	EBMLVersion        uint   `ebml:"4286" ebmldef:"1"`
	EBMLReadVersion    uint   `ebml:"42f7" ebmldef:"1"`
	EBMLMaxIDLength    uint   `ebml:"42f2" ebmldef:"4"`
	EBMLMaxSizeLength  uint   `ebml:"42f3" ebmldef:"8"`
	DocType            string `ebml:"4282"`
	DocTypeVersion     uint   `ebml:"4287" ebmldef:"1"`
	DocTypeReadVersion uint   `ebml:"4285" ebmldef:"1"`
}

type Packet

type Packet struct {
	Data        []byte
	Timecode    time.Duration
	TrackNumber uint
	Invisible   bool
	Keyframe    bool
	Discardable bool
	Rebase      bool
}

type Reader

type Reader struct {
	Chan chan Packet
	// contains filtered or unexported fields
}

func Parse

func Parse(r io.ReadSeeker, m *WebM) (wr *Reader, err error)

func (*Reader) Seek

func (r *Reader) Seek(t time.Duration)

func (*Reader) Shutdown

func (r *Reader) Shutdown()

type Seek

type Seek struct {
	SeekID       []byte `ebml:"53AB"`
	SeekPosition int64  `ebml:"53AC"`
}

type SeekHead

type SeekHead struct {
	Seek []Seek `ebml:"4DBB"`
}

type Segment

type Segment struct {
	SeekHead           `ebml:"114D9B74" ebmlstop:"1"`
	SegmentInformation `ebml:"1549A966"`
	Tracks             `ebml:"1654AE6B"`
	Cues               `ebml:"1C53BB6B"`
	// contains filtered or unexported fields
}

type SegmentInformation

type SegmentInformation struct {
	TimecodeScale uint    `ebml:"2AD7B1" ebmldef:"1000000"`
	Duration      float64 `ebml:"4489"`
	DateUTC       []byte  `ebml:"4461"`
	MuxingApp     string  `ebml:"4D80"`
	WritingApp    string  `ebml:"5741"`
}

func (*SegmentInformation) GetDuration

func (s *SegmentInformation) GetDuration() time.Duration

type Slices

type Slices struct {
	TimeSlice []TimeSlice `ebml:"E8"`
}

type TimeSlice

type TimeSlice struct {
	LaceNumber uint `ebml:"CC" ebmldef:"0"`
}

type TrackEntry

type TrackEntry struct {
	TrackNumber     uint   `ebml:"D7"`
	TrackUID        uint64 `ebml:"73C5"`
	TrackType       uint   `ebml:"83"`
	FlagEnabled     uint   `ebml:"B9" ebmldef:"1"`
	FlagDefault     uint   `ebml:"88" ebmldef:"1"`
	FlagForced      uint   `ebml:"55AA" ebmldef:"0"`
	FlagLacing      uint   `ebml:"9C" ebmldef:"1"`
	DefaultDuration uint64 `ebml:"23E383"`
	Name            string `ebml:"536E"`
	Language        string `ebml:"22B59C" ebmldef:"eng"`
	CodecID         string `ebml:"86"`
	CodecPrivate    []byte `ebml:"63A2"`
	CodecName       string `ebml:"258688"`
	Video           `ebml:"E0"`
	Audio           `ebml:"E1"`
}

func (*TrackEntry) GetDefaultDuration

func (t *TrackEntry) GetDefaultDuration() time.Duration

func (*TrackEntry) IsAudio

func (t *TrackEntry) IsAudio() bool

func (*TrackEntry) IsVideo

func (t *TrackEntry) IsVideo() bool

type Tracks

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

type Video

type Video struct {
	FlagInterlaced  uint `ebml:"9A" ebmldef:"0"`
	StereoMode      uint `ebml:"53B8" ebmldef:"0"`
	PixelWidth      uint `ebml:"B0"`
	PixelHeight     uint `ebml:"BA"`
	PixelCropBottom uint `ebml:"54AA" ebmldef:"0"`
	PixelCropTop    uint `ebml:"54BB" ebmldef:"0"`
	PixelCropLeft   uint `ebml:"54CC" ebmldef:"0"`
	PixelCropRight  uint `ebml:"54DD" ebmldef:"0"`
	DisplayWidth    uint `ebml:"54B0" ebmldeflink:"PixelWidth"`
	DisplayHeight   uint `ebml:"54BA" ebmldeflink:"PixelHeight"`
	DisplayUnit     uint `ebml:"54B2" ebmldef:"0"`
	AspectRatioType uint `ebml:"54B3" ebmldef:"0"`
}

type WebM

type WebM struct {
	Header  `ebml:"1a45dfa3"`
	Segment `ebml:"18538067"`
}

func (*WebM) FindFirstAudioTrack

func (w *WebM) FindFirstAudioTrack() *TrackEntry

func (*WebM) FindFirstVideoTrack

func (w *WebM) FindFirstVideoTrack() *TrackEntry

Jump to

Keyboard shortcuts

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