fmp4io

package
v0.0.0-...-880251e Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPUS = Tag(0x4f707573)
	DOPS = Tag(0x644f7073)
)
View Source
const (
	VideoHandler = 0x76696465 // vide
	SoundHandler = 0x736f756e // soun
)
View Source
const AVC1 = Tag(0x61766331)
View Source
const AVCC = Tag(0x61766343)
View Source
const CTTS = Tag(0x63747473)
View Source
const DINF = Tag(0x64696e66)
View Source
const DREF = Tag(0x64726566)
View Source
const ESDS = Tag(0x65736473)
View Source
const FTYP = Tag(0x66747970)
View Source
const HDLR = Tag(0x68646c72)
View Source
const MDAT = Tag(0x6d646174)
View Source
const MDHD = Tag(0x6d646864)
View Source
const MDIA = Tag(0x6d646961)
View Source
const MFHD = Tag(0x6d666864)
View Source
const MINF = Tag(0x6d696e66)
View Source
const MOOF = Tag(0x6d6f6f66)
View Source
const MOOV = Tag(0x6d6f6f76)
View Source
const MP4A = Tag(0x6d703461)
View Source
const MVEX = Tag(0x6d766578)
View Source
const MVHD = Tag(0x6d766864)
View Source
const PASP = Tag(0x70617370)
View Source
const SIDX = Tag(0x73696478)
View Source
const SMHD = Tag(0x736d6864)
View Source
const STBL = Tag(0x7374626c)
View Source
const STCO = Tag(0x7374636f)
View Source
const STSC = Tag(0x73747363)
View Source
const STSD = Tag(0x73747364)
View Source
const STSS = Tag(0x73747373)
View Source
const STSZ = Tag(0x7374737a)
View Source
const STTS = Tag(0x73747473)
View Source
const STYP = Tag(0x73747970)
View Source
const TFDT = Tag(0x74666474)
View Source
const TFHD = Tag(0x74666864)

TFHD is the atom type for TrackFragHeader

View Source
const TKHD = Tag(0x746b6864)
View Source
const TRAF = Tag(0x74726166)
View Source
const TRAK = Tag(0x7472616b)
View Source
const TREX = Tag(0x74726578)
View Source
const TRUN = Tag(0x7472756e)

TRUN is the atom type for TrackFragRun

View Source
const URL = Tag(0x75726c20)
View Source
const VMHD = Tag(0x766d6864)

Variables

This section is empty.

Functions

func FprintAtom

func FprintAtom(out io.Writer, root Atom)

func GetFixed16

func GetFixed16(b []byte) float64

func GetFixed32

func GetFixed32(b []byte) float64

func GetTime32

func GetTime32(b []byte) (t time.Time)

func GetTime64

func GetTime64(b []byte) (t time.Time)

func PrintAtom

func PrintAtom(root Atom)

func PutFixed16

func PutFixed16(b []byte, f float64)

func PutFixed32

func PutFixed32(b []byte, f float64)

func PutTime32

func PutTime32(b []byte, t time.Time)

func PutTime64

func PutTime64(b []byte, t time.Time)

Types

type AVC1Conf

type AVC1Conf struct {
	Data []byte
	AtomPos
}

func (AVC1Conf) Children

func (a AVC1Conf) Children() (r []Atom)

func (AVC1Conf) Len

func (a AVC1Conf) Len() (n int)

func (AVC1Conf) Marshal

func (a AVC1Conf) Marshal(b []byte) (n int)

func (AVC1Conf) Tag

func (a AVC1Conf) Tag() Tag

func (*AVC1Conf) Unmarshal

func (a *AVC1Conf) Unmarshal(b []byte, offset int) (n int, err error)

type AVC1Desc

type AVC1Desc struct {
	DataRefIdx           int16
	Version              int16
	Revision             int16
	Vendor               int32
	TemporalQuality      int32
	SpatialQuality       int32
	Width                int16
	Height               int16
	HorizontalResolution float64
	VorizontalResolution float64
	FrameCount           int16
	CompressorName       [32]byte
	Depth                int16
	ColorTableId         int16
	Conf                 *AVC1Conf
	PixelAspect          *PixelAspect
	Unknowns             []Atom
	AtomPos
}

func (AVC1Desc) Children

func (a AVC1Desc) Children() (r []Atom)

func (AVC1Desc) Len

func (a AVC1Desc) Len() (n int)

func (AVC1Desc) Marshal

func (a AVC1Desc) Marshal(b []byte) (n int)

func (AVC1Desc) Tag

func (a AVC1Desc) Tag() Tag

func (*AVC1Desc) Unmarshal

func (a *AVC1Desc) Unmarshal(b []byte, offset int) (n int, err error)

type Atom

type Atom interface {
	Pos() (int, int)
	Tag() Tag
	Marshal([]byte) int
	Unmarshal([]byte, int) (int, error)
	Len() int
	Children() []Atom
}

func FindChildren

func FindChildren(root Atom, tag Tag) Atom

func FindChildrenByName

func FindChildrenByName(root Atom, tag string) Atom

func ReadFileAtoms

func ReadFileAtoms(r io.ReadSeeker) (atoms []Atom, err error)

type AtomPos

type AtomPos struct {
	Offset int
	Size   int
}

func (AtomPos) Pos

func (a AtomPos) Pos() (int, int)

type ChunkOffset

type ChunkOffset struct {
	Version uint8
	Flags   uint32
	Entries []uint32
	AtomPos
}

func (ChunkOffset) Children

func (a ChunkOffset) Children() (r []Atom)

func (ChunkOffset) Len

func (a ChunkOffset) Len() (n int)

func (ChunkOffset) Marshal

func (a ChunkOffset) Marshal(b []byte) (n int)

func (ChunkOffset) String

func (a ChunkOffset) String() string

func (ChunkOffset) Tag

func (a ChunkOffset) Tag() Tag

func (*ChunkOffset) Unmarshal

func (a *ChunkOffset) Unmarshal(b []byte, offset int) (n int, err error)

type CompositionOffset

type CompositionOffset struct {
	Version uint8
	Flags   uint32
	Entries []CompositionOffsetEntry
	AtomPos
}

func (CompositionOffset) Children

func (a CompositionOffset) Children() (r []Atom)

func (CompositionOffset) Len

func (a CompositionOffset) Len() (n int)

func (CompositionOffset) Marshal

func (a CompositionOffset) Marshal(b []byte) (n int)

func (CompositionOffset) String

func (a CompositionOffset) String() string

func (CompositionOffset) Tag

func (a CompositionOffset) Tag() Tag

func (*CompositionOffset) Unmarshal

func (a *CompositionOffset) Unmarshal(b []byte, offset int) (n int, err error)

type CompositionOffsetEntry

type CompositionOffsetEntry struct {
	Count  uint32
	Offset uint32
}

type DataInfo

type DataInfo struct {
	Refer    *DataRefer
	Unknowns []Atom
	AtomPos
}

func (DataInfo) Children

func (a DataInfo) Children() (r []Atom)

func (DataInfo) Len

func (a DataInfo) Len() (n int)

func (DataInfo) Marshal

func (a DataInfo) Marshal(b []byte) (n int)

func (DataInfo) Tag

func (a DataInfo) Tag() Tag

func (*DataInfo) Unmarshal

func (a *DataInfo) Unmarshal(b []byte, offset int) (n int, err error)

type DataRefer

type DataRefer struct {
	Version uint8
	Flags   uint32
	Url     *DataReferUrl
	AtomPos
}

func (DataRefer) Children

func (a DataRefer) Children() (r []Atom)

func (DataRefer) Len

func (a DataRefer) Len() (n int)

func (DataRefer) Marshal

func (a DataRefer) Marshal(b []byte) (n int)

func (DataRefer) Tag

func (a DataRefer) Tag() Tag

func (*DataRefer) Unmarshal

func (a *DataRefer) Unmarshal(b []byte, offset int) (n int, err error)

type DataReferUrl

type DataReferUrl struct {
	Version uint8
	Flags   uint32
	AtomPos
}

func (DataReferUrl) Children

func (a DataReferUrl) Children() (r []Atom)

func (DataReferUrl) Len

func (a DataReferUrl) Len() (n int)

func (DataReferUrl) Marshal

func (a DataReferUrl) Marshal(b []byte) (n int)

func (DataReferUrl) Tag

func (a DataReferUrl) Tag() Tag

func (*DataReferUrl) Unmarshal

func (a *DataReferUrl) Unmarshal(b []byte, offset int) (n int, err error)

type Dummy

type Dummy struct {
	Data []byte
	Tag_ Tag
	AtomPos
}

func (Dummy) Children

func (a Dummy) Children() []Atom

func (Dummy) Len

func (a Dummy) Len() int

func (Dummy) Marshal

func (a Dummy) Marshal(b []byte) int

func (Dummy) Tag

func (a Dummy) Tag() Tag

func (*Dummy) Unmarshal

func (a *Dummy) Unmarshal(b []byte, offset int) (n int, err error)

type ElemStreamDesc

type ElemStreamDesc struct {
	StreamDescriptor *esio.StreamDescriptor
	AtomPos
}

func (ElemStreamDesc) Children

func (a ElemStreamDesc) Children() []Atom

func (ElemStreamDesc) Len

func (a ElemStreamDesc) Len() (n int)

func (ElemStreamDesc) Marshal

func (a ElemStreamDesc) Marshal(b []byte) (n int)

func (ElemStreamDesc) Tag

func (a ElemStreamDesc) Tag() Tag

func (*ElemStreamDesc) Unmarshal

func (a *ElemStreamDesc) Unmarshal(b []byte, offset int) (n int, err error)

type FileType

type FileType struct {
	MajorBrand       uint32
	MinorVersion     uint32
	CompatibleBrands []uint32
	AtomPos
}

func (FileType) Children

func (f FileType) Children() []Atom

func (FileType) Len

func (f FileType) Len() int

func (FileType) Marshal

func (f FileType) Marshal(b []byte) (n int)

func (FileType) Tag

func (t FileType) Tag() Tag

func (*FileType) Unmarshal

func (f *FileType) Unmarshal(b []byte, offset int) (n int, err error)

type FullAtom

type FullAtom struct {
	Version uint8
	Flags   uint32
	AtomPos
}

type HandlerRefer

type HandlerRefer struct {
	Version    uint8
	Flags      uint32
	Predefined uint32
	Type       uint32
	Reserved   [3]uint32
	Name       string
	AtomPos
}

func (HandlerRefer) Children

func (a HandlerRefer) Children() (r []Atom)

func (HandlerRefer) Len

func (a HandlerRefer) Len() (n int)

func (HandlerRefer) Marshal

func (a HandlerRefer) Marshal(b []byte) (n int)

func (HandlerRefer) Tag

func (a HandlerRefer) Tag() Tag

func (*HandlerRefer) Unmarshal

func (a *HandlerRefer) Unmarshal(b []byte, offset int) (n int, err error)

type MP4ADesc

type MP4ADesc struct {
	DataRefIdx       int16
	Version          int16
	RevisionLevel    int16
	Vendor           int32
	NumberOfChannels int16
	SampleSize       int16
	CompressionId    int16
	SampleRate       float64
	Conf             *ElemStreamDesc
	Unknowns         []Atom
	AtomPos
}

func (MP4ADesc) Children

func (a MP4ADesc) Children() (r []Atom)

func (MP4ADesc) Len

func (a MP4ADesc) Len() (n int)

func (MP4ADesc) Marshal

func (a MP4ADesc) Marshal(b []byte) (n int)

func (MP4ADesc) Tag

func (a MP4ADesc) Tag() Tag

func (*MP4ADesc) Unmarshal

func (a *MP4ADesc) Unmarshal(b []byte, offset int) (n int, err error)

type Media

type Media struct {
	Header   *MediaHeader
	Handler  *HandlerRefer
	Info     *MediaInfo
	Unknowns []Atom
	AtomPos
}

func (Media) Children

func (a Media) Children() (r []Atom)

func (Media) Len

func (a Media) Len() (n int)

func (Media) Marshal

func (a Media) Marshal(b []byte) (n int)

func (Media) Tag

func (a Media) Tag() Tag

func (*Media) Unmarshal

func (a *Media) Unmarshal(b []byte, offset int) (n int, err error)

type MediaHeader

type MediaHeader struct {
	Version    uint8
	Flags      uint32
	CreateTime time.Time
	ModifyTime time.Time
	TimeScale  uint32
	Duration   uint32
	Language   int16
	Quality    int16
	AtomPos
}

func (MediaHeader) Children

func (a MediaHeader) Children() (r []Atom)

func (MediaHeader) Len

func (a MediaHeader) Len() (n int)

func (MediaHeader) Marshal

