{"record":{"id":"c7522bd271b972d4","repo":"AlexxIT/go2rtc","slug":"dvrip-can-t-probe-medias","errorCode":null,"errorMessage":"dvrip: can't probe medias","messagePattern":"dvrip: can't probe medias","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/dvrip/producer.go","lineNumber":125,"sourceCode":"\tc.client.rd = rd\n\n\t// some awful cameras has VERY rare keyframes\n\t// so we wait video+audio for default probe time\n\t// and wait anything for 15 seconds\n\ttimeoutBoth := time.Now().Add(core.ProbeTimeout)\n\ttimeoutAny := time.Now().Add(time.Second * 15)\n\n\tfor {\n\t\tif now := time.Now(); now.Before(timeoutBoth) {\n\t\t\tif c.video != nil && c.audio != nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t} else if now.Before(timeoutAny) {\n\t\t\tif c.video != nil || c.audio != nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t} else {\n\t\t\treturn errors.New(\"dvrip: can't probe medias\")\n\t\t}\n\n\t\ttag, b, err := c.client.ReadPacket()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tswitch tag {\n\t\tcase 0xFC, 0xFE: // video\n\t\t\tif c.video != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfps := b[5]\n\t\t\t//width := uint16(b[6]) * 8\n\t\t\t//height := uint16(b[7]) * 8\n\t\t\t//println(width, height)\n\t\t\tts := b[8:]","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/dvrip/producer.go#L107-L143","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the camera actually streams (check video/audio enabled in its web UI and that RTSP/DVRIP streams work).","Retry — transient slowness or network congestion can push the device past the probe deadline.","Confirm device model/firmware is supported by this DVRIP implementation (probe relies on specific announce messages).","Check network stability/latency between the client and device; packet loss can starve the probe.","Capture DVRIP traffic to see whether the device sends media announcements at all."],"exampleFix":"// before\nmedia, err := dvrip.Dial(ctx, log, addr, user, pass) // device streams disabled\n// after: enable at least one stream on the camera first\n// camera web UI: Video -> Stream -> Enable main stream\nmedia, err := dvrip.Dial(ctx, log, addr, user, pass)","handlingStrategy":"retry","validationCode":"// confirm at least one stream is enabled before probing\n// (check via device web UI or DVRIP config API: video/audio streams on)","typeGuard":null,"tryCatchPattern":"media, err := dvrip.Dial(ctx, log, addr, user, pass)\nif err != nil && err.Error() == \"dvrip: can't probe medias\" {\n    // one retry after a short wait before giving up\n    time.Sleep(2 * time.Second)\n    media, err = dvrip.Dial(ctx, log, addr, user, pass)\n}","preventionTips":["Ensure video/audio streams are enabled on the camera","Allow generous probe timeouts for slow devices","Keep device firmware driver-compatible","Check network loss/packet loss on the camera segment"],"tags":["network","media","probe","timeout","dvr"],"backgroundTag":"request-timeout","analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}