av

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TAG_AUDIO          = 0x08
	TAG_VIDEO          = 0x09
	TAG_SCRIPTDATAAMF0 = 0x12
	TAG_SCRIPTDATAAMF3 = 0xf
)

Flv Tag Header

View Source
const (
	MetadatAMF0  = 0x12
	MetadataAMF3 = 0xf
)
View Source
const (
	SOUND_MP3                   = 2
	SOUND_NELLYMOSER_16KHZ_MONO = 4
	SOUND_NELLYMOSER_8KHZ_MONO  = 5
	SOUND_NELLYMOSER            = 6
	SOUND_ALAW                  = 7
	SOUND_MULAW                 = 8
	SOUND_AAC                   = 10
	SOUND_SPEEX                 = 11

	SOUND_5_5Khz = 0
	SOUND_11Khz  = 1
	SOUND_22Khz  = 2
	SOUND_44Khz  = 3

	SOUND_8BIT  = 0
	SOUND_16BIT = 1

	SOUND_MONO   = 0
	SOUND_STEREO = 1

	AAC_SEQHDR = 0
	AAC_RAW    = 1
)
View Source
const (
	AVC_SEQHDR = 0
	AVC_NALU   = 1
	AVC_EOS    = 2
)
View Source
const (
	FRAME_KEY   = 1
	FRAME_INTER = 2
	FRAME_DISPO = 3
)

Flv Video Tag Data Frame Type

View Source
const (
	CODEC_JPEG        = 1
	CODEC_SORENSON    = 2
	CODEC_SCREEN      = 3
	CODEC_ON2VP6      = 4
	CODEC_ON2VP6ALPHA = 5
	CODEC_SCREEN2     = 6
	CODEC_AVC         = 7
)

Flv Codec ID

View Source
const DropDefaultNum = 128

Variables

View Source
var (
	PUBLISH = "publish"
	PLAY    = "play"
)
View Source
var ErrClosed = errors.New("channel closed")

Functions

func DropNPacket

func DropNPacket(pktQue chan *Packet, dn int) (n int)

func DropPacket

func DropPacket(pktQue chan *Packet) (n int)

Types

type AudioPacketHeader

type AudioPacketHeader interface {
	PacketHeader
	SoundFormat() uint8
	AACPacketType() uint8
}

type CodecParser

type CodecParser interface {
	SampleRater
	Parse(*Packet, io.Writer) error
}

type Demuxer

type Demuxer interface {
	Demux(*Packet) (ret *Packet, err error)
}

type Muxer

type Muxer interface {
	Mux(*Packet, io.Writer) error
}

type Packet

type Packet struct {
	IsAudio    bool
	IsVideo    bool
	IsMetadata bool
	TimeStamp  uint32 // dts
	StreamID   uint32
	Header     PacketHeader
	Data       []byte
}

Header can be converted to AudioHeaderInfo or VideoHeaderInfo

func (*Packet) Clone

func (p *Packet) Clone() *Packet

func (*Packet) DeepClone added in v0.1.1

func (p *Packet) DeepClone() *Packet

func (*Packet) Type

func (p *Packet) Type() uint8

type PacketHeader

type PacketHeader any

type ReadCloser

type ReadCloser interface {
	io.Closer
	Reader
}

type Reader

type Reader interface {
	Read() (*Packet, error)
}

type SampleRater

type SampleRater interface {
	SampleRate() (int, error)
}

type VideoPacketHeader

type VideoPacketHeader interface {
	PacketHeader
	IsKeyFrame() bool
	IsSeq() bool
	CodecID() uint8
	CompositionTime() int32
}

type WriteCloser

type WriteCloser interface {
	io.Closer
	Writer
}

type Writer

type Writer interface {
	Write(*Packet) error
}

Jump to

Keyboard shortcuts

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