Documentation ¶
Index ¶
- Constants
- Variables
- func AddAnyTypeBoxDef(payload IAnyType, boxType BoxType, versions ...uint8)
- func AddAnyTypeBoxDefEx(payload IAnyType, boxType BoxType, isTarget func(Context) bool, ...)
- func AddBoxDef(payload IBox, versions ...uint8)
- func AddBoxDefEx(payload IBox, isTarget func(Context) bool, versions ...uint8)
- func BrandAVC1() [4]byte
- func BrandISO2() [4]byte
- func BrandISO3() [4]byte
- func BrandISO4() [4]byte
- func BrandISO5() [4]byte
- func BrandISO6() [4]byte
- func BrandISO7() [4]byte
- func BrandISO8() [4]byte
- func BrandISO9() [4]byte
- func BrandISOM() [4]byte
- func BrandMP41() [4]byte
- func BrandMP71() [4]byte
- func BrandQT() [4]byte
- func FindIDRFrames(r io.ReadSeeker, trackInfo *TrackInfo) ([]int, error)
- func IsIlstMetaBoxType(boxType BoxType) bool
- func Marshal(w io.Writer, src IImmutableBox, ctx Context) (n uint64, err error)
- func ReadBoxStructure(r io.ReadSeeker, handler ReadHandler, params ...interface{}) ([]interface{}, error)
- func ReadBoxStructureFromInternal(r io.ReadSeeker, bi *BoxInfo, handler ReadHandler, params ...interface{}) (interface{}, error)
- func Stringify(src IImmutableBox, ctx Context) (string, error)
- func StringifyWithIndent(src IImmutableBox, indent string, ctx Context) (string, error)
- func Unmarshal(r io.ReadSeeker, payloadSize uint64, dst IBox, ctx Context) (n uint64, err error)
- type AVCDecConfigInfo
- type AVCDecoderConfiguration
- func (avcc *AVCDecoderConfiguration) GetFieldLength(name string, ctx Context) uint
- func (avcc *AVCDecoderConfiguration) IsOptFieldEnabled(name string, ctx Context) bool
- func (avcc *AVCDecoderConfiguration) OnReadField(name string, r bitio.ReadSeeker, leftBits uint64, ctx Context) (rbits uint64, override bool, err error)
- func (avcc *AVCDecoderConfiguration) OnWriteField(name string, w bitio.Writer, ctx Context) (wbits uint64, override bool, err error)
- type AVCParameterSet
- type AlternativeStartupEntry
- type AlternativeStartupEntryL
- type AlternativeStartupEntryOpt
- type AnyTypeBox
- type AudioSampleEntry
- type BaseCustomFieldObject
- func (*BaseCustomFieldObject) BeforeUnmarshal(io.ReadSeeker, uint64, Context) (uint64, bool, error)
- func (box *BaseCustomFieldObject) GetFieldLength(string, Context) uint
- func (box *BaseCustomFieldObject) GetFieldSize(string, Context) uint
- func (box *BaseCustomFieldObject) IsOptFieldEnabled(string, Context) bool
- func (*BaseCustomFieldObject) IsPString(name string, bytes []byte, remainingSize uint64, ctx Context) bool
- func (*BaseCustomFieldObject) OnReadField(string, bitio.ReadSeeker, uint64, Context) (uint64, bool, error)
- func (*BaseCustomFieldObject) OnWriteField(string, bitio.Writer, Context) (uint64, bool, error)
- func (box *BaseCustomFieldObject) StringifyField(string, string, int, Context) (string, bool)
- type Box
- type BoxInfo
- type BoxInfoWithPayload
- type BoxPath
- type BoxType
- func BoxTypeAny() BoxType
- func BoxTypeAvc1() BoxType
- func BoxTypeAvcC() BoxType
- func BoxTypeBtrt() BoxType
- func BoxTypeCo64() BoxType
- func BoxTypeColr() BoxType
- func BoxTypeCslg() BoxType
- func BoxTypeCtts() BoxType
- func BoxTypeData() BoxType
- func BoxTypeDinf() BoxType
- func BoxTypeDref() BoxType
- func BoxTypeEdts() BoxType
- func BoxTypeElst() BoxType
- func BoxTypeEmsg() BoxType
- func BoxTypeEnca() BoxType
- func BoxTypeEncv() BoxType
- func BoxTypeEsds() BoxType
- func BoxTypeFiel() BoxType
- func BoxTypeFree() BoxType
- func BoxTypeFrma() BoxType
- func BoxTypeFtyp() BoxType
- func BoxTypeHdlr() BoxType
- func BoxTypeHev1() BoxType
- func BoxTypeHvcC() BoxType
- func BoxTypeIlst() BoxType
- func BoxTypeMdat() BoxType
- func BoxTypeMdhd() BoxType
- func BoxTypeMdia() BoxType
- func BoxTypeMehd() BoxType
- func BoxTypeMeta() BoxType
- func BoxTypeMfhd() BoxType
- func BoxTypeMfra() BoxType
- func BoxTypeMfro() BoxType
- func BoxTypeMinf() BoxType
- func BoxTypeMoof() BoxType
- func BoxTypeMoov() BoxType
- func BoxTypeMp4a() BoxType
- func BoxTypeMvex() BoxType
- func BoxTypeMvhd() BoxType
- func BoxTypePasp() BoxType
- func BoxTypePssh() BoxType
- func BoxTypeSaio() BoxType
- func BoxTypeSaiz() BoxType
- func BoxTypeSbgp() BoxType
- func BoxTypeSchi() BoxType
- func BoxTypeSchm() BoxType
- func BoxTypeSdtp() BoxType
- func BoxTypeSgpd() BoxType
- func BoxTypeSidx() BoxType
- func BoxTypeSinf() BoxType
- func BoxTypeSkip() BoxType
- func BoxTypeSmhd() BoxType
- func BoxTypeStbl() BoxType
- func BoxTypeStco() BoxType
- func BoxTypeStsc() BoxType
- func BoxTypeStsd() BoxType
- func BoxTypeStss() BoxType
- func BoxTypeStsz() BoxType
- func BoxTypeStts() BoxType
- func BoxTypeStyp() BoxType
- func BoxTypeTenc() BoxType
- func BoxTypeTfdt() BoxType
- func BoxTypeTfhd() BoxType
- func BoxTypeTfra() BoxType
- func BoxTypeTkhd() BoxType
- func BoxTypeTraf() BoxType
- func BoxTypeTrak() BoxType
- func BoxTypeTrep() BoxType
- func BoxTypeTrex() BoxType
- func BoxTypeTrun() BoxType
- func BoxTypeUdta() BoxType
- func BoxTypeUrl() BoxType
- func BoxTypeUrn() BoxType
- func BoxTypeVmhd() BoxType
- func BoxTypeWave() BoxType
- func StrToBoxType(code string) BoxType
- func (boxType BoxType) GetSupportedVersions(ctx Context) ([]uint8, error)
- func (boxType BoxType) IsSupported(ctx Context) bool
- func (boxType BoxType) IsSupportedVersion(ver uint8, ctx Context) bool
- func (lhs BoxType) MatchWith(rhs BoxType) bool
- func (boxType BoxType) New(ctx Context) (IBox, error)
- func (boxType BoxType) String() string
- type Btrt
- type Chunk
- type Chunks
- type Co64
- type Codec
- type Colr
- type CompatibleBrandElem
- type Context
- type Cslg
- type Ctts
- type CttsEntry
- type Data
- type DecoderConfigDescriptor
- type Descriptor
- type Dinf
- type Dref
- type ESDescriptor
- type EditList
- type EditListEntry
- type Edts
- type Elst
- type ElstEntry
- type Emsg
- type Esds
- type Fiel
- type FraProbeInfodeprecated
- type Free
- type FreeSpace
- type Frma
- type Ftyp
- type FullBox
- type HEVCNalu
- type HEVCNaluArray
- type Hdlr
- type HvcC
- type IAnyType
- type IBox
- type ICustomFieldObject
- type IImmutableBox
- type Ilst
- type IlstMetaContainer
- type MP4AInfo
- type Mdat
- type Mdhd
- type Mdia
- type Mehd
- type Meta
- type Mfhd
- type Mfra
- type Mfro
- type Minf
- type Moof
- type Moov
- type Mvex
- type Mvhd
- func (mvhd *Mvhd) GetCreationTime() uint64
- func (mvhd *Mvhd) GetDuration() uint64
- func (mvhd *Mvhd) GetModificationTime() uint64
- func (mvhd *Mvhd) GetRate() float64
- func (mvhd *Mvhd) GetRateInt() int16
- func (*Mvhd) GetType() BoxType
- func (mvhd *Mvhd) StringifyField(name string, indent string, depth int, ctx Context) (string, bool)
- type PixelAspectRatioBox
- type ProbeInfo
- type Pssh
- type PsshKID
- type ReadHandle
- type ReadHandler
- type RollDistanceWithLength
- type Saio
- type Saiz
- type Sample
- type SampleEntry
- type Samples
- type Sbgp
- type SbgpEntry
- type Schi
- type Schm
- type Sdtp
- type SdtpSampleElem
- type Segment
- type SegmentInfodeprecated
- type Segments
- type Sgpd
- type Sidx
- type SidxReference
- type Sinf
- type Skip
- type Smhd
- type Stbl
- type Stco
- type StringData
- type Stsc
- type StscEntry
- type Stsd
- type Stss
- type Stsz
- type Stts
- type SttsEntry
- type Styp
- type TemporalLevelEntry
- type TemporalLevelEntryL
- type Tenc
- type Tfdt
- type Tfhd
- type Tfra
- type TfraEntry
- type Tkhd
- func (tkhd *Tkhd) GetCreationTime() uint64
- func (tkhd *Tkhd) GetDuration() uint64
- func (tkhd *Tkhd) GetHeight() float64
- func (tkhd *Tkhd) GetHeightInt() uint16
- func (tkhd *Tkhd) GetModificationTime() uint64
- func (*Tkhd) GetType() BoxType
- func (tkhd *Tkhd) GetWidth() float64
- func (tkhd *Tkhd) GetWidthInt() uint16
- func (tkhd *Tkhd) StringifyField(name string, indent string, depth int, ctx Context) (string, bool)
- type Track
- type TrackInfodeprecated
- type Tracks
- type Traf
- type Trak
- type Trep
- type Trex
- type Trun
- type TrunEntry
- type Udta
- type Udta3GppString
- type Url
- type Urn
- type VisualRandomAccessEntry
- type VisualRandomAccessEntryL
- type VisualSampleEntry
- type Vmhd
- type Wave
- type Writer
Constants ¶
const ( SmallHeaderSize = 8 LargeHeaderSize = 16 )
const ( ESDescrTag = 0x03 DecoderConfigDescrTag = 0x04 DecSpecificInfoTag = 0x05 SLConfigDescrTag = 0x06 )
const ( DataTypeBinary = 0 DataTypeStringUTF8 = 1 DataTypeStringUTF16 = 2 DataTypeStringMac = 3 DataTypeStringJPEG = 14 DataTypeSignedIntBigEndian = 21 DataTypeFloat32BigEndian = 22 DataTypeFloat64BigEndian = 23 )
const ( AVCBaselineProfile uint8 = 66 // 0x42 AVCMainProfile uint8 = 77 // 0x4d AVCExtendedProfile uint8 = 88 // 0x58 AVCHighProfile uint8 = 100 // 0x64 AVCHigh10Profile uint8 = 110 // 0x6e AVCHigh422Profile uint8 = 122 // 0x7a )
const ( TfhdBaseDataOffsetPresent = 0x000001 TfhdSampleDescriptionIndexPresent = 0x000002 TfhdDefaultSampleDurationPresent = 0x000008 TfhdDefaultSampleSizePresent = 0x000010 TfhdDefaultSampleFlagsPresent = 0x000020 TfhdDurationIsEmpty = 0x010000 TfhdDefaultBaseIsMoof = 0x020000 )
const LengthUnlimited = math.MaxUint32
const UrlSelfContained = 0x000001
const UrnSelfContained = 0x000001
Variables ¶
var ErrBoxInfoNotFound = errors.New("box info not found")
var ErrUnsupportedBoxVersion = errors.New("unsupported box version")
Functions ¶
func AddAnyTypeBoxDef ¶
func AddAnyTypeBoxDefEx ¶ added in v0.4.0
func AddBoxDefEx ¶ added in v0.4.0
func FindIDRFrames ¶ added in v0.6.0
func FindIDRFrames(r io.ReadSeeker, trackInfo *TrackInfo) ([]int, error)
func IsIlstMetaBoxType ¶ added in v0.4.0
func ReadBoxStructure ¶
func ReadBoxStructure(r io.ReadSeeker, handler ReadHandler, params ...interface{}) ([]interface{}, error)
func ReadBoxStructureFromInternal ¶
func ReadBoxStructureFromInternal(r io.ReadSeeker, bi *BoxInfo, handler ReadHandler, params ...interface{}) (interface{}, error)
func StringifyWithIndent ¶
func StringifyWithIndent(src IImmutableBox, indent string, ctx Context) (string, error)
Types ¶
type AVCDecConfigInfo ¶ added in v0.6.0
type AVCDecoderConfiguration ¶
type AVCDecoderConfiguration struct { AnyTypeBox ConfigurationVersion uint8 `mp4:"0,size=8"` Profile uint8 `mp4:"1,size=8"` ProfileCompatibility uint8 `mp4:"2,size=8"` Level uint8 `mp4:"3,size=8"` Reserved uint8 `mp4:"4,size=6,const=63"` LengthSizeMinusOne uint8 `mp4:"5,size=2"` Reserved2 uint8 `mp4:"6,size=3,const=7"` NumOfSequenceParameterSets uint8 `mp4:"7,size=5"` SequenceParameterSets []AVCParameterSet `mp4:"8,len=dynamic"` NumOfPictureParameterSets uint8 `mp4:"9,size=8"` PictureParameterSets []AVCParameterSet `mp4:"10,len=dynamic"` HighProfileFieldsEnabled bool `mp4:"11,hidden"` Reserved3 uint8 `mp4:"12,size=6,opt=dynamic,const=63"` ChromaFormat uint8 `mp4:"13,size=2,opt=dynamic"` Reserved4 uint8 `mp4:"14,size=5,opt=dynamic,const=31"` BitDepthLumaMinus8 uint8 `mp4:"15,size=3,opt=dynamic"` Reserved5 uint8 `mp4:"16,size=5,opt=dynamic,const=31"` BitDepthChromaMinus8 uint8 `mp4:"17,size=3,opt=dynamic"` NumOfSequenceParameterSetExt uint8 `mp4:"18,size=8,opt=dynamic"` SequenceParameterSetsExt []AVCParameterSet `mp4:"19,len=dynamic,opt=dynamic"` }
func (*AVCDecoderConfiguration) GetFieldLength ¶ added in v0.3.0
func (avcc *AVCDecoderConfiguration) GetFieldLength(name string, ctx Context) uint
func (*AVCDecoderConfiguration) IsOptFieldEnabled ¶ added in v0.3.0
func (avcc *AVCDecoderConfiguration) IsOptFieldEnabled(name string, ctx Context) bool
func (*AVCDecoderConfiguration) OnReadField ¶ added in v0.3.0
func (avcc *AVCDecoderConfiguration) OnReadField(name string, r bitio.ReadSeeker, leftBits uint64, ctx Context) (rbits uint64, override bool, err error)
func (*AVCDecoderConfiguration) OnWriteField ¶ added in v0.3.0
type AVCParameterSet ¶ added in v0.3.0
type AVCParameterSet struct { BaseCustomFieldObject Length uint16 `mp4:"0,size=16"` NALUnit []byte `mp4:"1,size=8,len=dynamic"` }
func (*AVCParameterSet) GetFieldLength ¶ added in v0.3.0
func (s *AVCParameterSet) GetFieldLength(name string, ctx Context) uint
type AlternativeStartupEntry ¶ added in v0.3.0
type AlternativeStartupEntry struct { BaseCustomFieldObject RollCount uint16 `mp4:"0,size=16"` FirstOutputSample uint16 `mp4:"1,size=16"` SampleOffset []uint32 `mp4:"2,size=32,len=dynamic"` Opts []AlternativeStartupEntryOpt `mp4:"3,size=32"` }
func (*AlternativeStartupEntry) GetFieldLength ¶ added in v0.3.0
func (entry *AlternativeStartupEntry) GetFieldLength(name string, ctx Context) uint
type AlternativeStartupEntryL ¶ added in v0.3.0
type AlternativeStartupEntryL struct { DescriptionLength uint32 `mp4:"0,size=32"` AlternativeStartupEntry `mp4:"1,extend,size=dynamic"` }
func (*AlternativeStartupEntryL) GetFieldSize ¶ added in v0.3.0
func (entry *AlternativeStartupEntryL) GetFieldSize(name string, ctx Context) uint
type AlternativeStartupEntryOpt ¶ added in v0.3.0
type AnyTypeBox ¶
func (*AnyTypeBox) GetType ¶
func (e *AnyTypeBox) GetType() BoxType
func (*AnyTypeBox) SetType ¶
func (e *AnyTypeBox) SetType(boxType BoxType)
type AudioSampleEntry ¶
type AudioSampleEntry struct { SampleEntry `mp4:"0,extend,opt=dynamic"` EntryVersion uint16 `mp4:"1,size=16,opt=dynamic"` Reserved [3]uint16 `mp4:"2,size=16,opt=dynamic,const=0"` ChannelCount uint16 `mp4:"3,size=16,opt=dynamic"` SampleSize uint16 `mp4:"4,size=16,opt=dynamic"` PreDefined uint16 `mp4:"5,size=16,opt=dynamic"` Reserved2 uint16 `mp4:"6,size=16,opt=dynamic,const=0"` SampleRate uint32 `mp4:"7,size=32,opt=dynamic"` QuickTimeData []byte `mp4:"8,size=8,opt=dynamic,len=dynamic"` }
func (*AudioSampleEntry) GetFieldLength ¶ added in v0.4.0
func (ase *AudioSampleEntry) GetFieldLength(name string, ctx Context) uint
func (*AudioSampleEntry) IsOptFieldEnabled ¶ added in v0.4.0
func (ase *AudioSampleEntry) IsOptFieldEnabled(name string, ctx Context) bool
type BaseCustomFieldObject ¶
type BaseCustomFieldObject struct { }
func (*BaseCustomFieldObject) BeforeUnmarshal ¶
func (*BaseCustomFieldObject) BeforeUnmarshal(io.ReadSeeker, uint64, Context) (uint64, bool, error)
func (*BaseCustomFieldObject) GetFieldLength ¶
func (box *BaseCustomFieldObject) GetFieldLength(string, Context) uint
GetFieldLength returns length of dynamic field
func (*BaseCustomFieldObject) GetFieldSize ¶
func (box *BaseCustomFieldObject) GetFieldSize(string, Context) uint
GetFieldSize returns size of dynamic field
func (*BaseCustomFieldObject) IsOptFieldEnabled ¶
func (box *BaseCustomFieldObject) IsOptFieldEnabled(string, Context) bool
IsOptFieldEnabled check whether if the optional field is enabled
func (*BaseCustomFieldObject) OnReadField ¶ added in v0.3.0
func (*BaseCustomFieldObject) OnReadField(string, bitio.ReadSeeker, uint64, Context) (uint64, bool, error)
func (*BaseCustomFieldObject) OnWriteField ¶ added in v0.3.0
func (*BaseCustomFieldObject) StringifyField ¶
StringifyField returns field value as string
type Box ¶
type Box struct {
BaseCustomFieldObject
}
type BoxInfo ¶
type BoxInfo struct { // Offset specifies an offset of the box in a file. Offset uint64 // Size specifies size(bytes) of box. Size uint64 // HeaderSize specifies size(bytes) of common fields which are defined as "Box" class member at ISO/IEC 14496-12. HeaderSize uint64 // Type specifies box type which is represented by 4 characters. Type BoxType // ExtendToEOF is set true when Box.size is zero. It means that end of box equals to end of file. ExtendToEOF bool // Context would be set by ReadBoxStructure, not ReadBoxInfo. Context }
BoxInfo has common infomations of box
func ExtractBox ¶
func ExtractBoxes ¶
func ReadBoxInfo ¶
func ReadBoxInfo(r io.ReadSeeker) (*BoxInfo, error)
ReadBoxInfo reads common fields which are defined as "Box" class member at ISO/IEC 14496-12.
func WriteBoxInfo ¶
func WriteBoxInfo(w io.WriteSeeker, bi *BoxInfo) (*BoxInfo, error)
WriteBoxInfo writes common fields which are defined as "Box" class member at ISO/IEC 14496-12. This function ignores bi.Offset and returns BoxInfo which contains real Offset and recalculated Size/HeaderSize.
func (*BoxInfo) IsSupportedType ¶ added in v0.4.0
type BoxInfoWithPayload ¶
func ExtractBoxWithPayload ¶
func ExtractBoxWithPayload(r io.ReadSeeker, parent *BoxInfo, path BoxPath) ([]*BoxInfoWithPayload, error)
func ExtractBoxesWithPayload ¶
func ExtractBoxesWithPayload(r io.ReadSeeker, parent *BoxInfo, paths []BoxPath) ([]*BoxInfoWithPayload, error)
type BoxType ¶
type BoxType [4]byte
BoxType is mpeg box type
func BoxTypeAny ¶ added in v0.2.0
func BoxTypeAny() BoxType
func BoxTypeAvc1 ¶ added in v0.6.0
func BoxTypeAvc1() BoxType
func BoxTypeAvcC ¶ added in v0.6.0
func BoxTypeAvcC() BoxType
func BoxTypeBtrt ¶ added in v0.4.0
func BoxTypeBtrt() BoxType
func BoxTypeCo64 ¶ added in v0.3.0
func BoxTypeCo64() BoxType
func BoxTypeColr ¶ added in v0.3.0
func BoxTypeColr() BoxType
func BoxTypeCslg ¶ added in v0.4.0
func BoxTypeCslg() BoxType
func BoxTypeCtts ¶
func BoxTypeCtts() BoxType
func BoxTypeData ¶ added in v0.4.0
func BoxTypeData() BoxType
func BoxTypeDinf ¶
func BoxTypeDinf() BoxType
func BoxTypeDref ¶
func BoxTypeDref() BoxType
func BoxTypeEdts ¶
func BoxTypeEdts() BoxType
func BoxTypeElst ¶
func BoxTypeElst() BoxType
func BoxTypeEmsg ¶
func BoxTypeEmsg() BoxType
func BoxTypeEnca ¶ added in v0.6.0
func BoxTypeEnca() BoxType
func BoxTypeEncv ¶ added in v0.6.0
func BoxTypeEncv() BoxType
func BoxTypeEsds ¶
func BoxTypeEsds() BoxType
func BoxTypeFiel ¶ added in v0.9.0
func BoxTypeFiel() BoxType
func BoxTypeFree ¶
func BoxTypeFree() BoxType
func BoxTypeFrma ¶ added in v0.4.0
func BoxTypeFrma() BoxType
func BoxTypeFtyp ¶
func BoxTypeFtyp() BoxType
func BoxTypeHdlr ¶
func BoxTypeHdlr() BoxType
func BoxTypeHev1 ¶ added in v0.9.0
func BoxTypeHev1() BoxType
func BoxTypeHvcC ¶ added in v0.9.0
func BoxTypeHvcC() BoxType
func BoxTypeIlst ¶ added in v0.3.0
func BoxTypeIlst() BoxType
func BoxTypeMdat ¶
func BoxTypeMdat() BoxType
func BoxTypeMdhd ¶
func BoxTypeMdhd() BoxType
func BoxTypeMdia ¶
func BoxTypeMdia() BoxType
func BoxTypeMehd ¶
func BoxTypeMehd() BoxType
func BoxTypeMeta ¶
func BoxTypeMeta() BoxType
func BoxTypeMfhd ¶
func BoxTypeMfhd() BoxType
func BoxTypeMfra ¶
func BoxTypeMfra() BoxType
func BoxTypeMfro ¶
func BoxTypeMfro() BoxType
func BoxTypeMinf ¶
func BoxTypeMinf() BoxType
func BoxTypeMoof ¶
func BoxTypeMoof() BoxType
func BoxTypeMoov ¶
func BoxTypeMoov() BoxType
func BoxTypeMp4a ¶ added in v0.6.0
func BoxTypeMp4a() BoxType
func BoxTypeMvex ¶
func BoxTypeMvex() BoxType
func BoxTypeMvhd ¶
func BoxTypeMvhd() BoxType
func BoxTypePasp ¶ added in v0.6.0
func BoxTypePasp() BoxType
func BoxTypePssh ¶
func BoxTypePssh() BoxType
func BoxTypeSaio ¶ added in v0.4.0
func BoxTypeSaio() BoxType
func BoxTypeSaiz ¶ added in v0.4.0
func BoxTypeSaiz() BoxType
func BoxTypeSbgp ¶
func BoxTypeSbgp() BoxType
func BoxTypeSchi ¶ added in v0.3.0
func BoxTypeSchi() BoxType
func BoxTypeSchm ¶ added in v0.4.0
func BoxTypeSchm() BoxType
func BoxTypeSdtp ¶ added in v0.4.0
func BoxTypeSdtp() BoxType
func BoxTypeSgpd ¶
func BoxTypeSgpd() BoxType
func BoxTypeSidx ¶ added in v0.2.0
func BoxTypeSidx() BoxType
func BoxTypeSinf ¶ added in v0.3.0
func BoxTypeSinf() BoxType
func BoxTypeSkip ¶
func BoxTypeSkip() BoxType
func BoxTypeSmhd ¶
func BoxTypeSmhd() BoxType
func BoxTypeStbl ¶
func BoxTypeStbl() BoxType
func BoxTypeStco ¶
func BoxTypeStco() BoxType
func BoxTypeStsc ¶
func BoxTypeStsc() BoxType
func BoxTypeStsd ¶
func BoxTypeStsd() BoxType
func BoxTypeStss ¶
func BoxTypeStss() BoxType
func BoxTypeStsz ¶
func BoxTypeStsz() BoxType
func BoxTypeStts ¶
func BoxTypeStts() BoxType
func BoxTypeStyp ¶ added in v0.2.0
func BoxTypeStyp() BoxType
func BoxTypeTenc ¶ added in v0.4.0
func BoxTypeTenc() BoxType
func BoxTypeTfdt ¶
func BoxTypeTfdt() BoxType
func BoxTypeTfhd ¶
func BoxTypeTfhd() BoxType
func BoxTypeTfra ¶
func BoxTypeTfra() BoxType
func BoxTypeTkhd ¶
func BoxTypeTkhd() BoxType
func BoxTypeTraf ¶
func BoxTypeTraf() BoxType
func BoxTypeTrak ¶
func BoxTypeTrak() BoxType
func BoxTypeTrep ¶ added in v0.4.0
func BoxTypeTrep() BoxType
func BoxTypeTrex ¶
func BoxTypeTrex() BoxType
func BoxTypeTrun ¶
func BoxTypeTrun() BoxType
func BoxTypeUdta ¶
func BoxTypeUdta() BoxType
func BoxTypeUrl ¶
func BoxTypeUrl() BoxType
func BoxTypeUrn ¶
func BoxTypeUrn() BoxType
func BoxTypeVmhd ¶
func BoxTypeVmhd() BoxType
func BoxTypeWave ¶ added in v0.4.0
func BoxTypeWave() BoxType
func StrToBoxType ¶
func (BoxType) GetSupportedVersions ¶
func (BoxType) IsSupported ¶
func (BoxType) IsSupportedVersion ¶
type Btrt ¶ added in v0.4.0
type Co64 ¶ added in v0.3.0
type Co64 struct { FullBox `mp4:"0,extend"` EntryCount uint32 `mp4:"1,size=32"` ChunkOffset []uint64 `mp4:"2,size=64,len=dynamic"` }
func (*Co64) GetFieldLength ¶ added in v0.3.0
GetFieldLength returns length of dynamic field
type Colr ¶ added in v0.3.0
type Colr struct { Box ColourType [4]byte `mp4:"0,size=8,string"` ColourPrimaries uint16 `mp4:"1,size=16,opt=dynamic"` TransferCharacteristics uint16 `mp4:"2,size=16,opt=dynamic"` MatrixCoefficients uint16 `mp4:"3,size=16,opt=dynamic"` FullRangeFlag bool `mp4:"4,size=1,opt=dynamic"` Reserved uint8 `mp4:"5,size=7,opt=dynamic"` Profile []byte `mp4:"6,size=8,opt=dynamic"` Unknown []byte `mp4:"7,size=8,opt=dynamic"` }
type CompatibleBrandElem ¶
type CompatibleBrandElem struct {
CompatibleBrand [4]byte `mp4:"0,size=8,string"`
}
type Context ¶ added in v0.4.0
type Context struct { // IsQuickTimeCompatible represents whether ftyp.compatible_brands contains "qt ". IsQuickTimeCompatible bool // UnderWave represents whether current box is under the wave box. UnderWave bool // UnderIlst represents whether current box is under the ilst box. UnderIlst bool // UnderIlstMeta represents whether current box is under the metadata box under the ilst box. UnderIlstMeta bool // UnderIlstFreeMeta represents whether current box is under "----" box. UnderIlstFreeMeta bool // UnderUdta represents whether current box is under the udta box. UnderUdta bool }
type Cslg ¶ added in v0.4.0
type Cslg struct { FullBox `mp4:"0,extend"` CompositionToDTSShiftV0 int32 `mp4:"1,size=32,ver=0"` LeastDecodeToDisplayDeltaV0 int32 `mp4:"2,size=32,ver=0"` GreatestDecodeToDisplayDeltaV0 int32 `mp4:"3,size=32,ver=0"` CompositionStartTimeV0 int32 `mp4:"4,size=32,ver=0"` CompositionEndTimeV0 int32 `mp4:"5,size=32,ver=0"` CompositionToDTSShiftV1 int64 `mp4:"6,size=64,nver=0"` LeastDecodeToDisplayDeltaV1 int64 `mp4:"7,size=64,nver=0"` GreatestDecodeToDisplayDeltaV1 int64 `mp4:"8,size=64,nver=0"` CompositionStartTimeV1 int64 `mp4:"9,size=64,nver=0"` CompositionEndTimeV1 int64 `mp4:"10,size=64,nver=0"` }
func (*Cslg) GetCompositionEndTime ¶ added in v0.8.0
func (*Cslg) GetCompositionStartTime ¶ added in v0.8.0
func (*Cslg) GetCompositionToDTSShift ¶ added in v0.8.0
func (*Cslg) GetGreatestDecodeToDisplayDelta ¶ added in v0.8.0
func (*Cslg) GetLeastDecodeToDisplayDelta ¶ added in v0.8.0
type Ctts ¶
type Ctts struct { FullBox `mp4:"0,extend"` EntryCount uint32 `mp4:"1,size=32"` Entries []CttsEntry `mp4:"2,len=dynamic,size=64"` }
func (*Ctts) GetFieldLength ¶
GetFieldLength returns length of dynamic field
func (*Ctts) GetSampleOffset ¶ added in v0.8.0
type Data ¶ added in v0.4.0
type DecoderConfigDescriptor ¶
type DecoderConfigDescriptor struct { BaseCustomFieldObject ObjectTypeIndication byte `mp4:"0,size=8"` StreamType int8 `mp4:"1,size=6"` UpStream bool `mp4:"2,size=1"` Reserved bool `mp4:"3,size=1"` BufferSizeDB uint32 `mp4:"4,size=24"` MaxBitrate uint32 `mp4:"5,size=32"` AvgBitrate uint32 `mp4:"6,size=32"` }
type Descriptor ¶
type Descriptor struct { BaseCustomFieldObject Tag int8 `mp4:"0,size=8"` // must be 0x03 Size uint32 `mp4:"1,varint"` ESDescriptor *ESDescriptor `mp4:"2,extend,opt=dynamic"` DecoderConfigDescriptor *DecoderConfigDescriptor `mp4:"3,extend,opt=dynamic"` Data []byte `mp4:"4,size=8,opt=dynamic,len=dynamic"` }
func (*Descriptor) GetFieldLength ¶
func (ds *Descriptor) GetFieldLength(name string, ctx Context) uint
GetFieldLength returns length of dynamic field
func (*Descriptor) IsOptFieldEnabled ¶
func (ds *Descriptor) IsOptFieldEnabled(name string, ctx Context) bool
func (*Descriptor) StringifyField ¶
func (ds *Descriptor) StringifyField(name string, indent string, depth int, ctx Context) (string, bool)
StringifyField returns field value as string
type ESDescriptor ¶
type ESDescriptor struct { BaseCustomFieldObject ESID uint16 `mp4:"0,size=16"` StreamDependenceFlag bool `mp4:"1,size=1"` UrlFlag bool `mp4:"2,size=1"` OcrStreamFlag bool `mp4:"3,size=1"` StreamPriority int8 `mp4:"4,size=5"` DependsOnESID uint16 `mp4:"5,size=16,opt=dynamic"` URLLength uint8 `mp4:"6,size=8,opt=dynamic"` URLString []byte `mp4:"7,size=8,len=dynamic,opt=dynamic,string"` OCRESID uint16 `mp4:"8,size=16,opt=dynamic"` }
func (*ESDescriptor) GetFieldLength ¶
func (esds *ESDescriptor) GetFieldLength(name string, ctx Context) uint
func (*ESDescriptor) IsOptFieldEnabled ¶
func (esds *ESDescriptor) IsOptFieldEnabled(name string, ctx Context) bool
type EditList ¶ added in v0.6.0
type EditList []*EditListEntry
type EditListEntry ¶ added in v0.6.0
type Elst ¶
type Elst struct { FullBox `mp4:"0,extend"` EntryCount uint32 `mp4:"1,size=32"` Entries []ElstEntry `mp4:"2,len=dynamic,size=dynamic"` }
Elst is ISOBMFF elst box type
func (*Elst) GetFieldLength ¶
GetFieldLength returns length of dynamic field
func (*Elst) GetFieldSize ¶
GetFieldSize returns size of dynamic field
func (*Elst) GetMediaTime ¶ added in v0.8.0
func (*Elst) GetSegmentDuration ¶ added in v0.8.0
type Emsg ¶
type Emsg struct { FullBox `mp4:"0,extend"` SchemeIdUri string `mp4:"1,string"` Value string `mp4:"2,string"` Timescale uint32 `mp4:"3,size=32"` PresentationTimeDelta uint32 `mp4:"4,size=32,ver=0"` PresentationTime uint64 `mp4:"5,size=64,ver=1"` EventDuration uint32 `mp4:"6,size=32"` Id uint32 `mp4:"7,size=32"` MessageData []byte `mp4:"8,size=8,string"` }
Emsg is ISOBMFF emsg box type
func (*Emsg) OnReadField ¶ added in v0.3.0
type Esds ¶
type Esds struct { FullBox `mp4:"0,extend"` Descriptors []Descriptor `mp4:"1,array"` }
Esds is ES descripter box
type FraProbeInfo
deprecated
type FraProbeInfo = ProbeInfo
Deprecated: replace with ProbeInfo
func ProbeFra ¶
func ProbeFra(r io.ReadSeeker) (*FraProbeInfo, error)
ProbeFra probes fragmented MP4 file Deprecated: replace with Probe
type Ftyp ¶
type Ftyp struct { Box MajorBrand [4]byte `mp4:"0,size=8,string"` MinorVersion uint32 `mp4:"1,size=32"` CompatibleBrands []CompatibleBrandElem `mp4:"2,size=32"` // reach to end of the box }
Ftyp is ISOBMFF ftyp box type
func (*Ftyp) AddCompatibleBrand ¶ added in v0.6.0
func (*Ftyp) HasCompatibleBrand ¶ added in v0.6.0
func (*Ftyp) RemoveCompatibleBrand ¶ added in v0.6.0
type FullBox ¶
type FullBox struct { BaseCustomFieldObject Version uint8 `mp4:"0,size=8"` Flags [3]byte `mp4:"1,size=8"` }
FullBox is ISOBMFF FullBox
func (*FullBox) GetVersion ¶
GetVersion returns the box version
func (*FullBox) RemoveFlag ¶
RemoveFlag removes the flag
func (*FullBox) SetVersion ¶
SetVersion sets the box version
type HEVCNalu ¶ added in v0.9.0
type HEVCNalu struct { BaseCustomFieldObject Length uint16 `mp4:"0,size=16"` NALUnit []byte `mp4:"1,size=8,len=dynamic"` }
type HEVCNaluArray ¶ added in v0.9.0
type HEVCNaluArray struct { BaseCustomFieldObject Completeness bool `mp4:"0,size=1"` Reserved bool `mp4:"1,size=1"` NaluType uint8 `mp4:"2,size=6"` NumNalus uint16 `mp4:"3,size=16"` Nalus []HEVCNalu `mp4:"4,len=dynamic"` }
func (HEVCNaluArray) GetFieldLength ¶ added in v0.9.0
func (a HEVCNaluArray) GetFieldLength(name string, ctx Context) uint
type Hdlr ¶
type Hdlr struct { FullBox `mp4:"0,extend"` // Predefined corresponds to component_type of QuickTime. // pre_defined of ISO-14496 has always zero, // however component_type has "mhlr" or "dhlr". PreDefined uint32 `mp4:"1,size=32"` HandlerType [4]byte `mp4:"2,size=8,string"` Reserved [3]uint32 `mp4:"3,size=32,const=0"` Name string `mp4:"4,string"` }
Hdlr is ISOBMFF hdlr box type
func (*Hdlr) OnReadField ¶ added in v0.6.0
func (*Hdlr) OnReadName ¶ added in v0.6.0
type HvcC ¶ added in v0.9.0
type HvcC struct { Box ConfigurationVersion uint8 `mp4:"0,size=8"` GeneralProfileSpace uint8 `mp4:"1,size=2"` GeneralTierFlag bool `mp4:"2,size=1"` GeneralProfileIdc uint8 `mp4:"3,size=5"` GeneralProfileCompatibility [32]bool `mp4:"4,size=1"` GeneralConstraintIndicator [6]uint8 `mp4:"5,size=8"` GeneralLevelIdc uint8 `mp4:"6,size=8"` Reserved1 uint8 `mp4:"7,size=4,const=15"` MinSpatialSegmentationIdc uint16 `mp4:"8,size=12"` Reserved2 uint8 `mp4:"9,size=6,const=63"` ParallelismType uint8 `mp4:"10,size=2"` Reserved3 uint8 `mp4:"11,size=6,const=63"` ChromaFormatIdc uint8 `mp4:"12,size=2"` Reserved4 uint8 `mp4:"13,size=5,const=31"` BitDepthLumaMinus8 uint8 `mp4:"14,size=3"` Reserved5 uint8 `mp4:"15,size=5,const=31"` BitDepthChromaMinus8 uint8 `mp4:"16,size=3"` AvgFrameRate uint16 `mp4:"17,size=16"` ConstantFrameRate uint8 `mp4:"18,size=2"` NumTemporalLayers uint8 `mp4:"19,size=2"` TemporalIdNested uint8 `mp4:"20,size=2"` LengthSizeMinusOne uint8 `mp4:"21,size=2"` NumOfNaluArrays uint8 `mp4:"22,size=8"` NaluArrays []HEVCNaluArray `mp4:"23,len=dynamic"` }
func (HvcC) GetFieldLength ¶ added in v0.9.0
type IBox ¶
type IBox interface { IImmutableBox // SetVersion sets the box version SetVersion(uint8) // SetFlags sets the flags SetFlags(uint32) // AddFlag adds the flag AddFlag(uint32) // RemoveFlag removes the flag RemoveFlag(uint32) }
IBox is common interface of box
func UnmarshalAny ¶
type ICustomFieldObject ¶
type ICustomFieldObject interface { // GetFieldSize returns size of dynamic field GetFieldSize(name string, ctx Context) uint // GetFieldLength returns length of dynamic field GetFieldLength(name string, ctx Context) uint // IsOptFieldEnabled check whether if the optional field is enabled IsOptFieldEnabled(name string, ctx Context) bool // StringifyField returns field value as string StringifyField(name string, indent string, depth int, ctx Context) (string, bool) IsPString(name string, bytes []byte, remainingSize uint64, ctx Context) bool BeforeUnmarshal(r io.ReadSeeker, size uint64, ctx Context) (n uint64, override bool, err error) OnReadField(name string, r bitio.ReadSeeker, leftBits uint64, ctx Context) (rbits uint64, override bool, err error) OnWriteField(name string, w bitio.Writer, ctx Context) (wbits uint64, override bool, err error) }
type IImmutableBox ¶
type IImmutableBox interface { ICustomFieldObject // GetVersion returns the box version GetVersion() uint8 // GetFlags returns the flags GetFlags() uint32 // CheckFlag checks the flag status CheckFlag(uint32) bool // GetType returns the BoxType GetType() BoxType }
IImmutableBox is common interface of box
type IlstMetaContainer ¶ added in v0.4.0
type IlstMetaContainer struct {
AnyTypeBox
}
type Mdhd ¶
type Mdhd struct { FullBox `mp4:"0,extend"` CreationTimeV0 uint32 `mp4:"1,size=32,ver=0"` ModificationTimeV0 uint32 `mp4:"2,size=32,ver=0"` CreationTimeV1 uint64 `mp4:"3,size=64,ver=1"` ModificationTimeV1 uint64 `mp4:"4,size=64,ver=1"` Timescale uint32 `mp4:"5,size=32"` DurationV0 uint32 `mp4:"6,size=32,ver=0"` DurationV1 uint64 `mp4:"7,size=64,ver=1"` // Pad bool `mp4:"8,size=1,hidden"` Language [3]byte `mp4:"9,size=5,iso639-2"` // ISO-639-2/T language code PreDefined uint16 `mp4:"10,size=16"` }
Mdhd is ISOBMFF mdhd box type
func (*Mdhd) GetCreationTime ¶ added in v0.8.0
func (*Mdhd) GetDuration ¶ added in v0.8.0
func (*Mdhd) GetModificationTime ¶ added in v0.8.0
type Mehd ¶
type Mehd struct { FullBox `mp4:"0,extend"` FragmentDurationV0 uint32 `mp4:"1,size=32,ver=0"` FragmentDurationV1 uint64 `mp4:"2,size=64,ver=1"` }
Mehd is ISOBMFF mehd box type
func (*Mehd) GetFragmentDuration ¶ added in v0.8.0
type Meta ¶
type Meta struct {
FullBox `mp4:"0,extend"`
}
Meta is ISOBMFF meta box type
func (*Meta) BeforeUnmarshal ¶
type Mvhd ¶
type Mvhd struct { FullBox `mp4:"0,extend"` CreationTimeV0 uint32 `mp4:"1,size=32,ver=0"` ModificationTimeV0 uint32 `mp4:"2,size=32,ver=0"` CreationTimeV1 uint64 `mp4:"3,size=64,ver=1"` ModificationTimeV1 uint64 `mp4:"4,size=64,ver=1"` Timescale uint32 `mp4:"5,size=32"` DurationV0 uint32 `mp4:"6,size=32,ver=0"` DurationV1 uint64 `mp4:"7,size=64,ver=1"` Rate int32 `mp4:"8,size=32"` // fixed-point 16.16 - template=0x00010000 Volume int16 `mp4:"9,size=16"` // template=0x0100 Reserved int16 `mp4:"10,size=16,const=0"` Reserved2 [2]uint32 `mp4:"11,size=32,const=0"` Matrix [9]int32 `mp4:"12,size=32,hex"` // template={ 0x00010000,0,0,0,0x00010000,0,0,0,0x40000000 } PreDefined [6]int32 `mp4:"13,size=32"` NextTrackID uint32 `mp4:"14,size=32"` }
Mvhd is ISOBMFF mvhd box type
func (*Mvhd) GetCreationTime ¶ added in v0.8.0
func (*Mvhd) GetDuration ¶ added in v0.8.0
func (*Mvhd) GetModificationTime ¶ added in v0.8.0
func (*Mvhd) GetRateInt ¶ added in v0.3.0
GetRateInt returns value of rate as int16
type PixelAspectRatioBox ¶
type PixelAspectRatioBox struct { AnyTypeBox HSpacing uint32 `mp4:"0,size=32"` VSpacing uint32 `mp4:"1,size=32"` }
type ProbeInfo ¶ added in v0.6.0
type Pssh ¶
type Pssh struct { FullBox `mp4:"0,extend"` SystemID [16]byte `mp4:"1,size=8,uuid"` KIDCount uint32 `mp4:"2,size=32,nver=0"` KIDs []PsshKID `mp4:"3,nver=0,len=dynamic,size=128"` DataSize int32 `mp4:"4,size=32"` Data []byte `mp4:"5,size=8,len=dynamic"` }
Pssh is ISOBMFF pssh box type
func (*Pssh) GetFieldLength ¶
GetFieldLength returns length of dynamic field
type ReadHandle ¶
type ReadHandler ¶
type ReadHandler func(handle *ReadHandle) (val interface{}, err error)
type RollDistanceWithLength ¶ added in v0.3.0
type Saio ¶ added in v0.4.0
type Saio struct { FullBox `mp4:"0,extend"` AuxInfoType [4]byte `mp4:"1,size=8,opt=0x000001,string"` AuxInfoTypeParameter uint32 `mp4:"2,size=32,opt=0x000001,hex"` EntryCount uint32 `mp4:"3,size=32"` OffsetV0 []uint32 `mp4:"4,size=32,ver=0,len=dynamic"` OffsetV1 []uint64 `mp4:"5,size=64,nver=0,len=dynamic"` }
func (*Saio) GetFieldLength ¶ added in v0.4.0
type Saiz ¶ added in v0.4.0
type Saiz struct { FullBox `mp4:"0,extend"` AuxInfoType [4]byte `mp4:"1,size=8,opt=0x000001,string"` AuxInfoTypeParameter uint32 `mp4:"2,size=32,opt=0x000001,hex"` DefaultSampleInfoSize uint8 `mp4:"3,size=8,dec"` SampleCount uint32 `mp4:"4,size=32"` SampleInfoSize []uint8 `mp4:"5,size=8,opt=dynamic,len=dynamic,dec"` }
func (*Saiz) GetFieldLength ¶ added in v0.4.0
type SampleEntry ¶
type SampleEntry struct { AnyTypeBox Reserved [6]uint8 `mp4:"0,size=8,const=0"` DataReferenceIndex uint16 `mp4:"1,size=16"` }
type Sbgp ¶
type Schm ¶ added in v0.4.0
type Sdtp ¶ added in v0.4.0
type Sdtp struct { FullBox `mp4:"0,extend"` Samples []SdtpSampleElem `mp4:"1,size=8"` }
type SdtpSampleElem ¶ added in v0.4.0
type SegmentInfo
deprecated
type SegmentInfo = Segment
Deprecated: replace with Segment
type Segments ¶ added in v0.6.0
type Segments []*Segment
func (Segments) GetBitrate ¶ added in v0.6.0
type Sgpd ¶
type Sgpd struct { FullBox `mp4:"0,extend"` GroupingType [4]byte `mp4:"1,size=8,string"` DefaultLength uint32 `mp4:"2,size=32,ver=1"` DefaultSampleDescriptionIndex uint32 `mp4:"3,size=32,ver=2"` EntryCount uint32 `mp4:"4,size=32"` RollDistances []int16 `mp4:"5,size=16,opt=dynamic"` RollDistancesL []RollDistanceWithLength `mp4:"6,size=16,opt=dynamic"` AlternativeStartupEntries []AlternativeStartupEntry `mp4:"7,size=dynamic,len=dynamic,opt=dynamic"` AlternativeStartupEntriesL []AlternativeStartupEntryL `mp4:"8,len=dynamic,opt=dynamic"` VisualRandomAccessEntries []VisualRandomAccessEntry `mp4:"9,len=dynamic,opt=dynamic"` VisualRandomAccessEntriesL []VisualRandomAccessEntryL `mp4:"10,len=dynamic,opt=dynamic"` TemporalLevelEntries []TemporalLevelEntry `mp4:"11,len=dynamic,opt=dynamic"` TemporalLevelEntriesL []TemporalLevelEntryL `mp4:"12,len=dynamic,opt=dynamic"` Unsupported []byte `mp4:"13,size=8,opt=dynamic"` }
func (*Sgpd) GetFieldLength ¶ added in v0.3.0
type Sidx ¶ added in v0.2.0
type Sidx struct { FullBox `mp4:"0,extend"` ReferenceID uint32 `mp4:"1,size=32"` Timescale uint32 `mp4:"2,size=32"` EarliestPresentationTimeV0 uint32 `mp4:"3,size=32,ver=0"` FirstOffsetV0 uint32 `mp4:"4,size=32,ver=0"` EarliestPresentationTimeV1 uint64 `mp4:"5,size=64,nver=0"` FirstOffsetV1 uint64 `mp4:"6,size=64,nver=0"` Reserved uint16 `mp4:"7,size=16,const=0"` ReferenceCount uint16 `mp4:"8,size=16"` References []SidxReference `mp4:"9,size=96,len=dynamic"` }
func (*Sidx) GetEarliestPresentationTime ¶ added in v0.8.0
func (*Sidx) GetFieldLength ¶ added in v0.2.0
func (*Sidx) GetFirstOffset ¶ added in v0.8.0
type SidxReference ¶ added in v0.2.0
type Smhd ¶
type Smhd struct { FullBox `mp4:"0,extend"` Balance int16 `mp4:"1,size=16"` // fixed-point 8.8 template=0 Reserved uint16 `mp4:"2,size=16,const=0"` }
func (*Smhd) GetBalance ¶ added in v0.3.0
GetBalance returns value of width as float32
func (*Smhd) GetBalanceInt ¶ added in v0.3.0
GetBalanceInt returns value of width as int8
type Stco ¶
type Stco struct { FullBox `mp4:"0,extend"` EntryCount uint32 `mp4:"1,size=32"` ChunkOffset []uint32 `mp4:"2,size=32,len=dynamic"` }
Stco is ISOBMFF stco box type
func (*Stco) GetFieldLength ¶
GetFieldLength returns length of dynamic field
type StringData ¶ added in v0.4.0
type StringData struct { AnyTypeBox Data []byte `mp4:"0,size=8"` }
func (*StringData) StringifyField ¶ added in v0.4.0
func (sd *StringData) StringifyField(name string, indent string, depth int, ctx Context) (string, bool)
StringifyField returns field value as string
type Stsc ¶
type Stsc struct { FullBox `mp4:"0,extend"` EntryCount uint32 `mp4:"1,size=32"` Entries []StscEntry `mp4:"2,len=dynamic,size=96"` }
Stsc is ISOBMFF stsc box type
func (*Stsc) GetFieldLength ¶
GetFieldLength returns length of dynamic field
type Stss ¶
type Stss struct { FullBox `mp4:"0,extend"` EntryCount uint32 `mp4:"1,size=32"` SampleNumber []uint32 `mp4:"2,len=dynamic,size=32"` }
func (*Stss) GetFieldLength ¶
GetFieldLength returns length of dynamic field
type Stsz ¶
type Stsz struct { FullBox `mp4:"0,extend"` SampleSize uint32 `mp4:"1,size=32"` SampleCount uint32 `mp4:"2,size=32"` EntrySize []uint32 `mp4:"3,size=32,len=dynamic"` }
Stsz is ISOBMFF stsz box type
func (*Stsz) GetFieldLength ¶
GetFieldLength returns length of dynamic field
type Stts ¶
type Stts struct { FullBox `mp4:"0,extend"` EntryCount uint32 `mp4:"1,size=32"` Entries []SttsEntry `mp4:"2,len=dynamic,size=64"` }
Stts is ISOBMFF stts box type
func (*Stts) GetFieldLength ¶
GetFieldLength returns length of dynamic field
type Styp ¶ added in v0.2.0
type Styp struct { Box MajorBrand [4]byte `mp4:"0,size=8,string"` MinorVersion uint32 `mp4:"1,size=32"` CompatibleBrands []CompatibleBrandElem `mp4:"2,size=32"` // reach to end of the box }
type TemporalLevelEntry ¶
type TemporalLevelEntryL ¶ added in v0.3.0
type TemporalLevelEntryL struct { DescriptionLength uint32 `mp4:"0,size=32"` TemporalLevelEntry `mp4:"1,extend"` }
type Tenc ¶ added in v0.4.0
type Tenc struct { FullBox `mp4:"0,extend"` Reserved uint8 `mp4:"1,size=8,dec"` DefaultCryptByteBlock uint8 `mp4:"2,size=4,dec"` // always 0 on version 0 DefaultSkipByteBlock uint8 `mp4:"3,size=4,dec"` // always 0 on version 0 DefaultIsProtected uint8 `mp4:"4,size=8,dec"` DefaultPerSampleIVSize uint8 `mp4:"5,size=8,dec"` DefaultKID [16]byte `mp4:"6,size=8,uuid"` DefaultConstantIVSize uint8 `mp4:"7,size=8,opt=dynamic,dec"` DefaultConstantIV []byte `mp4:"8,size=8,opt=dynamic,len=dynamic"` }
Tenc is ISOBMFF tenc box type
func (*Tenc) GetFieldLength ¶ added in v0.4.0
type Tfdt ¶
type Tfdt struct { FullBox `mp4:"0,extend"` BaseMediaDecodeTimeV0 uint32 `mp4:"1,size=32,ver=0"` BaseMediaDecodeTimeV1 uint64 `mp4:"2,size=64,ver=1"` }
Tfdt is ISOBMFF tfdt box type
func (*Tfdt) GetBaseMediaDecodeTime ¶ added in v0.8.0
type Tfhd ¶
type Tfhd struct { FullBox `mp4:"0,extend"` TrackID uint32 `mp4:"1,size=32"` // optional BaseDataOffset uint64 `mp4:"2,size=64,opt=0x000001"` SampleDescriptionIndex uint32 `mp4:"3,size=32,opt=0x000002"` DefaultSampleDuration uint32 `mp4:"4,size=32,opt=0x000008"` DefaultSampleSize uint32 `mp4:"5,size=32,opt=0x000010"` DefaultSampleFlags uint32 `mp4:"6,size=32,opt=0x000020,hex"` }
Tfhd is ISOBMFF tfhd box type
type Tfra ¶
type Tfra struct { FullBox `mp4:"0,extend"` TrackID uint32 `mp4:"1,size=32"` Reserved uint32 `mp4:"2,size=26,const=0"` LengthSizeOfTrafNum byte `mp4:"3,size=2"` LengthSizeOfTrunNum byte `mp4:"4,size=2"` LengthSizeOfSampleNum byte `mp4:"5,size=2"` NumberOfEntry uint32 `mp4:"6,size=32"` Entries []TfraEntry `mp4:"7,len=dynamic,size=dynamic"` }
Tfra is ISOBMFF tfra box type
func (*Tfra) GetFieldLength ¶
GetFieldLength returns length of dynamic field
func (*Tfra) GetFieldSize ¶
GetFieldSize returns size of dynamic field
func (*Tfra) GetMoofOffset ¶ added in v0.8.0
type TfraEntry ¶
type TfraEntry struct { TimeV0 uint32 `mp4:"0,size=32,ver=0"` MoofOffsetV0 uint32 `mp4:"1,size=32,ver=0"` TimeV1 uint64 `mp4:"2,size=64,ver=1"` MoofOffsetV1 uint64 `mp4:"3,size=64,ver=1"` TrafNumber uint32 `mp4:"4,size=dynamic"` TrunNumber uint32 `mp4:"5,size=dynamic"` SampleNumber uint32 `mp4:"6,size=dynamic"` }
type Tkhd ¶
type Tkhd struct { FullBox `mp4:"0,extend"` CreationTimeV0 uint32 `mp4:"1,size=32,ver=0"` ModificationTimeV0 uint32 `mp4:"2,size=32,ver=0"` CreationTimeV1 uint64 `mp4:"3,size=64,ver=1"` ModificationTimeV1 uint64 `mp4:"4,size=64,ver=1"` TrackID uint32 `mp4:"5,size=32"` Reserved0 uint32 `mp4:"6,size=32,const=0"` DurationV0 uint32 `mp4:"7,size=32,ver=0"` DurationV1 uint64 `mp4:"8,size=64,ver=1"` // Reserved1 [2]uint32 `mp4:"9,size=32,const=0"` Layer int16 `mp4:"10,size=16"` // template=0 AlternateGroup int16 `mp4:"11,size=16"` // template=0 Volume int16 `mp4:"12,size=16"` // template={if track_is_audio 0x0100 else 0} Reserved2 uint16 `mp4:"13,size=16,const=0"` Matrix [9]int32 `mp4:"14,size=32,hex"` // template={ 0x00010000,0,0,0,0x00010000,0,0,0,0x40000000 }; Width uint32 `mp4:"15,size=32"` // fixed-point 16.16 Height uint32 `mp4:"16,size=32"` // fixed-point 16.16 }
Tkhd is ISOBMFF tkhd box type
func (*Tkhd) GetCreationTime ¶ added in v0.8.0
func (*Tkhd) GetDuration ¶ added in v0.8.0
func (*Tkhd) GetHeightInt ¶ added in v0.3.0
GetHeightInt returns value of height as uint16
func (*Tkhd) GetModificationTime ¶ added in v0.8.0
func (*Tkhd) GetWidthInt ¶ added in v0.3.0
GetWidthInt returns value of width as uint16
type Trex ¶
type Trex struct { FullBox `mp4:"0,extend"` TrackID uint32 `mp4:"1,size=32"` DefaultSampleDescriptionIndex uint32 `mp4:"2,size=32"` DefaultSampleDuration uint32 `mp4:"3,size=32"` DefaultSampleSize uint32 `mp4:"4,size=32"` DefaultSampleFlags uint32 `mp4:"5,size=32,hex"` }
Trex is ISOBMFF trex box type
type Trun ¶
type Trun struct { FullBox `mp4:"0,extend"` SampleCount uint32 `mp4:"1,size=32"` // optional fields DataOffset int32 `mp4:"2,size=32,opt=0x000001"` FirstSampleFlags uint32 `mp4:"3,size=32,opt=0x000004,hex"` Entries []TrunEntry `mp4:"4,len=dynamic,size=dynamic"` }
Trun is ISOBMFF trun box type
func (*Trun) GetFieldLength ¶
GetFieldLength returns length of dynamic field
func (*Trun) GetFieldSize ¶
GetFieldSize returns size of dynamic field
func (*Trun) GetSampleCompositionTimeOffset ¶ added in v0.8.0
type TrunEntry ¶
type TrunEntry struct { SampleDuration uint32 `mp4:"0,size=32,opt=0x000100"` SampleSize uint32 `mp4:"1,size=32,opt=0x000200"` SampleFlags uint32 `mp4:"2,size=32,opt=0x000400,hex"` SampleCompositionTimeOffsetV0 uint32 `mp4:"3,size=32,opt=0x000800,ver=0"` SampleCompositionTimeOffsetV1 int32 `mp4:"4,size=32,opt=0x000800,nver=0"` }
type Udta3GppString ¶ added in v0.4.0
type Udta3GppString struct { AnyTypeBox FullBox `mp4:"0,extend"` Pad bool `mp4:"1,size=1,hidden"` Language [3]byte `mp4:"2,size=5,iso639-2"` // ISO-639-2/T language code Data []byte `mp4:"3,size=8,string"` }
type Urn ¶
type VisualRandomAccessEntry ¶
type VisualRandomAccessEntryL ¶ added in v0.3.0
type VisualRandomAccessEntryL struct { DescriptionLength uint32 `mp4:"0,size=32"` VisualRandomAccessEntry `mp4:"1,extend"` }
type VisualSampleEntry ¶
type VisualSampleEntry struct { SampleEntry `mp4:"0,extend"` PreDefined uint16 `mp4:"1,size=16"` Reserved uint16 `mp4:"2,size=16,const=0"` PreDefined2 [3]uint32 `mp4:"3,size=32"` Width uint16 `mp4:"4,size=16"` Height uint16 `mp4:"5,size=16"` Horizresolution uint32 `mp4:"6,size=32"` Vertresolution uint32 `mp4:"7,size=32"` Reserved2 uint32 `mp4:"8,size=32,const=0"` FrameCount uint16 `mp4:"9,size=16"` Compressorname [32]byte `mp4:"10,size=8"` Depth uint16 `mp4:"11,size=16"` PreDefined3 int16 `mp4:"12,size=16"` }
func (*VisualSampleEntry) StringifyField ¶
func (vse *VisualSampleEntry) StringifyField(name string, indent string, depth int, ctx Context) (string, bool)
StringifyField returns field value as string
type Vmhd ¶
type Vmhd struct { FullBox `mp4:"0,extend"` Graphicsmode uint16 `mp4:"1,size=16"` // template=0 Opcolor [3]uint16 `mp4:"2,size=16"` // template={0, 0, 0} }
Vmhd is ISOBMFF vmhd box type
type Writer ¶ added in v0.6.0
type Writer struct {
// contains filtered or unexported fields
}
func NewWriter ¶ added in v0.6.0
func NewWriter(w io.WriteSeeker) *Writer
func (*Writer) CopyBox ¶ added in v0.6.0
func (w *Writer) CopyBox(r io.ReadSeeker, bi *BoxInfo) error