hdl

package module
v3.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: MIT Imports: 15 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

HDL插件

HDL插件主要功能是提供HTTP-FLV协议的访问

插件地址

github.com/Monibuca/plugin-hdl

插件引入

import (
    _ "github.com/Monibuca/plugin-hdl"
)

默认插件配置

[HDL]
ListenAddr = ":2020" #默认为空
ListenAddrTLS = ":2021" #默认为空
CertFile = "file.cert" #默认为空
KeyFile = "file.key" #默认为空
Reconnect = false #默认为false
[HDL.AutoPullList]
"live/hdl" = "http://flv.bdplay.nodemedia.cn/live/bbb.flv"
  • ListenAddr是监听的地址,如果配置为空字符串,则是复用Gateway插件监听的公共端口
  • ListenAddrTLS 公共https监听端口,默认为空,则不监听
  • CertFile https用的证书,默认为空
  • KeyFile https用的证书的key,默认为空
  • Reconnect 拉流断开后是否重连
  • HDL.AutoPullList 自动拉流,可以设置多个,key为流唯一标识,value为拉流地址

插件功能

从m7s拉取http-flv协议流

如果m7s中已经存在live/test流的话就可以用http-flv协议进行播放 如果监听端口不配置则公用Gateway的端口(默认8080)

ffplay -i http://localhost:8080/hdl/live/test.flv

如果配置了端口监听,则可以省略hdl路由,例如

ffplay -i http://localhost:2020/live/test.flv
m7s从远程拉取http-flv协议流

可调用接口 /hdl/pull/pull?target=[HTTP-FLV地址]&streamPath=[流标识]&save=[是否保存配置(留空则不保存)]

或者编程方式拉流 PullStream(streamPath, targetURL)

m7s读取本地flv文件重新发布

同上,只需要把http地址改成本地文件地址即可,如果此时开启Reconnect则会在文件读取完成后重新开始读取

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HDLHandler

func HDLHandler(w http.ResponseWriter, r *http.Request)

func PullStream

func PullStream(streamPath, url string) error

func WriteEcmaArray

func WriteEcmaArray(w amf.Writer, o amf.Object) (n int, err error)

Types

type HDLPuller added in v3.0.3

type HDLPuller struct{}

Jump to

Keyboard shortcuts

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