Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions internal/onvif/onvif.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/url"
"os"
"strconv"
"strings"
"time"

"github.com/AlexxIT/go2rtc/internal/api"
Expand All @@ -33,6 +34,9 @@ func Init() {
var log zerolog.Logger

func streamOnvif(rawURL string) (core.Producer, error) {
// Split the ONVIF URL to extract hash-based arguments
rawURL, rawQuery, _ := strings.Cut(rawURL, "#")

client, err := onvif.NewClient(rawURL)
if err != nil {
return nil, err
Expand All @@ -43,6 +47,11 @@ func streamOnvif(rawURL string) (core.Producer, error) {
return nil, err
}

// Append hash-based arguments to the retrieved URI
if rawQuery != "" {
uri = uri + "#" + rawQuery
}

log.Debug().Msgf("[onvif] new uri=%s", uri)

if err = streams.Validate(uri); err != nil {
Expand Down