mirror of
https://github.com/bluenviron/mediamtx.git
synced 2026-01-23 20:09:49 -08:00
support publishing, reading, proxying with SRT (#2068)
This commit is contained in:
parent
d696a782f7
commit
b4e3033ea3
22 changed files with 2184 additions and 213 deletions
|
|
@ -159,6 +159,10 @@ type Conf struct {
|
|||
WebRTCICEUDPMuxAddress string `json:"webrtcICEUDPMuxAddress"`
|
||||
WebRTCICETCPMuxAddress string `json:"webrtcICETCPMuxAddress"`
|
||||
|
||||
// SRT
|
||||
SRT bool `json:"srt"`
|
||||
SRTAddress string `json:"srtAddress"`
|
||||
|
||||
// paths
|
||||
Paths map[string]*PathConf `json:"paths"`
|
||||
}
|
||||
|
|
@ -336,6 +340,10 @@ func (conf *Conf) UnmarshalJSON(b []byte) error {
|
|||
conf.WebRTCAllowOrigin = "*"
|
||||
conf.WebRTCICEServers2 = []WebRTCICEServer{{URL: "stun:stun.l.google.com:19302"}}
|
||||
|
||||
// SRT
|
||||
conf.SRT = true
|
||||
conf.SRTAddress = ":8890"
|
||||
|
||||
type alias Conf
|
||||
d := json.NewDecoder(bytes.NewReader(b))
|
||||
d.DisallowUnknownFields()
|
||||
|
|
|
|||
|
|
@ -210,6 +210,16 @@ func (pconf *PathConf) check(conf *Conf, name string) error {
|
|||
return fmt.Errorf("'%s' is not a valid IP", host)
|
||||
}
|
||||
|
||||
case strings.HasPrefix(pconf.Source, "srt://"):
|
||||
if pconf.Regexp != nil {
|
||||
return fmt.Errorf("a path with a regular expression (or path 'all') cannot have a SRT source. use another path")
|
||||
}
|
||||
|
||||
_, err := gourl.Parse(pconf.Source)
|
||||
if err != nil {
|
||||
return fmt.Errorf("'%s' is not a valid HLS URL", pconf.Source)
|
||||
}
|
||||
|
||||
case pconf.Source == "redirect":
|
||||
if pconf.SourceRedirect == "" {
|
||||
return fmt.Errorf("source redirect must be filled")
|
||||
|
|
@ -337,6 +347,7 @@ func (pconf PathConf) HasStaticSource() bool {
|
|||
strings.HasPrefix(pconf.Source, "http://") ||
|
||||
strings.HasPrefix(pconf.Source, "https://") ||
|
||||
strings.HasPrefix(pconf.Source, "udp://") ||
|
||||
strings.HasPrefix(pconf.Source, "srt://") ||
|
||||
pconf.Source == "rpiCamera"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue