Documentation ¶
Index ¶
- Constants
- type AlphaMode
- type AspectRatioType
- type Attachment
- type AttachmentID
- type AudioTrack
- type Block
- type BlockAddition
- type BlockAdditionID
- type BlockGroup
- type ChapterAtom
- type ChapterCodec
- type ChapterCommand
- type ChapterDisplay
- type ChapterID
- type ChapterProcess
- type ChapterTranslate
- type ChromaSiting
- type Cluster
- type ClusterID
- type Colour
- type ColourRange
- type Compression
- type CompressionAlgo
- type ContentEncoding
- type CuePoint
- type CueTrackPosition
- type DisplayUnit
- type Duration
- type EBML
- type Edition
- type EditionID
- type EncodingScope
- type EncodingType
- type Encryption
- type FieldOrder
- type File
- type ID
- type Info
- type InterlaceType
- type MasteringMetadata
- type MatrixCoefficients
- type PlaneType
- type Position
- type Primaries
- type Reader
- type Seek
- type SeekHead
- type Segment
- type SegmentID
- type SimpleTag
- type StereoMode
- type Tag
- type Target
- type Time
- type TimeSlice
- type Track
- type TrackEntry
- type TrackID
- type TrackNumber
- type TrackOperation
- type TrackPlane
- type TrackTranslate
- type TrackType
- type TransferCharacteristics
- type TranslateID
- type TranslateTrackID
- type VideoTrack
Constants ¶
const ( LacingNone uint8 = iota LacingXiph LacingFixedSize LacingEBML )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AspectRatioType ¶
type AspectRatioType uint8
const ( AspectRatioFreeResizing AspectRatioType = iota AspectRatioKeep AspectRatioFixed )
AspectRatioTypes
type Attachment ¶
type Attachment struct { ID AttachmentID `ebml:"46AE"` Description string `ebml:"467E,omitempty" json:",omitempty"` Name string `ebml:"466E"` MimeType string `ebml:"4660"` Data []byte `ebml:"465C"` }
Attachment describes attached files.
type AttachmentID ¶
type AttachmentID uint8
type AudioTrack ¶
type AudioTrack struct { SamplingFreq float64 `ebml:"B5,8000"` OutputSamplingFreq float64 `ebml:"78B5,omitempty" json:",omitempty"` Channels int `ebml:"9F,1"` BitDepth int `ebml:"6264,omitempty" json:",omitempty"` }
AudioTrack contains information that is specific for audio tracks.
type Block ¶
type Block struct { TrackNumber TrackNumber Timecode int16 Flags uint8 Frames int }
Block contains the actual data to be rendered and a timestamp.
type BlockAddition ¶
type BlockAddition struct { ID BlockAdditionID `ebml:"EE,1"` Data []byte `ebml:"A5"` }
BlockAdd contains additional blocks to complete the main one.
type BlockAdditionID ¶
type BlockAdditionID uint64
type BlockGroup ¶
type BlockGroup struct { Block *Block `ebml:"A1" json:",omitempty"` Additions []*BlockAddition `ebml:"75A1>A6,omitempty" json:",omitempty"` Duration Duration `ebml:"9B,omitempty" json:",omitempty"` ReferencePriority int64 `ebml:"FA"` ReferenceBlock []Time `ebml:"FB,omitempty" json:",omitempty"` CodecState []byte `ebml:"A4,omitempty" json:",omitempty"` DiscardPadding time.Duration `ebml:"75A2,omitempty" json:",omitempty"` Slices []*TimeSlice `ebml:"8E>E8,omitempty" json:",omitempty"` }
BlockGroup contains a single Block and a relative information.
type ChapterAtom ¶
type ChapterAtom struct { ID ChapterID `ebml:"73C4"` StringID string `ebml:"5654,omitempty" json:",omitempty"` TimeStart Time `ebml:"91"` TimeEnd Time `ebml:"92,omitempty" json:",omitempty"` Hidden bool `ebml:"98"` Enabled bool `ebml:"4598,true"` SegmentID SegmentID `ebml:"6E67,omitempty" json:",omitempty"` EditionID EditionID `ebml:"6EBC,omitempty" json:",omitempty"` PhysicalEquiv int `ebml:"63C3,omitempty" json:",omitempty"` Tracks []TrackID `ebml:"8F>89,omitempty" json:",omitempty"` Displays []*ChapterDisplay `ebml:"80,omitempty" json:",omitempty"` Processes []*ChapterProcess `ebml:"6944,omitempty" json:",omitempty"` }
ChapterAtom contains the atom information to use as the chapter atom.
type ChapterCodec ¶
type ChapterCodec uint8
const ( ChapterCodecMatroska ChapterCodec = iota ChapterCodecDVD )
type ChapterCommand ¶
ChapterCommand contains all the commands associated to the atom.
type ChapterDisplay ¶
type ChapterDisplay struct { String string `ebml:"85"` Language string `ebml:"437C,eng"` // See ISO-639-2 Country string `ebml:"437E,omitempty" json:",omitempty"` // See IANA ccTLDs }
ChapterDisplay contains all possible strings to use for the chapter display.
type ChapterProcess ¶
type ChapterProcess struct { CodecID ChapterCodec `ebml:"6955"` Private []byte `ebml:"450D,omitempty" json:",omitempty"` Command []*ChapterCommand `ebml:"6911,omitempty" json:",omitempty"` }
ChapterProcess describes the atom processing commands.
type ChapterTranslate ¶
type ChapterTranslate struct { EditionIDs []EditionID `ebml:"69FC,omitempty" json:",omitempty"` Codec ChapterCodec `ebml:"69BF"` ID TranslateID `ebml:"69A5"` }
ChapterTranslate contains tuple of corresponding ID used by chapter codecs to represent a Segment.
type ChromaSiting ¶
type ChromaSiting uint8
const ( ChromaSitingUnspecified ChromaSiting = iota ChromaSitingCollocated ChromaSitingHalf )
ChromaSitings
type Cluster ¶
type Cluster struct { Timecode Time `ebml:"E7"` SilentTracks []TrackNumber `ebml:"5854>58D7,omitempty" json:",omitempty"` Position Position `ebml:"A7,omitempty" json:",omitempty"` PrevSize int64 `ebml:"AB,omitempty" json:",omitempty"` SimpleBlock []*Block `ebml:"A3,omitempty" json:",omitempty"` BlockGroup []*BlockGroup `ebml:"A0,omitempty" json:",omitempty"` }
Cluster is a Top-Level Element containing the Block structure.
type Colour ¶
type Colour struct { MatrixCoefficients MatrixCoefficients `ebml:"55B1,2,omitempty" json:",omitempty"` BitsPerChannel int `ebml:"55B2,omitempty" json:",omitempty"` ChromaSubsamplingHorz int `ebml:"55B3,omitempty" json:",omitempty"` ChromaSubsamplingVert int `ebml:"55B4,omitempty" json:",omitempty"` CbSubsamplingHorz int `ebml:"55B5,omitempty" json:",omitempty"` CbSubsamplingVert int `ebml:"55B6,omitempty" json:",omitempty"` ChromaSitingHorz ChromaSiting `ebml:"55B7,omitempty" json:",omitempty"` ChromaSitingVert ChromaSiting `ebml:"55B8,omitempty" json:",omitempty"` ColourRange ColourRange `ebml:"55B9,omitempty" json:",omitempty"` TransferCharacteristics TransferCharacteristics `ebml:"55BA,omitempty" json:",omitempty"` Primaries Primaries `ebml:"55BB,2,omitempty" json:",omitempty"` MaxCLL int64 `ebml:"55BC,omitempty" json:",omitempty"` MaxFALL int64 `ebml:"55BD,omitempty" json:",omitempty"` MasteringMetadata *MasteringMetadata `ebml:"55D0"` }
Colour describes the colour format settings.
type ColourRange ¶
type ColourRange uint8
const ( ColourRangeUnspecified ColourRange = iota ColourRangeBroadcast ColourRangeFull ColourRangeDefined )
ColourRange
type Compression ¶
type Compression struct { Algo CompressionAlgo `ebml:"4254"` Settings []byte `ebml:"4255,omitempty" json:",omitempty"` }
Compression describes the compression used.
type CompressionAlgo ¶
type CompressionAlgo uint8
const ( CompressionAlgoZlib CompressionAlgo = 0 CompressionAlgoHeaderStripping CompressionAlgo = 3 )
type ContentEncoding ¶
type ContentEncoding struct { Order int `ebml:"5031"` Scope EncodingScope `ebml:"5032,1"` Type EncodingType `ebml:"5033"` Compression *Compression `ebml:"5034,omitempty" json:",omitempty"` Encryption *Encryption `ebml:"5035,omitempty" json:",omitempty"` }
ContentEncoding contains settings for several content encoding mechanisms like compression or encryption.
type CuePoint ¶
type CuePoint struct { Time Time `ebml:"B3"` TrackPositions []*CueTrackPosition `ebml:"B7"` }
CuePoint contains all information relative to a seek point in the Segment.
type CueTrackPosition ¶
type CueTrackPosition struct { Track TrackNumber `ebml:"F7"` ClusterPosition Position `ebml:"F1"` RelativePosition Position `ebml:"F0,omitempty" json:",omitempty"` Duration Duration `ebml:"B2,omitempty" json:",omitempty"` BlockNumber int `ebml:"5378,1,omitempty" json:",omitempty"` CodecState Position `ebml:"EA,omitempty" json:",omitempty"` References []Time `ebml:"DB>96,omitempty" json:",omitempty"` }
CueTrackPosition contains positions for different tracks corresponding to the timestamp.
type DisplayUnit ¶
type DisplayUnit uint8
const ( DisplayUnitPixels DisplayUnit = iota DisplayUnitCentimeters DisplayUnitInches DisplayUnitAspectRatio )
DisplayUnits
type EBML ¶
type EBML struct { Version int `ebml:"4286,1"` ReadVersion int `ebml:"42F7,1"` MaxIDLength int `ebml:"42F2,4"` MaxSizeLength int `ebml:"42F3,8"` DocType string `ebml:"4282,matroska"` DocTypeVersion int `ebml:"4287,1"` DocTypeReadVersion int `ebml:"4285,1"` }
The EBML is a top level element contains a description of the file type.
type Edition ¶
type Edition struct { ID EditionID `ebml:"45BC,omitempty" json:",omitempty"` Hidden bool `ebml:"45BD"` Default bool `ebml:"45DB"` Ordered bool `ebml:"45DD,omitempty" json:",omitempty"` Atoms []*ChapterAtom `ebml:"B6"` }
Edition contains all information about a Segment edition.
type EncodingScope ¶
type EncodingScope uint8
const ( EncodingScopeAll EncodingScope = 1 EncodingScopePrivate EncodingScope = 2 EncodingScopeNext EncodingScope = 4 )
EncodingScopes
type EncodingType ¶
type EncodingType uint8
const ( EncodingTypeCompression EncodingType = iota EncodingTypeEncryption )
type Encryption ¶
type Encryption struct { Algo uint8 `ebml:"47E1,omitempty" json:",omitempty"` KeyID []byte `ebml:"47E2,omitempty" json:",omitempty"` Signature []byte `ebml:"47E3,omitempty" json:",omitempty"` SignKeyID []byte `ebml:"47E4,omitempty" json:",omitempty"` SignAlgo uint8 `ebml:"47E5,omitempty" json:",omitempty"` SignHashAlgo uint8 `ebml:"47E6,omitempty" json:",omitempty"` }
Encryption describes the encryption used.
type FieldOrder ¶
type FieldOrder uint8
const ( FieldOrderProgressive FieldOrder = 0 FieldOrderTop FieldOrder = 1 FieldOrderUndetermined FieldOrder = 2 FieldOrderBottom FieldOrder = 6 FieldOrderDisplayBottomStoreTop FieldOrder = 9 FieldOrderDisplayTopStoreBottom FieldOrder = 14 )
FieldOrders
type File ¶
File represents a Matroska encoded file. See the specification https://matroska.org/technical/specs/index.html
type Info ¶
type Info struct { ID SegmentID `ebml:"73A4,omitempty" json:",omitempty"` Filename string `ebml:"7384,omitempty" json:",omitempty"` PrevID SegmentID `ebml:"3CB923,omitempty" json:",omitempty"` PrevFilename string `ebml:"3C83AB,omitempty" json:",omitempty"` NextID SegmentID `ebml:"3EB923,omitempty" json:",omitempty"` NextFilename string `ebml:"3E83BB,omitempty" json:",omitempty"` SegmentFamily SegmentID `ebml:"4444,omitempty" json:",omitempty"` ChapterTranslate []*ChapterTranslate `ebml:"6924,omitempty" json:",omitempty"` TimecodeScale time.Duration `ebml:"2AD7B1,1000000"` Duration float64 `ebml:"4489,omitempty" json:",omitempty"` Date time.Time `ebml:"4461,omitempty" json:",omitempty"` Title string `ebml:"7BA9,omitempty" json:",omitempty"` MuxingApp string `ebml:"4D80"` WritingApp string `ebml:"5741"` }
Info contains miscellaneous general information and statistics on the file.
type InterlaceType ¶
type InterlaceType uint8
const ( InterlaceTypeInterlaced InterlaceType = 1 InterlaceTypeProgressive InterlaceType = 2 )
InterlaceTypes
type MasteringMetadata ¶
type MasteringMetadata struct { PrimaryRChromaX float64 `ebml:"55D1,omitempty" json:",omitempty"` PrimaryRChromaY float64 `ebml:"55D2,omitempty" json:",omitempty"` PrimaryGChromaX float64 `ebml:"55D3,omitempty" json:",omitempty"` PrimaryGChromaY float64 `ebml:"55D4,omitempty" json:",omitempty"` PrimaryBChromaX float64 `ebml:"55D5,omitempty" json:",omitempty"` PrimaryBChromaY float64 `ebml:"55D6,omitempty" json:",omitempty"` WhitePointChromaX float64 `ebml:"55D7,omitempty" json:",omitempty"` WhitePointChromaY float64 `ebml:"55D8,omitempty" json:",omitempty"` LuminanceMax float64 `ebml:"55D9,omitempty" json:",omitempty"` LuminanceMin float64 `ebml:"55DA,omitempty" json:",omitempty"` }
MasteringMetadata represents SMPTE 2086 mastering data.
type MatrixCoefficients ¶
type MatrixCoefficients uint8
MatrixCoefficients, see Table 4 of ISO/IEC 23001-8:2013/DCOR1
type SeekHead ¶
type SeekHead struct {
Seeks []*Seek `ebml:"4DBB"`
}
SeekHead contains the position of other Top-Level Elements.
type Segment ¶
type Segment struct { SeekHead []*SeekHead `ebml:"114D9B74,omitempty" json:",omitempty"` Info []*Info `ebml:"1549A966" json:",omitempty"` Cluster []*Cluster `ebml:"1F43B675,omitempty" json:",omitempty"` Tracks []*Track `ebml:"1654AE6B,omitempty" json:",omitempty"` Cues []*CuePoint `ebml:"1C53BB6B>BB,omitempty" json:",omitempty"` Attachments []*Attachment `ebml:"1941A469>61A7"` Chapters []*Edition `ebml:"1043A770>45B9"` Tags []*Tag `ebml:"1254C367>7373"` }
Segment is the Root Element that contains all other Top-Level Elements.
type SegmentID ¶
type SegmentID []byte
SegmentID is a randomly generated unique 128bit identifier of Segment/SegmentFamily.
type SimpleTag ¶
type SimpleTag struct { Name string `ebml:"45A3"` Language string `ebml:"447A,und"` Default bool `ebml:"4484,true"` String string `ebml:"4487,omitempty" json:",omitempty"` Binary []byte `ebml:"4485,omitempty" json:",omitempty"` }
SimpleTag contains general information about the target.
func NewSimpleTag ¶
type StereoMode ¶
type StereoMode uint8
const ( StereoModeMono StereoMode = iota StereoModeHorizontalLeft StereoModeVerticalRight StereoModeVerticalLeft StereoModeCheckboardRight StereoModeCheckboardLeft StereoModeInterleavedRight StereoModeInterleavedLeft StereoModeColumnInterleavedRight StereoModeAnaglyphCyanRed StereoModeHorizontalRight StereoModeAnaglyphGreenMagenta StereoModeLacedLeft StereoModeLacedRight )
StereoModes
type Target ¶
type Target struct { TypeValue int `ebml:"68CA,50,omitempty" json:",omitempty"` Type string `ebml:"63CA,omitempty" json:",omitempty"` TrackIDs []TrackID `ebml:"63C5,omitempty" json:",omitempty"` EditionIDs []EditionID `ebml:"63C9,omitempty" json:",omitempty"` ChapterIDs []ChapterID `ebml:"63C4,omitempty" json:",omitempty"` AttachmentIDs []AttachmentID `ebml:"63C6,omitempty" json:",omitempty"` }
Target contains all IDs where the specified meta data apply.
type Track ¶
type Track struct {
Entries []*TrackEntry `ebml:"AE"`
}
Track is a Top-Level Element of information with track description.
type TrackEntry ¶
type TrackEntry struct { Number TrackNumber `ebml:"D7"` ID TrackID `ebml:"73C5"` Type TrackType `ebml:"83"` Enabled bool `ebml:"B9,true"` Default bool `ebml:"88,true"` Forced bool `ebml:"55AA"` Lacing bool `ebml:"9C,true"` MinCache int `ebml:"6DE7"` MaxCache int `ebml:"6DF8,omitempty" json:",omitempty"` DefaultDuration time.Duration `ebml:"23E383,omitempty" json:",omitempty"` DefaultDecodedFieldDuration time.Duration `ebml:"234E7A,omitempty" json:",omitempty"` MaxBlockAdditionID BlockAdditionID `ebml:"55EE"` Name string `ebml:"536E,omitempty" json:",omitempty"` Language string `ebml:"22B59C,eng,omitempty" json:",omitempty"` CodecID string `ebml:"86"` CodecPrivate []byte `ebml:"63A2,omitempty" json:",omitempty"` CodecName string `ebml:"258688,omitempty" json:",omitempty"` AttachmentLink AttachmentID `ebml:"7446,omitempty" json:",omitempty"` CodecDecodeAll bool `ebml:"AA,true"` TrackOverlay []TrackNumber `ebml:"6FAB,omitempty" json:",omitempty"` CodecDelay time.Duration `ebml:"56AA,omitempty" json:",omitempty"` SeekPreRoll time.Duration `ebml:"56BB"` TrackTranslate []*TrackTranslate `ebml:"6624,omitempty" json:",omitempty"` Video *VideoTrack `ebml:"E0,omitempty" json:",omitempty"` Audio *AudioTrack `ebml:"E1,omitempty" json:",omitempty"` TrackOperation *TrackOperation `ebml:"E2,omitempty" json:",omitempty"` ContentEncodings []*ContentEncoding `ebml:"6D80>6240,omitempty" json:",omitempty"` }
TrackEntry describes a track with all Elements.
type TrackNumber ¶
type TrackNumber int
type TrackOperation ¶
type TrackOperation struct { CombinePlanes []*TrackPlane `ebml:"E3>E4,omitempty" json:",omitempty"` JoinBlocks []TrackID `ebml:"E9>ED,omitempty" json:",omitempty"` }
TrackOperation describes an operation that needs to be applied on tracks to create the virtual track.
type TrackPlane ¶
TrackPlane contains a video plane track that need to be combined to create this track.
type TrackTranslate ¶
type TrackTranslate struct { EditionIDs []EditionID `ebml:"66FC,omitempty" json:",omitempty"` Codec ChapterCodec `ebml:"66BF"` TranslateTrackID `ebml:"66A5"` }
TrackTranslate describes a track identification for the given Chapter Codec.
type TransferCharacteristics ¶
type TransferCharacteristics uint8
TransferCharacteristics, see Table 3 of ISO/IEC 23001-8:2013/DCOR1
type TranslateID ¶
type TranslateID []byte
type TranslateTrackID ¶
type TranslateTrackID []byte
type VideoTrack ¶
type VideoTrack struct { Interlaced InterlaceType `ebml:"9A"` FieldOrder FieldOrder `ebml:"9D,2"` StereoMode StereoMode `ebml:"53B8,omitempty" json:"stereoMode,omitempty"` AlphaMode *AlphaMode `ebml:"53C0,omitempty" json:"alphaMode,omitempty"` Width int `ebml:"B0"` Height int `ebml:"BA"` CropBottom int `ebml:"54AA,omitempty" json:",omitempty"` CropTop int `ebml:"54BB,omitempty" json:",omitempty"` CropLeft int `ebml:"54CC,omitempty" json:",omitempty"` CropRight int `ebml:"54DD,omitempty" json:",omitempty"` DisplayWidth int `ebml:"54B0,omitempty" json:",omitempty"` DisplayHeight int `ebml:"54BA,omitempty" json:",omitempty"` DisplayUnit DisplayUnit `ebml:"54B2,omitempty" json:",omitempty"` AspectRatioType AspectRatioType `ebml:"54B3,omitempty" json:",omitempty"` ColourSpace uint32 `ebml:"2EB524,omitempty" json:",omitempty"` Colour *Colour `ebml:"55B0,omitempty" json:",omitempty"` }
VideoTrack contains information that is specific for video tracks.