flv

package
v0.7.18 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SoundFormat
	LPCM_PE  SoundFormat = 0 // 线性PCM,平台字节序
	ADPCM    SoundFormat = 1
	MP3      SoundFormat = 2
	LPCM_LE  SoundFormat = 3 // 线性PCM,小端字节序
	AAC      SoundFormat = 10
	Speex    SoundFormat = 11
	MP3_8kHz SoundFormat = 14 // MP3 8千赫兹

	// SoundRate
	Rate5kHz  SoundRate = 0 // 5.5千赫兹
	Rate11kHz SoundRate = 1 // 11千赫兹
	Rate22kHz SoundRate = 2 // 22千赫兹
	Rate44kHz SoundRate = 3 // 44千赫兹

	// SoundSize
	Sample8  uint8 = 0 // 8位样本
	Sample16 uint8 = 1 // 16位样本

	// SoundType
	Mono   SoundType = 0 // 单声道音频
	Stereo SoundType = 1 // 立体声音频

	// AACPacketType
	AACSeqHeader AACPacketType = 0
	AACRaw       AACPacketType = 1
)
View Source
const (
	// 帧类型
	KeyFrame             FrameType = 1 // AVC中的关键帧,可寻址帧
	InterFrame           FrameType = 2 // AVC中的非关键帧,不可寻址帧
	DisposableInterFrame FrameType = 3 // 仅用于H.263
	GeneratedKeyFrame    FrameType = 4 // 仅服务器使用
	VideoInfoFrame       FrameType = 5 // 视频信息/命令帧

	// 编码标识
	H263Code          CodeID = 2 // Sorenson H.263
	ScreenVideoCode   CodeID = 3 // 屏幕视频
	VP6Code           CodeID = 4 // On2 VP6
	VP6AlphaCode      CodeID = 5 // 带Alpha通道的On2 VP6
	ScreenVideoV2Code CodeID = 6 // 屏幕视频版本2
	AVCCode           CodeID = 7 // AVC

	// AVC包类型
	AVCSeqHeader AVCPacketType = 0 // AVC序列头
	AVCNALU      AVCPacketType = 1 // NAL单元
	AVCEndSeq    AVCPacketType = 2 // AVC序列结束(不需要或不支持较低级别的NALU序列结束)
)
View Source
const (
	Name = "native"
)

Variables

View Source
var (
	ErrNotFlvStream = errors.New("非FLV流")
	ErrUnknownTag   = errors.New("未知标签")
)

Functions

This section is empty.

Types

type AACPacketType

type AACPacketType uint8

type AVCPacketType

type AVCPacketType uint8

type AudioTagHeader

type AudioTagHeader struct {
	SoundFormat   SoundFormat
	SoundRate     SoundRate
	SoundSize     SoundSize
	SoundType     SoundType
	AACPacketType AACPacketType
}

type CodeID

type CodeID uint8

type DataType

type DataType uint8
const (
	Number          DataType = 0
	Boolean         DataType = 1
	String          DataType = 2
	Object          DataType = 3
	Null            DataType = 5
	Undefined       DataType = 6
	Reference       DataType = 7
	ECMAArray       DataType = 8
	ObjectEndMarker DataType = 9
	StrictArray     DataType = 10
	Date            DataType = 11
	LongString      DataType = 12
)

type FrameType

type FrameType uint8

type Metadata

type Metadata struct {
	HasVideo, HasAudio bool
}

type Parser

type Parser struct {
	Metadata Metadata
	// contains filtered or unexported fields
}

func (*Parser) ParseLiveStream

func (p *Parser) ParseLiveStream(ctx context.Context, url *url.URL, live live.Live, file string) error

ParseLiveStream 解析直播流

func (*Parser) PushLiveStream

func (p *Parser) PushLiveStream(ctx context.Context, cacheFile string, rtmpUrl string) (err error)

func (*Parser) Stop

func (p *Parser) Stop() error

Stop 停止解析

type SoundFormat

type SoundFormat uint8

type SoundRate

type SoundRate uint8

type SoundSize

type SoundSize uint8

type SoundType

type SoundType uint8

type VideoTagHeader

type VideoTagHeader struct {
	FrameType       FrameType
	CodeID          CodeID
	AVCPacketType   AVCPacketType
	CompositionTime uint32
}

Jump to

Keyboard shortcuts

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