func (a MediaHeader) Marshal(b []byte) (n int)

func (MediaHeader) Tag

func (a MediaHeader) Tag() Tag

func (*MediaHeader) Unmarshal

func (a *MediaHeader) Unmarshal(b []byte, offset int) (n int, err error)

type MediaInfo

type MediaInfo struct {
	Sound    *SoundMediaInfo
	Video    *VideoMediaInfo
	Data     *DataInfo
	Sample   *SampleTable
	Unknowns []Atom
	AtomPos
}

func (MediaInfo) Children

func (a MediaInfo) Children() (r []Atom)

func (MediaInfo) Len

func (a MediaInfo) Len() (n int)

func (MediaInfo) Marshal

func (a MediaInfo) Marshal(b []byte) (n int)

func (MediaInfo) Tag

func (a MediaInfo) Tag() Tag

func (*MediaInfo) Unmarshal

func (a *MediaInfo) Unmarshal(b []byte, offset int) (n int, err error)

type Movie

type Movie struct {
	Header      *MovieHeader
	MovieExtend *MovieExtend
	Tracks      []*Track
	Unknowns    []Atom
	AtomPos
}

func (Movie) Children

func (a Movie) Children() (r []Atom)

func (Movie) Len

func (a Movie) Len() (n int)

func (Movie) Marshal

func (a Movie) Marshal(b []byte) (n int)

func (Movie) Tag

func (a Movie) Tag() Tag

func (*Movie) Unmarshal

func (a *Movie) Unmarshal(b []byte, offset int) (n int, err error)

type MovieExtend

type MovieExtend struct {
	Tracks   []*TrackExtend
	Unknowns []Atom
	AtomPos
}

func (MovieExtend) Children

func (a MovieExtend) Children() (r []Atom)

func (MovieExtend) Len

func (a MovieExtend) Len() (n int)

func (MovieExtend) Marshal

func (a MovieExtend) Marshal(b []byte) (n int)

func (MovieExtend) Tag

func (a MovieExtend) Tag() Tag

func (*MovieExtend) Unmarshal

func (a *MovieExtend) Unmarshal(b []byte, offset int) (n int, err error)

type MovieFrag

type MovieFrag struct {
	Header   *MovieFragHeader
	Tracks   []*TrackFrag
	Unknowns []Atom
	AtomPos
}

func (MovieFrag) Children

func (a MovieFrag) Children() (r []Atom)

func (MovieFrag) Len

func (a MovieFrag) Len() (n int)

func (MovieFrag) Marshal

func (a MovieFrag) Marshal(b []byte) (n int)

func (MovieFrag) Tag

func (a MovieFrag) Tag() Tag

func (*MovieFrag) Unmarshal

func (a *MovieFrag) Unmarshal(b []byte, offset int) (n int, err error)

type MovieFragHeader

type MovieFragHeader struct {
	Version uint8
	Flags   uint32
	Seqnum  uint32
	AtomPos
}

func (MovieFragHeader) Children

func (a MovieFragHeader) Children() (r []Atom)

func (MovieFragHeader) Len

func (a MovieFragHeader) Len() (n int)

func (MovieFragHeader) Marshal

func (a MovieFragHeader) Marshal(b []byte) (n int)

func (MovieFragHeader) Tag

func (a MovieFragHeader) Tag() Tag

func (*MovieFragHeader) Unmarshal

func (a *MovieFragHeader) Unmarshal(b []byte, offset int) (n int, err error)

type MovieHeader

type MovieHeader struct {
	Version         uint8
	Flags           uint32
	CreateTime      time.Time
	ModifyTime      time.Time
	TimeScale       uint32
	Duration        uint32
	PreferredRate   float64
	PreferredVolume float64
	Matrix          [9]int32
	NextTrackID     uint32
	AtomPos
}

func (MovieHeader) Children

func (a MovieHeader) Children() (r []Atom)

func (MovieHeader) Len

func (a MovieHeader) Len() (n int)

func (MovieHeader) Marshal

func (a MovieHeader) Marshal(b []byte) (n int)

func (MovieHeader) String

func (a MovieHeader) String() string

func (MovieHeader) Tag

func (a MovieHeader) Tag() Tag

func (*MovieHeader) Unmarshal

func (a *MovieHeader) Unmarshal(b []byte, offset int) (n int, err error)

type OpusSampleEntry

type OpusSampleEntry struct {
	DataRefIdx       uint16
	NumberOfChannels uint16
	SampleSize       uint16
	CompressionID    uint16
	SampleRate       float64
	Conf             *OpusSpecificConfiguration
	AtomPos
}

func (OpusSampleEntry) Children

func (a OpusSampleEntry) Children() (r []Atom)

func (OpusSampleEntry) Len

func (a OpusSampleEntry) Len() (n int)

func (OpusSampleEntry) Marshal

func (a OpusSampleEntry) Marshal(b []byte) (n int)

func (OpusSampleEntry) Tag

func (a OpusSampleEntry) Tag() Tag

func (*OpusSampleEntry) Unmarshal

func (a *OpusSampleEntry) Unmarshal(b []byte, offset int) (n int, err error)

type OpusSpecificConfiguration

type OpusSpecificConfiguration struct {
	Version              uint8
	OutputChannelCount   uint8
	PreSkip              uint16
	InputSampleRate      uint32
	OutputGain           int16
	ChannelMappingFamily uint8
	AtomPos
}

func (OpusSpecificConfiguration) Children

func (a OpusSpecificConfiguration) Children() []Atom

func (OpusSpecificConfiguration) Len

func (a OpusSpecificConfiguration) Len() (n int)

func (OpusSpecificConfiguration) Marshal

func (a OpusSpecificConfiguration) Marshal(b []byte) (n int)

func (OpusSpecificConfiguration) Tag

func (*OpusSpecificConfiguration) Unmarshal

func (a *OpusSpecificConfiguration) Unmarshal(b []byte, offset int) (n int, err error)

type ParseError

type ParseError struct {
	Debug  string
	Offset int
	// contains filtered or unexported fields
}

func (*ParseError) Error

func (a *ParseError) Error() string

type PixelAspect

type PixelAspect struct {
	HorizontalSpacing uint32
	VerticalSpacing   uint32
	AtomPos
}

func (*PixelAspect) Children

func (a *PixelAspect) Children() (r []Atom)

func (PixelAspect) Len

func (a PixelAspect) Len() (n int)

func (PixelAspect) Marshal

func (a PixelAspect) Marshal(b []byte) (n int)

func (PixelAspect) Tag

func (a PixelAspect) Tag() Tag

func (*PixelAspect) Unmarshal

func (a *PixelAspect) Unmarshal(b []byte, offset int) (n int, err error)

type SampleDesc

type SampleDesc struct {
	Version  uint8
	AVC1Desc *AVC1Desc
	MP4ADesc *MP4ADesc
	OpusDesc *OpusSampleEntry
	Unknowns []Atom
	AtomPos
}

func (SampleDesc) Children

func (a SampleDesc) Children() (r []Atom)

func (SampleDesc) Len

func (a SampleDesc) Len() (n int)

func (SampleDesc) Marshal

func (a SampleDesc) Marshal(b []byte) (n int)

func (SampleDesc) Tag

func (a SampleDesc) Tag() Tag

func (*SampleDesc) Unmarshal

func (a *SampleDesc) Unmarshal(b []byte, offset int) (n int, err error)

type SampleFlags

type SampleFlags uint32
const (
	SampleIsNonSync       SampleFlags = 0x00010000
	SampleHasDependencies SampleFlags = 0x01000000
	SampleNoDependencies  SampleFlags = 0x02000000

	SampleNonKeyframe = SampleHasDependencies | SampleIsNonSync
)

fragment sample flags

type SampleSize

type SampleSize struct {
	Version    uint8
	Flags      uint32
	SampleSize uint32
	Entries    []uint32
	AtomPos
}

func (SampleSize) Children

func (a SampleSize) Children() (r []Atom)

func (SampleSize) Len

func (a SampleSize) Len() (n int)

func (SampleSize) Marshal

func (a SampleSize) Marshal(b []byte) (n int)

func (SampleSize) String

func (a SampleSize) String() string

func (SampleSize) Tag

func (a SampleSize) Tag() Tag

func (*SampleSize) Unmarshal

func (a *SampleSize) Unmarshal(b []byte, offset int) (n int, err error)

type SampleTable

type SampleTable struct {
	SampleDesc        *SampleDesc
	TimeToSample      *TimeToSample
	CompositionOffset *CompositionOffset
	SampleToChunk     *SampleToChunk
	SyncSample        *SyncSample
	ChunkOffset       *ChunkOffset
	SampleSize        *SampleSize
	AtomPos
}

