libhls

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HLS

type HLS struct {
	Version int //3
	// M3u8    *M3U8
	Pat         *libmpeg.PAT
	TsClipStart bool
	Cc          map[uint16]uint8 //key:pid
	Ah          *libaac.AACHeader
	AvcParser   *libavc.Parser
	// contains filtered or unexported fields
}

func NewHls

func NewHls() *HLS

func (*HLS) Start

func (hls *HLS) Start(gopReader *broadcast.BroadcastReader) (err error)

start to generate ts file and store to disk.

type HLS_MODE

type HLS_MODE uint8
const (
	NONE        HLS_MODE = iota
	IMMEDIATELY          //default
	DELAY
)

rtmp->hls 转码有两种方式,懒汉式和饿汉式 饿汉式:流推上来后立即开始转为 hls,不管有没有人拉 hls 流。推流断掉后才停止转码 懒汉式:第一个人拉 hls 时才开始转码,没人拉时就停掉,即使推流还没停

如果需要做录制,需要使用饿汉式,以保证录制到全量流 如果只是为了 hls 实时拉流,就可以使用懒汉式,没人拉 hls 时不用转码,节省性能

type M3U8

type M3U8 struct {
	Sequence int
	Count    int
}

Jump to

Keyboard shortcuts

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