Add DVRIP protocol support

- Register dvrip stream handler using go2rtc pkg/dvrip
- Add default port 34567 for dvrip scheme in URL builder
This commit is contained in:
eduard256
2026-04-03 21:01:39 +00:00
parent 51b11e233f
commit 44ab0651cb
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -12,6 +12,7 @@ import (
var defaultPorts = map[string]int{
"rtsp": 554, "rtsps": 322, "http": 80, "https": 443,
"rtmp": 1935, "mms": 554, "rtp": 5004, "bubble": 80,
"dvrip": 34567,
}
// protocols where port must always be explicit in URL (raw TCP dial without default port logic)
+8
View File
@@ -6,6 +6,7 @@ import (
"github.com/AlexxIT/go2rtc/pkg/bubble"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/dvrip"
"github.com/AlexxIT/go2rtc/pkg/rtmp"
"github.com/AlexxIT/go2rtc/pkg/rtsp"
)
@@ -34,6 +35,13 @@ func init() {
RegisterSource("rtmp", rtmpHandler)
RegisterSource("rtmps", rtmpHandler)
RegisterSource("rtmpx", rtmpHandler)
RegisterSource("dvrip", dvripHandler)
}
// dvripHandler -- Dial handles TCP connect, Sofia MD5 auth, and OPMonitor stream negotiation.
// ex. "dvrip://admin:pass@192.168.1.100:34567?channel=0&subtype=0"
func dvripHandler(rawURL string) (core.Producer, error) {
return dvrip.Dial(rawURL)
}
// bubbleHandler -- Dial handles TCP connect, HTTP handshake, XML parsing, and auth.