func (SampleTable) Children

func (a SampleTable) Children() (r []Atom)

func (SampleTable) Len

func (a SampleTable) Len() (n int)

func (SampleTable) Marshal

func (a SampleTable) Marshal(b []byte) (n int)

func (SampleTable) Tag

func (a SampleTable) Tag() Tag

func (*SampleTable) Unmarshal

func (a *SampleTable) Unmarshal(b []byte, offset int) (n int, err error)

type SampleToChunk

type SampleToChunk struct {
	Version uint8
	Flags   uint32
	Entries []SampleToChunkEntry
	AtomPos
}

func (SampleToChunk) Children

func (a SampleToChunk) Children() (r []Atom)

func (SampleToChunk) Len

func (a SampleToChunk) Len() (n int)

func (SampleToChunk) Marshal

func (a SampleToChunk) Marshal(b []byte) (n int)

func (SampleToChunk) String

func (a SampleToChunk) String() string

func (SampleToChunk) Tag

func (a SampleToChunk) Tag() Tag

func (*SampleToChunk) Unmarshal

func (a *SampleToChunk) Unmarshal(b []byte, offset int) (n int, err error)

type SampleToChunkEntry

type SampleToChunkEntry struct {
	FirstChunk      uint32
	SamplesPerChunk uint32
	SampleDescId    uint32
}

type SegmentIndex

type SegmentIndex struct {
	FullAtom
	ReferenceID uint32
	TimeScale   uint32
	EarliestPTS uint64
	FirstOffset uint64
	References  []SegmentReference
}

func (SegmentIndex) Children

func (s SegmentIndex) Children() []Atom

func (SegmentIndex) Len

func (s SegmentIndex) Len() (n int)

func (SegmentIndex) Marshal

func (s SegmentIndex) Marshal(b []byte) (n int)

func (SegmentIndex) Tag

func (s SegmentIndex) Tag() Tag

func (*SegmentIndex) Unmarshal

func (s *SegmentIndex) Unmarshal(b []byte, offset int) (n int, err error)

type SegmentReference

type SegmentReference struct {
	ReferencesBox      bool
	ReferencedSize     uint32
	SubsegmentDuration uint32
	StartsWithSAP      bool
	SAPType            uint8
	SAPDeltaTime       uint32
}

type SegmentType

type SegmentType struct {
	MajorBrand       uint32
	MinorVersion     uint32
	CompatibleBrands []uint32
	AtomPos
}

func (SegmentType) Children

func (f SegmentType) Children() []Atom

func (SegmentType) Len

func (f SegmentType) Len() int

func (SegmentType) Marshal

func (f SegmentType) Marshal(b []byte) (n int)

func (SegmentType) Tag

func (t SegmentType) Tag() Tag

func (*SegmentType) Unmarshal

func (f *SegmentType) Unmarshal(b []byte, offset int) (n int, err error)

type SoundMediaInfo

type SoundMediaInfo struct {
	Version uint8
	Flags   uint32
	Balance int16
	AtomPos
}

func (SoundMediaInfo) Children

func (a SoundMediaInfo) Children() (r []Atom)

func (SoundMediaInfo) Len

func (a SoundMediaInfo) Len() (n int)

func (SoundMediaInfo) Marshal

func (a SoundMediaInfo) Marshal(b []byte) (n int)

func (SoundMediaInfo) Tag

func (a SoundMediaInfo) Tag() Tag

func (*SoundMediaInfo) Unmarshal

func (a *SoundMediaInfo) Unmarshal(b []byte, offset int) (n int, err error)

type SyncSample

type SyncSample struct {
	Version uint8
	Flags   uint32
	Entries []uint32
	AtomPos
}

func (SyncSample) Children

func (a SyncSample) Children() (r []Atom)

func (SyncSample) Len

func (a SyncSample) Len() (n int)

func (SyncSample) Marshal

func (a SyncSample) Marshal(b []byte) (n int)

func (SyncSample) String

func (a SyncSample) String() string

func (SyncSample) Tag

func (a SyncSample) Tag() Tag

func (*SyncSample) Unmarshal

func (a *SyncSample) Unmarshal(b []byte, offset int) (n int, err error)

type Tag

