diff --git a/pkg/camdb/streams.go b/pkg/camdb/streams.go index 2404e8b..fb9df18 100644 --- a/pkg/camdb/streams.go +++ b/pkg/camdb/streams.go @@ -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) diff --git a/pkg/tester/source.go b/pkg/tester/source.go index dc4e226..c02bb0f 100644 --- a/pkg/tester/source.go +++ b/pkg/tester/source.go @@ -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.