Documentation ¶
Index ¶
- Constants
- func FillAMF0Val(b []byte, _val interface{}) (n int)
- func FillFileHeader(b []byte, flags uint8) (n int)
- func FillTagHeader(b []byte, tagtype uint8, datalen int, ts int32) (n int)
- func FillTagTrailer(b []byte, datalen int) (n int)
- func LenAMF0Val(_val interface{}) (n int)
- func ParseAMF0Val(b []byte) (val interface{}, n int, err error)
- func ParseFileHeader(b []byte) (flags uint8, skip int, err error)
- func TimeToTs(tm time.Duration) int32
- func TsToTime(ts int32) time.Duration
- func WriteTag(w io.Writer, tag Tag, ts int32, b []byte) (err error)
- type AMF0ParseError
- type AMFArray
- type AMFECMAArray
- type AMFMap
- type Tag
Constants ¶
View Source
const ( // TagAudio const TagAudio = 8 //TagVideo const TagVideo = 9 // TagScriptdata const TagScriptdata = 18 )
View Source
const ( // SoundMP3 const SoundMP3 = 2 // SoundNellymoser16KhzMono const SoundNellymoser16KhzMono = 4 // SoundNellymoser8KhzMono const SoundNellymoser8KhzMono = 5 // SoundNellymoser const SoundNellymoser = 6 // SoundAlaw const SoundAlaw = 7 // SoundMulaw const SoundMulaw = 8 // SoundAAC const SoundAAC = 10 // SoundSpeex const SoundSpeex = 11 // Sound5Dot5Khz const Sound5Dot5Khz = 0 // Sound11Khz const Sound11Khz = 1 // Sound22Khz const Sound22Khz = 2 // Sound44Khz const Sound44Khz = 3 // Sound8Bit const Sound8Bit = 0 // Sound16Bit const Sound16Bit = 1 // SoundMono const SoundMono = 0 // SoundStereo const SoundStereo = 1 // AACSeqhdr const AACSeqhdr = 0 // AACRaw const AACRaw = 1 )
View Source
const ( // AvcSeqhdr const AvcSeqhdr = 0 // AvcNalu const AvcNalu = 1 //AvcEos const AvcEos = 2 // FrameKey const FrameKey = 1 // FrameInter const FrameInter = 2 // VideoH264 const VideoH264 = 7 )
View Source
const ( // FileHasAudio const FileHasAudio = 0x4 // FileHasVideo const FileHasVideo = 0x1 )
View Source
const FileHeaderLength = 9
FileHeaderLength const
View Source
const MaxTagSubHeaderLength = 16
MaxTagSubHeaderLength const
View Source
const TagHeaderLength = 11
TagHeaderLength const
View Source
const TagTrailerLength = 4
TagTrailerLength const
Variables ¶
This section is empty.
Functions ¶
func FillTagHeader ¶
FillTagHeader func
func ParseAMF0Val ¶
ParseAMF0Val func
func ParseFileHeader ¶
ParseFileHeader func
Types ¶
type AMF0ParseError ¶
type AMF0ParseError struct { Offset int Message string Next *AMF0ParseError }
AMF0ParseError struct
type Tag ¶
type Tag struct { Type uint8 /* SoundFormat: UB[4] 0 = Linear PCM, platform endian 1 = ADPCM 2 = MP3 3 = Linear PCM, little endian 4 = Nellymoser 16-kHz mono 5 = Nellymoser 8-kHz mono 6 = Nellymoser 7 = G.711 A-law logarithmic PCM 8 = G.711 mu-law logarithmic PCM 9 = reserved 10 = AAC 11 = Speex 14 = MP3 8-Khz 15 = Device-specific sound Formats 7, 8, 14, and 15 are reserved for internal use AAC is supported in Flash Player 9,0,115,0 and higher. Speex is supported in Flash Player 10 and higher. */ SoundFormat uint8 /* SoundRate: UB[2] Sampling rate 0 = 5.5-kHz For AAC: always 3 1 = 11-kHz 2 = 22-kHz 3 = 44-kHz */ SoundRate uint8 /* SoundSize: UB[1] 0 = snd8Bit 1 = snd16Bit Size of each sample. This parameter only pertains to uncompressed formats. Compressed formats always decode to 16 bits internally */ SoundSize uint8 /* SoundType: UB[1] 0 = sndMono 1 = sndStereo Mono or stereo sound For Nellymoser: always 0 For AAC: always 1 */ SoundType uint8 /* 0: AAC sequence header 1: AAC raw */ AACPacketType uint8 /* 1: keyframe (for AVC, a seekable frame) 2: inter frame (for AVC, a non- seekable frame) 3: disposable inter frame (H.263 only) 4: generated keyframe (reserved for server use only) 5: video info/command frame */ FrameType uint8 /* 1: JPEG (currently unused) 2: Sorenson H.263 3: Screen video 4: On2 VP6 5: On2 VP6 with alpha channel 6: Screen video version 2 7: AVC */ CodecID uint8 /* 0: AVC sequence header 1: AVC NALU 2: AVC end of sequence (lower level NALU sequence ender is not required or supported) */ AVCPacketType uint8 CompositionTime int32 Data []byte }
Tag struct
func ParseTagHeader ¶
ParseTagHeader func
Click to show internal directories.
Click to hide internal directories.