github.com/Monibuca/plugin-rtsp
import (
_ "github.com/Monibuca/plugin-rtsp"
)[RTSP]
# 端口接收推流
ListenAddr = ":554"
Reconnect = true
[RTSP.AutoPullList]
"live/rtsp1" = "rtsp://admin:admin@192.168.1.212:554/cam/realmonitor?channel=1&subtype=1"
"live/rtsp2" = "rtsp://admin:admin@192.168.1.212:554/cam/realmonitor?channel=2&subtype=1"ListenAddr是监听的地址Reconnect是否自动重连RTSP.AutoPullList可以配置多项,用于自动拉流,key是streamPath,value是远程rtsp地址
当自动拉流列表中当的streamPath为sub/xxx 这种形式的话,在gb28181的分屏显示时会优先采用rtsp流,已实现分屏观看子码流效果
例如通过ffmpeg向m7s进行推流
ffmpeg -i **** rtsp://localhost/live/test会在m7s内部形成一个名为live/test的流
可调用接口
/api/rtsp/pull?target=[RTSP地址]&streamPath=[流标识]
new(RTSPClient).PullStream("live/user1","rtsp://xxx.xxx.xxx.xxx/live/user1") 可调用接口
/api/rtsp/list
直接通过协议rtsp://xxx.xxx.xxx.xxx/live/user1 即可播放
h265 编码拉流尚未实现,敬请期待