AlexxIT/go2rtc · error

exec/rtsp

Error message

exec/rtsp
%s

What it means

handleRTSP failure branch: the spawned helper exited (cmd.Done fired) before producing any recognizable RTSP output within the timeout, and its captured stderr becomes the error body. The external tool crashed at startup — its stderr explains why (missing dependency, bad URL, auth failure).

Solutions

  1. Inspect cmd.Stderr in the message for the helper's crash reason
  2. Verify the helper's arguments (source URL, credentials) are valid
  3. Re-run after fixing the environment; transient network failures also cause early exit
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at internal/exec/exec.go:206 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/854d98bedbc543b8. Report an issue: GitHub.

Appendix: source

Thrown at internal/exec/exec.go:206

	ts := time.Now()

	if err := cmd.Start(); err != nil {
		log.Error().Err(err).Str("source", source).Msg("[exec]")
		return nil, err
	}

	timer := time.NewTimer(timeout)
	defer timer.Stop()

	select {
	case <-timer.C:
		// haven't received data from app in timeout
		log.Error().Str("source", source).Msg("[exec] timeout")
		return nil, errors.New("exec: timeout")
	case <-cmd.Done():
		// app fail before we receive any data
		return nil, fmt.Errorf("exec/rtsp\n%s", cmd.Stderr)
	case prod := <-waiter:
		// app started successfully
		log.Debug().Stringer("launch", time.Since(ts)).Msg("[exec] run rtsp")
		setRemoteInfo(prod, source, cmd.Args)
		prod.OnClose = cmd.Close
		return prod, nil
	}
}

// internal

var (
	log       zerolog.Logger
	waiters   = make(map[string]chan *pkg.Conn)
	waitersMu sync.Mutex
)

type logWriter struct {

View on GitHub (pinned to c245815e75)