AlexxIT/go2rtc · error

streams: unsupported scheme:

Error message

streams: unsupported scheme: 

What it means

GetProducer returns this when the URL's scheme (the part before the first ':') has no registered handler and no registered redirect in the handlers maps. The full unsupported URL is appended. It means the source protocol is unknown to the process at runtime, e.g. an unsupported or unimported producer scheme.

Solutions

  1. Check the URL scheme for typos (e.g. 'rstp' instead of 'rtsp')
  2. Verify the module providing a producer for that scheme was compiled in and registered its HandleFunc
  3. Add a handler for the scheme or redirect it to a supported one via RedirectFunc
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/streams/handlers.go:69 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07). Data as JSON: /api/errors/166fe00833463df8. Report an issue: GitHub.

Appendix: source

Thrown at internal/streams/handlers.go:69

	if i := strings.IndexByte(url, ':'); i > 0 {
		scheme := url[:i]

		if redirect, ok := redirects[scheme]; ok {
			location, err := redirect(url)
			if err != nil {
				return nil, err
			}
			if location != "" {
				return GetProducer(location)
			}
		}

		if handler, ok := handlers[scheme]; ok {
			return handler(url)
		}
	}

	return nil, errors.New("streams: unsupported scheme: " + url)
}

// Redirect can return: location URL or error or empty URL and error
type Redirect func(url string) (string, error)

var redirects = map[string]Redirect{}

func RedirectFunc(scheme string, redirect Redirect) {
	redirects[scheme] = redirect
}

func Location(url string) (string, error) {
	if i := strings.IndexByte(url, ':'); i > 0 {
		scheme := url[:i]

		if redirect, ok := redirects[scheme]; ok {
			return redirect(url)
		}

View on GitHub (pinned to c245815e75)