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
6 changes: 5 additions & 1 deletion internal/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/AlexxIT/go2rtc/pkg/pcm"
pkg "github.com/AlexxIT/go2rtc/pkg/rtsp"
"github.com/AlexxIT/go2rtc/pkg/shell"
"github.com/google/uuid"
"github.com/rs/zerolog"
)

Expand Down Expand Up @@ -76,7 +77,10 @@ func execHandle(rawURL string) (prod core.Producer, err error) {
return nil, errors.New("exec: rtsp module disabled")
}

sum := md5.Sum([]byte(rawURL))
// Insert a UUID into the sum to make it unique for this exec instance.
// This allows for multiple exec instances referring to the same RTSP
// stream to work without interfering with each other.
sum := md5.Sum([]byte(rawURL + uuid.NewString()))
path = "/" + hex.EncodeToString(sum[:])
rawURL = rawURL[:i] + "rtsp://127.0.0.1:" + rtsp.Port + path + rawURL[i+8:]
}
Expand Down