webrtc 拉流

This commit is contained in:
yangjiechina
2024-03-28 18:14:54 +08:00
parent 7694237dc7
commit 1ec5c201b5
9 changed files with 351 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"github.com/yangjiechina/live-server/flv"
"github.com/yangjiechina/live-server/hls"
"github.com/yangjiechina/live-server/rtc"
"github.com/yangjiechina/live-server/rtsp"
"net"
"net/http"
@@ -35,11 +36,12 @@ func CreateTransStream(source stream.ISource, protocol stream.Protocol, streams
return flv.NewHttpTransStream()
} else if stream.ProtocolRtsp == protocol {
trackFormat := source.Id() + "?track=%d"
return rtsp.NewTransStream(net.IPAddr{
IP: rtspAddr.IP,
Zone: rtspAddr.Zone,
}, trackFormat)
} else if stream.ProtocolRtc == protocol {
return rtc.NewTransStream()
}
return nil