type Tag uint32

func StringToTag

func StringToTag(tag string) Tag

func (Tag) String

func (a Tag) String() string

type TimeToSample

type TimeToSample struct {
	Version uint8
	Flags   uint32
	Entries []TimeToSampleEntry
	AtomPos
}

func (TimeToSample) Children

func (a TimeToSample) Children() (r []Atom)

func (TimeToSample) Len

func (a TimeToSample) Len() (n int)

func (TimeToSample) Marshal

func (a TimeToSample) Marshal(b []byte) (n int)

func (TimeToSample) String

func (a TimeToSample) String() string

func (TimeToSample) Tag

func (a TimeToSample) Tag() Tag

func (*TimeToSample) Unmarshal

func (a *TimeToSample) Unmarshal(b []byte, offset int) (n int, err error)

type TimeToSampleEntry

type TimeToSampleEntry struct {
	Count    uint32
	Duration uint32
}

type Track

type Track struct {
	Header   *TrackHeader
	Media    *Media
	Unknowns []Atom
	AtomPos
}

func (Track) Children

func (a Track) Children() (r []Atom)

func (*Track) GetAVC1Conf

func (a *Track) GetAVC1Conf() (conf *AVC1Conf)

func (*Track) GetElemStreamDesc

func (a *Track) GetElemStreamDesc() (esds *ElemStreamDesc)

func (Track) Len

func (a Track) Len() (n int)

func (Track) Marshal

func (a Track) Marshal(b []byte) (n int)

func (Track) Tag

func (a Track) Tag() Tag

func (*Track) Unmarshal

func (a *Track) Unmarshal(b []byte, offset int) (n int, err error)

type TrackExtend

type TrackExtend struct {
	Version               uint8
	Flags                 uint32
	TrackID               uint32
	DefaultSampleDescIdx  uint32
	DefaultSampleDuration uint32
	DefaultSampleSize     uint32
	DefaultSampleFlags    uint32
	AtomPos
}

func (TrackExtend) Children

func (a TrackExtend) Children() (r []Atom)

func (TrackExtend) Len

func (a TrackExtend) Len() (n int)

func (TrackExtend) Marshal

func (a TrackExtend) Marshal(b []byte) (n int)

func (TrackExtend) Tag

func (a TrackExtend) Tag() Tag

func (*TrackExtend) Unmarshal

func (a *TrackExtend) Unmarshal(b []byte, offset int) (n int, err error)

type TrackFrag

type TrackFrag struct {
	Header     *TrackFragHeader
	DecodeTime *TrackFragDecodeTime
	Run        *TrackFragRun
	Unknowns   []Atom
	AtomPos
}

func (TrackFrag) Children

func (a TrackFrag) Children() (r []Atom)

func (TrackFrag) Len

func (a TrackFrag) Len() (n int)

func (TrackFrag) Marshal

func (a TrackFrag) Marshal(b []byte) (n int)

func (TrackFrag) Tag

func (a TrackFrag) Tag() Tag

func (*TrackFrag) Unmarshal

func (a *TrackFrag) Unmarshal(b []byte, offset int) (n int, err error)

type TrackFragDecodeTime

type TrackFragDecodeTime struct {
	Version uint8
	Flags   uint32
	Time    uint64
	AtomPos
}

func (TrackFragDecodeTime) Children

func (a TrackFragDecodeTime) Children() (r []Atom)

func (TrackFragDecodeTime) Len

func (a TrackFragDecodeTime) Len() (n int)

func (TrackFragDecodeTime) Marshal

func (a TrackFragDecodeTime) Marshal(b []byte) (n int)

func (TrackFragDecodeTime) Tag

func (a TrackFragDecodeTime) Tag() Tag

func (*TrackFragDecodeTime) Unmarshal

func (a *TrackFragDecodeTime) Unmarshal(b []byte, offset int) (n int, err error)

type TrackFragFlags

type TrackFragFlags uint32

TrackFragFlags is the type of TrackFragHeader's Flags

const (
	TrackFragBaseDataOffset    TrackFragFlags = 0x01
	TrackFragStsdID            TrackFragFlags = 0x02
	TrackFragDefaultDuration   TrackFragFlags = 0x08
	TrackFragDefaultSize       TrackFragFlags = 0x10
	TrackFragDefaultFlags      TrackFragFlags = 0x20
	TrackFragDurationIsEmpty   TrackFragFlags = 0x010000
	TrackFragDefaultBaseIsMOOF TrackFragFlags = 0x020000
)

