flvio

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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 FillAMF0Val

func FillAMF0Val(b []byte, _val interface{}) (n int)

FillAMF0Val func

func FillFileHeader

func FillFileHeader(b []byte, flags uint8) (n int)

FillFileHeader func

func FillTagHeader

func FillTagHeader(b []byte, tagtype uint8, datalen int, ts int32) (n int)

FillTagHeader func

func FillTagTrailer

func FillTagTrailer(b []byte, datalen int) (n int)

FillTagTrailer func

func LenAMF0Val

func LenAMF0Val(_val interface{}) (n int)

LenAMF0Val func

func ParseAMF0Val

func ParseAMF0Val(b []byte) (val interface{}, n int, err error)

ParseAMF0Val func

func ParseFileHeader

func ParseFileHeader(b []byte) (flags uint8, skip int, err error)

ParseFileHeader func

func TimeToTs

func TimeToTs(tm time.Duration) int32

TimeToTs func

func TsToTime

func TsToTime(ts int32) time.Duration

TsToTime func

func WriteTag

func WriteTag(w io.Writer, tag Tag, ts int32, b []byte) (err error)

WriteTag func

Types

type AMF0ParseError

type AMF0ParseError struct {
	Offset  int
	Message string
	Next    *AMF0ParseError
}

AMF0ParseError struct

func (*AMF0ParseError) Error

func (inst *AMF0ParseError) Error() string

Error func

type AMFArray

type AMFArray []interface{}

AMFArray type

type AMFECMAArray

type AMFECMAArray map[string]interface{}

AMFECMAArray type

type AMFMap

type AMFMap map[string]interface{}

AMFMap type

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

func ParseTagHeader(b []byte) (tag Tag, ts int32, datalen int, err error)

ParseTagHeader func

func ReadTag

func ReadTag(r io.Reader, b []byte) (tag Tag, ts int32, err error)

ReadTag func

func (Tag) ChannelLayout

func (inst Tag) ChannelLayout() av.ChannelLayout

ChannelLayout func

func (Tag) FillHeader

func (inst Tag) FillHeader(b []byte) (n int)

FillHeader func

func (*Tag) ParseHeader

func (inst *Tag) ParseHeader(b []byte) (n int, err error)

ParseHeader func

Jump to

Keyboard shortcuts

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