Documentation ¶
Index ¶
- Constants
- Variables
- type AudioTrackReader
- type HLSConfig
- func (config *HLSConfig) API_List(w http.ResponseWriter, r *http.Request)
- func (config *HLSConfig) API_Pull(w http.ResponseWriter, r *http.Request)
- func (config *HLSConfig) API_Save(w http.ResponseWriter, r *http.Request)
- func (c *HLSConfig) OnEvent(event any)
- func (config *HLSConfig) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type HLSPuller
- type HLSWriter
- type LLAudioTrack
- type LLHLSConfig
- type LLMuxer
- type LLVideoTrack
- type M3u8Info
- type Playlist
- type PlaylistInf
- type PlaylistKey
- type TSDownloader
- type TrackReader
- type VideoTrackReader
Constants ¶
View Source
const (
HLS_KEY_METHOD_AES_128 = "AES-128"
)
Variables ¶
View Source
var HLSPlugin = InstallPlugin(hlsConfig, defaultYaml)
View Source
var LLHLSPlugin = InstallPlugin(llhlsConfig)
Functions ¶
This section is empty.
Types ¶
type AudioTrackReader ¶ added in v4.1.3
type AudioTrackReader struct { TrackReader *track.Audio }
type HLSConfig ¶
type HLSConfig struct { config.HTTP config.Publish config.Pull config.Subscribe Fragment time.Duration `default:"2s" desc:"ts分片大小"` Window int `default:"3" desc:"m3u8窗口大小(包含ts的数量)"` Filter config.Regexp `desc:"用于过滤的正则表达式"` // 过滤,正则表达式 Path string `desc:"保存 ts 文件的路径"` DefaultTS string `desc:"默认的ts文件"` // 默认的ts文件 DefaultTSDuration time.Duration `desc:"默认的ts文件时长"` // 默认的ts文件时长 RelayMode int `desc:"转发模式(转协议会消耗资源)" enum:"0:只转协议,1:纯转发,2:转协议+转发"` // 转发模式,0:转协议+不转发,1:不转协议+转发,2:转协议+转发 Preload bool `desc:"是否预加载,提高响应速度"` // 是否预加载,提高响应速度 }
func (*HLSConfig) API_List ¶
func (config *HLSConfig) API_List(w http.ResponseWriter, r *http.Request)
func (*HLSConfig) API_Pull ¶
func (config *HLSConfig) API_Pull(w http.ResponseWriter, r *http.Request)
type HLSPuller ¶
type HLSPuller struct { TSPublisher Puller Video M3u8Info Audio M3u8Info TsHead http.Header `json:"-" yaml:"-"` //用于提供cookie等特殊身份的http头 SaveContext context.Context `json:"-" yaml:"-"` //用来保存ts文件到服务器 // contains filtered or unexported fields }
HLSPuller HLS拉流者
func (*HLSPuller) Disconnect ¶ added in v4.3.3
func (p *HLSPuller) Disconnect()
type LLAudioTrack ¶ added in v4.2.9
type LLAudioTrack struct { *track.AVRingReader *track.Audio }
type LLHLSConfig ¶ added in v4.2.9
type LLHLSConfig struct { DefaultYaml config.HTTP config.Publish // config.Pull config.Subscribe Filter string // 过滤,正则表达式 Path string }
func (*LLHLSConfig) OnEvent ¶ added in v4.2.9
func (c *LLHLSConfig) OnEvent(event any)
func (*LLHLSConfig) ServeHTTP ¶ added in v4.2.9
func (c *LLHLSConfig) ServeHTTP(w http.ResponseWriter, r *http.Request)
type LLVideoTrack ¶ added in v4.2.9
type LLVideoTrack struct { *track.AVRingReader *track.Video }
type M3u8Info ¶
type M3u8Info struct { Req *http.Request `json:"-" yaml:"-"` M3U8Count int //一共拉取的m3u8文件数量 TSCount int //一共拉取的ts文件数量 LastM3u8 string //最后一个m3u8文件内容 }
M3u8Info m3u8文件的信息,用于拉取m3u8文件,和提供查询
type Playlist ¶
type Playlist struct { io.Writer ExtM3U string // indicates that the file is an Extended M3U [M3U] Playlist file. (4.3.3.1) -- 每个M3U文件第一行必须是这个tag. Version int // indicates the compatibility version of the Playlist file. (4.3.1.2) -- 协议版本号. Sequence int // indicates the Media Sequence Number of the first Media Segment that appears in a Playlist file. (4.3.3.2) -- 第一个媒体段的序列号. Targetduration int // specifies the maximum Media Segment duration. (4.3.3.1) -- 每个视频分段最大的时长(单位秒). PlaylistType int // rovides mutability information about the Media Playlist file. (4.3.3.5) -- 提供关于PlayList的可变性的信息. Discontinuity int // indicates a discontinuity between theMedia Segment that follows it and the one that preceded it. (4.3.2.3) -- 该标签后边的媒体文件和之前的媒体文件之间的编码不连贯(即发生改变)(场景用于插播广告等等). Key PlaylistKey // specifies how to decrypt them. (4.3.2.4) -- 解密媒体文件的必要信息(表示怎么对media segments进行解码). EndList string // indicates that no more Media Segments will be added to the Media Playlist file. (4.3.3.4) -- 标示没有更多媒体文件将会加入到播放列表中,它可能会出现在播放列表文件的任何地方,但是不能出现两次或以上. Inf PlaylistInf // specifies the duration of a Media Segment. (4.3.2.1) -- 指定每个媒体段(ts)的持续时间. // contains filtered or unexported fields }
以”#EXT“开头的表示一个”tag“,否则表示注释,直接忽略
func (*Playlist) WriteInf ¶
func (pl *Playlist) WriteInf(inf PlaylistInf) (err error)
type PlaylistInf ¶
type PlaylistKey ¶
type TSDownloader ¶ added in v4.3.7
type TSDownloader struct {
// contains filtered or unexported fields
}
func (*TSDownloader) Start ¶ added in v4.3.7
func (p *TSDownloader) Start()
type TrackReader ¶ added in v4.1.3
type VideoTrackReader ¶ added in v4.1.3
type VideoTrackReader struct { TrackReader *track.Video }
Click to show internal directories.
Click to hide internal directories.