Defined flags for TrackFragHeader

type TrackFragHeader

type TrackFragHeader struct {
	Version         uint8
	Flags           TrackFragFlags
	TrackID         uint32
	BaseDataOffset  uint64
	StsdID          uint32
	DefaultDuration uint32
	DefaultSize     uint32
	DefaultFlags    SampleFlags
	AtomPos
}

TrackFragHeader atom

func (TrackFragHeader) Children

func (a TrackFragHeader) Children() (r []Atom)

func (TrackFragHeader) Len

func (a TrackFragHeader) Len() (n int)

func (TrackFragHeader) Marshal

func (a TrackFragHeader) Marshal(b []byte) (n int)

func (TrackFragHeader) String

func (a TrackFragHeader) String() string

func (TrackFragHeader) Tag

func (a TrackFragHeader) Tag() Tag

func (*TrackFragHeader) Unmarshal

func (a *TrackFragHeader) Unmarshal(b []byte, offset int) (n int, err error)

type TrackFragRun

type TrackFragRun struct {
	Version          uint8
	Flags            TrackRunFlags
	DataOffset       uint32
	FirstSampleFlags SampleFlags
	Entries          []TrackFragRunEntry
	AtomPos
}

TrackFragRun atom

func (TrackFragRun) Children

func (a TrackFragRun) Children() (r []Atom)

func (TrackFragRun) Len

func (a TrackFragRun) Len() (n int)

func (TrackFragRun) Marshal

func (a TrackFragRun) Marshal(b []byte) (n int)

func (TrackFragRun) String

func (a TrackFragRun) String() string

func (TrackFragRun) Tag

func (a TrackFragRun) Tag() Tag

func (*TrackFragRun) Unmarshal

func (a *TrackFragRun) Unmarshal(b []byte, offset int) (n int, err error)

type TrackFragRunEntry

type TrackFragRunEntry struct {
	Duration uint32
	Size     uint32
	Flags    SampleFlags
	CTS      int32
}

type TrackHeader

type TrackHeader struct {
	Version        uint8
	Flags          uint32
	CreateTime     time.Time
	ModifyTime     time.Time
	TrackID        uint32
	Duration       uint32
	Layer          int16
	AlternateGroup int16
	Volume         float64
	Matrix         [9]int32
	TrackWidth     float64
	TrackHeight    float64
	AtomPos
}

func (TrackHeader) Children

func (a TrackHeader) Children() (r []Atom)

func (TrackHeader) Len

func (a TrackHeader) Len() (n int)

func (TrackHeader) Marshal

func (a TrackHeader) Marshal(b []byte) (n int)

func (TrackHeader) Tag

func (a TrackHeader) Tag() Tag

func (*TrackHeader) Unmarshal

func (a *TrackHeader) Unmarshal(b []byte, offset int) (n int, err error)

type TrackRunFlags

type TrackRunFlags uint32

TrackRunFlags is the type of TrackFragRun's Flags

const (
	TrackRunDataOffset       TrackRunFlags = 0x01
	TrackRunFirstSampleFlags TrackRunFlags = 0x04
	TrackRunSampleDuration   TrackRunFlags = 0x100
	TrackRunSampleSize       TrackRunFlags = 0x200
	TrackRunSampleFlags      TrackRunFlags = 0x400
	TrackRunSampleCTS        TrackRunFlags = 0x800
)

Defined flags for TrackFragRun

type VideoMediaInfo

type VideoMediaInfo struct {
	Version      uint8
	Flags        uint32
	GraphicsMode int16
	Opcolor      [3]int16
	AtomPos
}

func (VideoMediaInfo) Children

func (a VideoMediaInfo) Children() (r []Atom)

func (VideoMediaInfo) Len

func (a VideoMediaInfo) Len() (n int)

func (VideoMediaInfo) Marshal

func (a VideoMediaInfo) Marshal(b []byte) (n int)

func (VideoMediaInfo) Tag

func (a VideoMediaInfo) Tag() Tag

func (*VideoMediaInfo) Unmarshal

func (a *VideoMediaInfo) Unmarshal(b []byte, offset int) (n int, err error)

Jump to

Keyboard shortcuts

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