AlexxIT/go2rtc · error

dvrip: can't probe medias

Error message

dvrip: can't probe medias

What it means

dvrip.probe (pkg/dvrip/producer.go:125) waits for the device to announce video and/or audio streams while draining ReadPacket. If the overall probe timeout expires before any media was detected (now >= timeout and neither c.video nor c.audio set), it returns "dvrip: can't probe medias". The device connected and answered, but never announced any stream within the time budget.

Solutions

  1. Verify the camera actually streams (check video/audio enabled in its web UI and that RTSP/DVRIP streams work).
  2. Retry — transient slowness or network congestion can push the device past the probe deadline.
  3. Confirm device model/firmware is supported by this DVRIP implementation (probe relies on specific announce messages).
  4. Check network stability/latency between the client and device; packet loss can starve the probe.
  5. Capture DVRIP traffic to see whether the device sends media announcements at all.

Example fix

// before
media, err := dvrip.Dial(ctx, log, addr, user, pass) // device streams disabled
// after: enable at least one stream on the camera first
// camera web UI: Video -> Stream -> Enable main stream
media, err := dvrip.Dial(ctx, log, addr, user, pass)
Defensive patterns

Strategy: retry

Validate before calling

// confirm at least one stream is enabled before probing
// (check via device web UI or DVRIP config API: video/audio streams on)

Try / catch

media, err := dvrip.Dial(ctx, log, addr, user, pass)
if err != nil && err.Error() == "dvrip: can't probe medias" {
    // one retry after a short wait before giving up
    time.Sleep(2 * time.Second)
    media, err = dvrip.Dial(ctx, log, addr, user, pass)
}

Prevention

When it happens

Trigger: Dial or Open on a DVRIP device where the probe loop times out without receiving video or audio media descriptors — device sends no stream announcements, wrong stream configuration, or slow device response past the probe deadline.

Common situations: Camera configured with all streams disabled or substream-only setups the driver doesn't recognize; very slow/overloaded NVR or camera missing the probe deadline; device model whose DVRIP announce format differs (protocol mismatch); network loss right after auth so no packets arrive.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


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

Appendix: source

Thrown at pkg/dvrip/producer.go:125

	c.client.rd = rd

	// some awful cameras has VERY rare keyframes
	// so we wait video+audio for default probe time
	// and wait anything for 15 seconds
	timeoutBoth := time.Now().Add(core.ProbeTimeout)
	timeoutAny := time.Now().Add(time.Second * 15)

	for {
		if now := time.Now(); now.Before(timeoutBoth) {
			if c.video != nil && c.audio != nil {
				return nil
			}
		} else if now.Before(timeoutAny) {
			if c.video != nil || c.audio != nil {
				return nil
			}
		} else {
			return errors.New("dvrip: can't probe medias")
		}

		tag, b, err := c.client.ReadPacket()
		if err != nil {
			return err
		}

		switch tag {
		case 0xFC, 0xFE: // video
			if c.video != nil {
				continue
			}

			fps := b[5]
			//width := uint16(b[6]) * 8
			//height := uint16(b[7]) * 8
			//println(width, height)
			ts := b[8:]

View on GitHub (pinned to c245815e75)