Documentation ¶
Index ¶
- func CreateDashFragment(mp4 map[string][]interface{}, fragmentNumber uint32, fragmentDuration uint32) (fmp4 map[string][]interface{})
- func CreateDashFragmentWithConf(dConf DashConfig, filename string, fragmentNumber uint32, ...) (fmp4 map[string][]interface{})
- func CreateDashInit(mp4 map[string][]interface{}) (mp4Init map[string][]interface{})
- func CreateDashInitWithConf(dConf DashConfig) (mp4Init map[string][]interface{})
- func Debug(mode bool)
- func MapToBytes(mp4 map[string][]interface{}) (data []byte)
- type Avc1Box
- type AvcCBox
- type BtrtBox
- type CttsBox
- type CttsBoxEntry
- type DashAudioEntry
- type DashConfig
- type DashVideoEntry
- type DrefBox
- type DrefUrlBox
- type DrefUrnBox
- type ElstBox
- type EsdsBox
- type FreeBox
- type FrmaBox
- type FtypBox
- type HdlrBox
- type HmhdBox
- type JsonConfig
- type MdatBox
- type MdhdBox
- type MehdBox
- type MfhdBox
- type Mp4
- type Mp4aBox
- type MvhdBox
- type ParentBox
- type SchmBox
- type SdtpBox
- type SmhdBox
- type StcoBox
- type StscBox
- type StscEntry
- type StsdBox
- type StssBox
- type StszBox
- type SttsBox
- type SttsBoxEntry
- type StypBox
- type TfdtBox
- type TfhdBox
- type TkhdBox
- type TrackEntry
- type TrexBox
- type TrunBox
- type TrunBoxSample
- type VmhdBox
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDashFragment ¶
func CreateDashFragmentWithConf ¶
func CreateDashFragmentWithConf(dConf DashConfig, filename string, fragmentNumber uint32, fragmentDuration uint32) (fmp4 map[string][]interface{})
func CreateDashInit ¶
Create a DASH format mp4 Init header
func CreateDashInitWithConf ¶
func CreateDashInitWithConf(dConf DashConfig) (mp4Init map[string][]interface{})
Create DASH init header with a config struct
func MapToBytes ¶
Types ¶
type Avc1Box ¶
type Avc1Box struct { Size uint32 Reserved [6]byte Version uint16 RevisionLevel uint16 Vendor uint32 TemporalQuality uint32 SpacialQuality uint32 Width uint16 Height uint16 HorizontalResolution uint32 VerticalResolution uint32 EntryDataSize uint32 FramesPerSample uint16 CompressorName [32]byte BitDepth uint16 ColorTableIndex int16 // contains filtered or unexported fields }
type AvcCBox ¶
type AvcCBox struct { Size uint32 ConfigurationVersion uint8 /* 1 */ AVCProfileIndication uint8 /* profile idc in SPS */ ProfileCompatibility uint8 AVCLevelIndication uint8 /* level idc in SPS */ NalUnitSize uint8 /* in bytes of the NALUnitLength field. upper 6-bits are reserved as 111111b aka | 0xfc */ SPSEntryCount uint8 /* Number of Sequence Parameter Set Entries */ SPSSize uint16 /* Sequence Parameter Set Size upper 3-bits are reserved as 111b aka | 0xe0 */ SPSData []byte /* Sequence Parameter Set Datas */ PPSEntryCount uint8 /* Number of Picture Parameter Set Entries */ PPSSize uint16 /* Picture Parameter Set Size */ PPSData []byte /* Picture Parameter Set Datas */ }
type BtrtBox ¶
type BtrtBox struct { Size uint32 DecodingBufferSize uint32 /* the size of the decoding buffer for the elementary stream in bytes */ MaxBitrate uint32 /* the maximum rate in bits/second over any window of one second */ AvgBitrate uint32 /* the average rate in bits/second over the entire presentation */ }
MPEG-4 Bit Rate Box * This box signals the bit rate information of the AVC video stream.
type CttsBox ¶
type CttsBoxEntry ¶
type DashAudioEntry ¶
type DashConfig ¶
type DashConfig struct { StszBoxOffset int64 StszBoxSize uint32 MdatBoxOffset int64 MdatBoxSize uint32 // MDAT MP4 Box Size Type string // "audio" || "video Rate int32 // Typically 0x00010000 (1.0) Volume int16 // Typically 0x0100 (Full Volume) Duration uint64 // MDHD MP4 Box info Timescale uint32 // MDHD MP4 Box info (eg: for audio: 48000, for video: 60000) Language [3]byte // ISO-639-2/T 3 letters code (eg: []byte{ 'e', 'n', 'g' } HandlerType uint32 // HDLR MP4 Box info (eg: 1986618469) SampleDelta uint32 // STTS MP4 Box SampleDelta via Entries[0] (eg: 1024) MediaTime int64 // ELST MP4 Box MediaTime Audio *DashAudioEntry `json:",omitempty"` Video *DashVideoEntry `json:",omitempty"` }
type DashVideoEntry ¶
type DashVideoEntry struct { // Video fields if Type == "video" Width uint16 // AVC1 MP4 Box info (eg: 426) Height uint16 // AVC1 MP4 Box info (eg: 240) HorizontalResolution uint32 // AVC1 MP4 Box info (eg: 4718592) VerticalResolution uint32 // AVC1 MP4 Box info (eg: 4718592) EntryDataSize uint32 // AVC1 MP4 Box info (eg: 0) FramesPerSample uint16 // AVC1 MP4 Box info (eg: 1) BitDepth uint16 // AVC1 MP4 Box info (eg: 24) ColorTableIndex int16 // AVC1 MP4 Box info (eg: -1) CodecInfo [3]byte // AVCC MP4 Box AVC Profile/Comptaiblity/Level Information (eg: []byte{ 0x42, 0xC0, 0x1E } NalUnitSize byte // AVCC MP4 Box info NALUnitLength field. upper 6-bits are reserved as 111111b aka | 0xfc (eg: 0xFF) SPSEntryCount uint8 // AVCC MP4 Box info (eg: 1) SPSSize uint16 // AVCC MP4 Box info (eg: 23) SPSData []byte // AVCC MP4 Box info (eg: [103 66 192 30 219 2 128 191 229 192 68 0 0 15 164 0 7 83 0 60 88 187 128]) PPSEntryCount uint8 // AVCC MP4 Box info (eg: 1) PPSSize uint16 // AVCC MP4 Box info (eg: 4) PPSData []byte // AVCC MP4 Box info (eg: 104 202 140 178) StssBoxOffset int64 StssBoxSize uint32 CttsBoxOffset int64 CttsBoxSize uint32 }
type DrefBox ¶
type DrefBox struct { Size uint32 Version byte Reserved [3]byte EntryCount uint32 UrlBox []DrefUrlBox UrnBox []DrefUrnBox }
type DrefUrnBox ¶
type FtypBox ¶
type HdlrBox ¶
type JsonConfig ¶
type JsonConfig struct { SegmentDuration uint32 Tracks map[string][]TrackEntry }
type MdhdBox ¶
type Mp4 ¶
type Mp4aBox ¶
type MvhdBox ¶
type SchmBox ¶
type StcoBox ¶
type StscBox ¶
type StssBox ¶
type StszBox ¶
type SttsBox ¶
type SttsBox struct { Size uint32 Version byte Reserved [3]byte EntryCount uint32 Entries []SttsBoxEntry }
type SttsBoxEntry ¶
type StypBox ¶
type TfdtBox ¶
type TfhdBox ¶
type TkhdBox ¶
type TrackEntry ¶
type TrackEntry struct { Name string Bandwidth uint64 File string Lang string Config *DashConfig `json:",omitempty"` }
type TrexBox ¶
type TrunBox ¶
type TrunBoxSample ¶
Click to show internal directories.
Click to hide internal directories.