AlexxIT/go2rtc · error
no video
Error message
no video
What it means
During probing of a Xiaomi stream, the connection ended (ReadPacket returned an error) before any video codec was negotiated, while an audio codec was present. The library rewrites the read failure as "no video" and wraps it as "xiaomi: probe: no video". It indicates an audio-only stream, or a source that drops before the first H264/H265 packet.
Solutions
- Verify the camera outputs a video track (H264/H265) in its stream settings and re-enable video if disabled.
- Probe the URL with ffprobe to confirm the container actually contains video.
- Handle the error in the caller as an audio-only stream if that is acceptable.
- Check network path stability; if video packets never arrive, the connection is dying early.
Example fix
// before
producer, err := miss.Dial(ctx, url) // fails: xiaomi: probe: no video
// after
producer, err := miss.Dial(ctx, url)
if err != nil && strings.Contains(err.Error(), "no video") {
return nil, fmt.Errorf("stream %s is audio-only; enable video on camera: %w", url, err)
} Defensive patterns
Strategy: try-catch
Validate before calling
out, err := exec.Command("ffprobe", "-v", "error", "-select_streams", "v", "-show_entries", "stream=codec_name", "-of", "csv=p=0", url).Output()
if err != nil || len(strings.TrimSpace(string(out))) == 0 {
// stream has no video track; do not attempt Dial
} Try / catch
producer, err := miss.Dial(ctx, url)
if err != nil {
if strings.Contains(err.Error(), "no video") {
return fmt.Errorf("audio-only stream %s: enable camera video: %w", url, err)
}
return err
} Prevention
- Confirm the camera profile emits H264/H265 video.
- Validate stream URLs with ffprobe before production use.
- Avoid audio-only intercom profiles when video is required.
- Check NAT/firewall timeouts that may kill the connection before keyframes.
When it happens
Trigger: Calling Dial on a stream where audio packets arrive but ReadPacket errors out before any packet with CodecID codecH264/codecH265 is seen (acodec != nil, vcodec == nil).
Common situations: Camera configured as audio-only intercom/mic stream; broken camera firmware sending audio first then dying; firewall or NAT cutting the connection before keyframe delivery.
Related errors
- no audio
- xiaomi: probe
- wrong status:
- nest: failed to generate rtsp url
- nest: tried to stop rtsp stream without a project or device…
AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07).
Data as JSON: /api/errors/0fe10d3398f17a4e.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/xiaomi/miss/producer.go:66
Medias: medias,
Transport: client,
},
client: client,
}, nil
}
func probe(client *Client, audio bool) ([]*core.Media, error) {
_ = client.SetDeadline(time.Now().Add(15 * time.Second))
var vcodec, acodec *core.Codec
for {
pkt, err := client.ReadPacket()
if err != nil {
if vcodec != nil {
err = fmt.Errorf("no audio")
} else if acodec != nil {
err = fmt.Errorf("no video")
}
return nil, fmt.Errorf("xiaomi: probe: %w", err)
}
switch pkt.CodecID {
case codecH264:
if vcodec == nil {
buf := annexb.EncodeToAVCC(pkt.Payload)
if h264.NALUType(buf) == h264.NALUTypeSPS {
vcodec = h264.AVCCToCodec(buf)
}
}
case codecH265:
if vcodec == nil {
buf := annexb.EncodeToAVCC(pkt.Payload)
if h265.NALUType(buf) == h265.NALUTypeVPS {
vcodec = h265.AVCCToCodec(buf)
}View on GitHub (pinned to c245815e75)