avformat

package
v0.0.0-...-fc9add9 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlvHeaderSize    int = 13
	FlvTagHeaderSize int = 11
	FlvPreTagLenSize int = 4
)

Variables

This section is empty.

Functions

func Btoi

func Btoi(b bool) int

func FlvGetDataSize

func FlvGetDataSize(data []byte) (size uint32, err error)

func FlvGetPreTagSize

func FlvGetPreTagSize(data []byte) (size uint32, err error)

func FlvGetStreamId

func FlvGetStreamId(data []byte) (streamid uint32, err error)

func FlvGetTimestamp

func FlvGetTimestamp(data []byte) (ts uint32, err error)

Types

type FlvHeader

type FlvHeader struct {
	Signature   FlvHeaderSignature
	Version     NativeUint8
	EnableAudio bool
	EnableVideo bool
	Offset      NativeUint32
	PreTagSize0 NativeUint32
}

func ReadFlvHeader

func ReadFlvHeader(r io.Reader) (h *FlvHeader, err error)

func (*FlvHeader) ToData

func (h *FlvHeader) ToData() (data []byte, err error)

func (*FlvHeader) ToMessage

func (h *FlvHeader) ToMessage() (m *FlvMessage, err error)

type FlvHeaderSignature

type FlvHeaderSignature [3]byte

func (*FlvHeaderSignature) MarshalBinary

func (v *FlvHeaderSignature) MarshalBinary() (data []byte, err error)

func (*FlvHeaderSignature) Size

func (v *FlvHeaderSignature) Size() int

func (*FlvHeaderSignature) UnmarshalBinary

func (v *FlvHeaderSignature) UnmarshalBinary(data []byte) (err error)

type FlvMessage

type FlvMessage struct {
	Tag    *FlvTag
	Header *FlvHeader

	MetaData            bool
	VideoSequenceHeader bool
	AudioSequenceHeader bool
}

func NewFlvMessage

func NewFlvMessage() (m *FlvMessage, e error)

func (*FlvMessage) Copy

func (v *FlvMessage) Copy() (m *FlvMessage)

type FlvTag

type FlvTag struct {
	TagType   RtmpMessageType
	DataSize  NativeUint24
	TimeStamp FlvTagTimestamp
	StreamId  NativeUint24
	Payload   []byte
}

func ReadFlvTag

func ReadFlvTag(r io.Reader) (tag *FlvTag, err error)

func (*FlvTag) PreTagSizeBytes

func (tag *FlvTag) PreTagSizeBytes() (data []byte, err error)

func (*FlvTag) TagHeaderBytes

func (tag *FlvTag) TagHeaderBytes() (data []byte, err error)

func (*FlvTag) ToMessage

func (tag *FlvTag) ToMessage() (m *FlvMessage, err error)

type FlvTagTimestamp

type FlvTagTimestamp uint64

func (*FlvTagTimestamp) MarshalBinary

func (v *FlvTagTimestamp) MarshalBinary() (data []byte, err error)

func (*FlvTagTimestamp) Size

func (v *FlvTagTimestamp) Size() int

func (*FlvTagTimestamp) UnmarshalBinary

func (v *FlvTagTimestamp) UnmarshalBinary(data []byte) (err error)

type Marshaler

type Marshaler interface {
	encoding.BinaryUnmarshaler
	encoding.BinaryMarshaler
	Size() int
}

type NativeUint16

type NativeUint16 uint16

func (*NativeUint16) MarshalBinary

func (v *NativeUint16) MarshalBinary() (data []byte, err error)

func (*NativeUint16) Size

func (v *NativeUint16) Size() int

func (*NativeUint16) UnmarshalBinary

func (v *NativeUint16) UnmarshalBinary(data []byte) (err error)

type NativeUint24

type NativeUint24 uint32

func (*NativeUint24) MarshalBinary

func (v *NativeUint24) MarshalBinary() (data []byte, err error)

func (*NativeUint24) Size

func (v *NativeUint24) Size() int

func (*NativeUint24) UnmarshalBinary

func (v *NativeUint24) UnmarshalBinary(data []byte) (err error)

type NativeUint32

type NativeUint32 uint32

func (*NativeUint32) MarshalBinary

func (v *NativeUint32) MarshalBinary() (data []byte, err error)

func (*NativeUint32) Size

func (v *NativeUint32) Size() int

func (*NativeUint32) UnmarshalBinary

func (v *NativeUint32) UnmarshalBinary(data []byte) (err error)

type NativeUint64

type NativeUint64 uint64

func (*NativeUint64) MarshalBinary

func (v *NativeUint64) MarshalBinary() (data []byte, err error)

