flv

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FlvHeader          = []byte{0x46, 0x4c, 0x56, 0x01, 0x05, 0x00, 0x00, 0x00, 0x09}
	FlvFirstPreTagSize = []byte{0x00, 0x00, 0x00, 0x00}
	FlvFirstHeader     = append(FlvHeader, FlvFirstPreTagSize...)
)
View Source
var (
	ErrAvcEndSEQ = fmt.Errorf("avc end sequence")
)
View Source
var ErrHeader = errors.New("read flv header error")
View Source
var ErrInvalidAudioData = fmt.Errorf("invalid audio data")
View Source
var ErrInvalidVideoData = fmt.Errorf("invalid video data")
View Source
var ErrPreDataLen = errors.New("read flv pre data len error")

Functions

This section is empty.

Types

type Demuxer

type Demuxer struct {
}

func NewDemuxer

func NewDemuxer() *Demuxer

func (*Demuxer) Demux

func (d *Demuxer) Demux(p *av.Packet) error

func (*Demuxer) DemuxH

func (d *Demuxer) DemuxH(p *av.Packet) error

type FlvTagBody

type FlvTagBody struct {
	// contains filtered or unexported fields
}

func (*FlvTagBody) AACPacketType

func (tag *FlvTagBody) AACPacketType() uint8

func (*FlvTagBody) CodecID

func (tag *FlvTagBody) CodecID() uint8

func (*FlvTagBody) CompositionTime

func (tag *FlvTagBody) CompositionTime() int32

func (*FlvTagBody) IsKeyFrame

func (tag *FlvTagBody) IsKeyFrame() bool

func (*FlvTagBody) IsSeq

func (tag *FlvTagBody) IsSeq() bool

func (*FlvTagBody) ParseMediaTagHeader

func (tag *FlvTagBody) ParseMediaTagHeader(b []byte, isVideo bool) (n int, err error)

ParseMediaTagHeader, parse video, audio, tag header

func (*FlvTagBody) SoundFormat

func (tag *FlvTagBody) SoundFormat() uint8

type FlvTagHeader

type FlvTagHeader struct {
	TagType           uint8
	DataSize          uint32
	Timestamp         uint32
	TimestampExtended uint8
	StreamID          uint32
	PreTagSzie        uint32
}

type Reader

type Reader struct {
	FlvTagHeader FlvTagHeader
	// contains filtered or unexported fields
}

func NewReader

func NewReader(r io.Reader, conf ...ReaderConf) *Reader

func (*Reader) Read

func (fr *Reader) Read() (p *av.Packet, err error)

type ReaderConf

type ReaderConf func(*Reader)

func WithReaderBuffer

func WithReaderBuffer(size int) ReaderConf

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(w io.Writer, conf ...WriterConf) *Writer

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) Closed

func (w *Writer) Closed() bool

func (*Writer) Write

func (w *Writer) Write(p *av.Packet) error

type WriterConf

type WriterConf func(*Writer)

func WithWriterBuffer

func WithWriterBuffer(size int) WriterConf

Jump to

Keyboard shortcuts

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