Documentation ¶
Index ¶
- Constants
- func GetDurationString(duration uint32, timescale uint32) string
- type Avc1Box
- type Box
- type EdtsBox
- type ElstBox
- type Fixed16
- type Fixed32
- type FtypBox
- type HdlrBox
- type HmhdBox
- type MdatBox
- type MdhdBox
- type MdiaBox
- type MinfBox
- type MoovBox
- type Mp4Reader
- type MvhdBox
- type StblBox
- type StsdBox
- type SttsBox
- type TkhdBox
- type TrakBox
- type UuidBox
- type VmhdBox
Constants ¶
const ( // BoxHeaderSize Size of box header. BoxHeaderSize = 8 UuidSize = 16 )
const ( TrackFlagEnabled = 0x0001 TrackFlagInMovie = 0x0002 TrackFlagInPreview = 0x0004 )
Flag constants.
Variables ¶
This section is empty.
Functions ¶
func GetDurationString ¶
GetDurationString Helper function to print a duration value in the form H:MM:SS.MS
Types ¶
type Box ¶
Box defines an Atom Box structure.
func (*Box) ReadBoxData ¶
ReadBoxData reads the box data from an atom box.
type EdtsBox ¶
EdtsBox - Edit Box Box Type: edts Container: Track Box (trak) Mandatory: No Quantity: Zero or one
type ElstBox ¶
type ElstBox struct { *Box Version uint32 // Version of this box. EntryCount uint32 // Integer that gives the number of entries. Entries []elstEntry }
ElstBox - Edit List Box Box Type: elst Container: Edit Box (edts) Mandatory: No Quantity: Zero or one
type FtypBox ¶
type FtypBox struct { *Box MajorBrand string // Brand identifer. MinorVersion uint32 // Informative integer for the minor version of the major brand. CompatibleBrands []string // A list, to the end of the box, of brands. }
FtypBox - File Type Box Box Type: ftyp Container: File Mandatory: Yes Quantity: Exactly one
type HdlrBox ¶
HdlrBox - Handler Reference Box Box Type: hdlr Container: Media Box (mdia) or Meta Box (meta) Mandatory: Yes Quantity: Exactly one
type HmhdBox ¶
type HmhdBox struct { *Box Version byte MaxPDUSize uint16 AvgPDUSize uint16 MaxBitrate uint32 AvgBitrate uint32 }
HmhdBox - Hint Media Header Box Box Type: hmhd Container: Media Information Box (minf). Mandatory: Yes Quantity: Exactly one specific media header shall be present.
Contains general information, independent of the protocol, for hint tracks.
type MdatBox ¶
type MdatBox struct {
*Box
}
MdatBox - Media Data Box Box Type: mdat Container: File Mandatory: No Quantity: Any number.
A container box which can hold the actual media data for a presentation (mdat).
type MdhdBox ¶
type MdhdBox struct { *Box Version byte Flags uint32 CreationTime uint32 ModificationTime uint32 Timescale uint32 Duration uint32 Language uint16 LanguageString string }
MdhdBox - Media Header Box Box Type: mdhd Container: Media Box (mdia) Mandatory: Yes Quantity: Any number.
The media header declares overall information that is media-independent, and relevant to characteristics of the media in a track.
type MdiaBox ¶
MdiaBox - Media Box Box Type: mdia Container: Track Box (trak) Mandatory: Yes Quantity: Exactly one. The media declaration container contains all the objects that declare information about the media data within a track.
type MinfBox ¶
MinfBox - Media Information Box Box Type: minf Container: Media Box (mdia) Mandatory: Yes Quantity: Exactly one.
This box contains all the objects that declare characteristics information of the media in the track.
type MoovBox ¶
type MoovBox struct { *Box Mvhd *MvhdBox Traks []*TrakBox IsFragmented bool // check for mvex box exists }
MoovBox - Movie Box Box Type: moov Container: File Mandatory: Yes Quantity: Exactly one.
The metadata for a presentation is stored in the single Movie Box which occurs at the top-level of a file. Normally this box is close to the beginning or end of the file, though this is not required.
type Mp4Reader ¶
type Mp4Reader struct { Reader io.ReaderAt Ftyp *FtypBox Moov *MoovBox Mdat *MdatBox Uuids []*UuidBox Size int64 IsFragmented bool }
Mp4Reader defines an mp4 reader structure.
type MvhdBox ¶
type MvhdBox struct { *Box Flags uint32 Version uint8 CreationTime uint32 ModificationTime uint32 Timescale uint32 Duration uint32 Rate Fixed32 Volume Fixed16 }
MvhdBox - Movie Header Box Box Type: mvhd Container: Movie Box (moov) Mandatory: Yes Quantity: Exactly one.
This box defines overall information which is media-independent, and relevant to the entire presentationconsidered as a whole.
type StblBox ¶
StblBox - Sample Table Box Box Type: stbl Container: Media Information Box (minf) Mandatory: Yes Quantity: Exactly one.
type StsdBox ¶
StsdBox - Sample Description Box Box Type: stsd Container: Sample Table Box (stbl) Mandatory: Yes Quantity: Exactly one.
type SttsBox ¶
type SttsBox struct { *Box Version byte Flags uint32 EntryCount uint32 SampleCounts []uint32 SampleDeltas []uint32 }
SttsBox - Decoding Time to Sample Box Box Type: stts Container: Sample Table Box (stbl) Mandatory: Yes Quantity: Exactly one.
type TkhdBox ¶
type TkhdBox struct { *Box Version byte Flags uint32 CreationTime uint32 ModificationTime uint32 TrackID uint32 Duration uint32 Layer uint16 AlternateGroup uint16 Volume Fixed16 Matrix []byte Width, Height Fixed32 }
TkhdBox - Track Header Box Box Type: tkhd Container: Track Box (trak) Mandatory: Yes Quantity: Exactly one.
type TrakBox ¶
TrakBox - Track Box Box Type: tkhd Container: Movie Box (moov) Mandatory: Yes Quantity: One or more.