func (*NativeUint64) Size

func (v *NativeUint64) Size() int

func (*NativeUint64) UnmarshalBinary

func (v *NativeUint64) UnmarshalBinary(data []byte) (err error)

type NativeUint8

type NativeUint8 uint8

func (*NativeUint8) MarshalBinary

func (v *NativeUint8) MarshalBinary() (data []byte, err error)

func (*NativeUint8) Size

func (v *NativeUint8) Size() int

func (*NativeUint8) UnmarshalBinary

func (v *NativeUint8) UnmarshalBinary(data []byte) (err error)

type RtmpAVCFrame

type RtmpAVCFrame uint8

E.4.3.1 VIDEODATA Frame Type UB [4] Type of video frame. The following values are defined:

1 = key frame (for AVC, a seekable frame)
2 = inter frame (for AVC, a non-seekable frame)
3 = disposable inter frame (H.263 only)
4 = generated key frame (reserved for server use only)
5 = video info/command frame
const (
	RtmpReservedAVCFrame RtmpAVCFrame = iota
	RtmpKeyFrame
	RtmpInterFrame
	RtmpDisposableInterFrame
	RtmpGeneratedKeyFrame
	RtmpVideoInfoFrame
	RtmpReserved1AVCFrame
)

type RtmpAacType

type RtmpAacType uint8

AACPacketType IF SoundFormat == 10 UI8 The following values are defined:

0 = AAC sequence header
1 = AAC raw
const (
	RtmpAacSequenceHeader RtmpAacType = iota
	RtmpAacRawData
	RtmpAacReserved
)

type RtmpCodecAudio

type RtmpCodecAudio uint8

SoundFormat UB [4] Format of SoundData. The following values are defined:

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. AAC is supported in Flash Player 9,0,115,0 and higher. Speex is supported in Flash Player 10 and higher.

const (
	RtmpLinearPCMPlatformEndian RtmpCodecAudio = iota
	RtmpADPCM
	RtmpMP3
	RtmpLinearPCMLittleEndian
	RtmpNellymoser16kHzMono
	RtmpNellymoser8kHzMono
	RtmpNellymoser
	RtmpReservedG711AlawLogarithmicPCM
	RtmpReservedG711MuLawLogarithmicPCM
	RtmpReserved
	RtmpAAC
	RtmpSpeex
	RtmpReserved1CodecAudio
	RtmpReserved2CodecAudio
	RtmpReservedMP3_8kHz
	RtmpReservedDeviceSpecificSound
	RtmpReserved3CodecAudio
	RtmpDisabledCodecAudio
)

type RtmpCodecVideo

type RtmpCodecVideo uint8

E.4.3.1 VIDEODATA CodecID UB [4] Codec Identifier. The following values are defined:

2 = Sorenson H.263
3 = Screen video
4 = On2 VP6
5 = On2 VP6 with alpha channel
6 = Screen video version 2
7 = AVC
const (
	RtmpReservedCodecVideo RtmpCodecVideo = iota
	RtmpReserved1CodecVideo
	RtmpSorensonH263
	RtmpScreenVideo
	RtmpOn2VP6
	RtmpOn2VP6WithAlphaChannel
	RtmpScreenVideoVersion2
	RtmpAVC
	RtmpDisabledCodecVideo
	RtmpReserved2CodecVideo
)

type RtmpMessageType

type RtmpMessageType NativeUint8
const (
	RtmpMsgAmf0DataMessage RtmpMessageType = 18 // 0x12
	RtmpMsgAmf3DataMessage RtmpMessageType = 15 // 0x0F

	RtmpMsgAudioMessage RtmpMessageType = 8 // 0x08
	RtmpMsgVideoMessage RtmpMessageType = 9 // 0x09
)

func (*RtmpMessageType) MarshalBinary

func (v *RtmpMessageType) MarshalBinary() (data []byte, err error)

func (*RtmpMessageType) Size

func (v *RtmpMessageType) Size() int

func (*RtmpMessageType) UnmarshalBinary

func (v *RtmpMessageType) UnmarshalBinary(data []byte) (err error)

type RtmpVideoAVCType

type RtmpVideoAVCType uint8

AVCPacketType IF CodecID == 7 UI8 The following values are defined:

0 = AVC sequence header
1 = AVC NALU
2 = AVC end of sequence (lower level NALU sequence ender is
    not required or supported)
const (
	RtmpSequenceHeader RtmpVideoAVCType = iota
	RtmpNALU
	RtmpSequenceHeaderEOF
	RtmpReservedAVCType
)

Jump to

Keyboard shortcuts

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