jaryhe 67001cd674 new | 6 months ago | |
---|---|---|
.. | ||
.gitignore | 6 months ago | |
LICENSE | 6 months ago | |
README.md | 6 months ago | |
config.go | 6 months ago | |
default.yaml | 6 months ago | |
flv.go | 6 months ago | |
go.mod | 6 months ago | |
go.sum | 6 months ago | |
hls.go | 6 months ago | |
main.go | 6 months ago | |
mp4.go | 6 months ago | |
raw.go | 6 months ago | |
restful.go | 6 months ago | |
subscriber.go | 6 months ago | |
vod.go | 6 months ago |
对流进行录制的功能插件,提供Flv、fmp4、hls、裸流格式的录制功能。
https://github.com/Monibuca/plugin-record
import (
_ "m7s.live/plugin/record/v4"
)
fragment表示分片大小(秒),0代表不分片
record:
subscribe:
subaudio: true # 是否订阅音频流
subvideo: true # 是否订阅视频流
subaudioargname: ats # 订阅音频轨道参数名
subvideoargname: vts # 订阅视频轨道参数名
subdataargname: dts # 订阅数据轨道参数名
subaudiotracks: [] # 订阅音频轨道名称列表
subvideotracks: [] # 订阅视频轨道名称列表
submode: 0 # 订阅模式,0为跳帧追赶模式,1为不追赶(多用于录制),2为时光回溯模式
iframeonly: false # 只订阅关键帧
waittimeout: 10s # 等待发布者的超时时间,用于订阅尚未发布的流
flv:
ext: .flv
path: record/flv
autorecord: false
filter: ""
fragment: 0
mp4:
ext: .mp4
path: record/mp4
autorecord: false
filter: ""
fragment: 0
hls:
ext: .m3u8
path: record/hls
autorecord: false
filter: ""
fragment: 0
raw:
ext: .
path: record/raw
autorecord: false
filter: ""
fragment: 0
/record/api/list/recording
罗列所有正在录制中的流的信息/record/api/list?type=flv
罗列所有录制的flv文件/record/api/start?type=flv&streamPath=live/rtc
开始录制某个流,返回一个字符串用于停止录制用的id/record/api/stop?id=xxx
停止录制某个流其中将type值改为mp4则录制成fmp4格式。
访问格式:
例如:
http://localhost:8080/record/live/test.flv
将会读取对应的flv文件http://localhost:8080/record/live/test.mp4
将会读取对应的fmp4文件