#2386·go2rtc

Nest source: duplicate H264 receiver track on every WebRTC negotiation, RTSP output wired to the empty one

Author: MathblCreated Jul 30, 2026Updated Oct 1, 2026
Labelsenhancementbrand/nest

Environment

  • go2rtc version 1.9.10 (df95ce3) linux/amd64
  • Bundled inside ghcr.io/blakeblackshear/frigate:stable, Debian 12 base
  • Host: Unraid, container network mode host
  • Camera: Nest Doorbell Gen 2 (wired), connected via the built-in nest: source (Google SDM API / Device Access), no Home Assistant involved
  • Consumer: Frigate's ffmpeg pulls from go2rtc over local RTSP (preset-rtsp-restream, -rtsp_transport tcp)

Symptom

Every single WebRTC negotiation between go2rtc and the Nest SDM API for this doorbell results in two separate H264 receiver tracks inside the same producer:

  • One receiver has childs (i.e. it is wired to the RTSP consumer's sender) but never receives any bytes (the bytes/packets fields are absent, i.e. zero, for the entire life of the producer).
  • A second, separate H264 receiver is not wired to any consumer but receives all the real incoming video data (bytes/packets grow continuously).

Because the RTSP output is bound to the empty receiver, Frigate's ffmpeg never gets usable video and fails with: [rtsp @ ...] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options [out#0/segment @ ...] Output file does not contain any stream This triggers Frigate's watchdog to kill and restart ffmpeg every ~20s, which in turn causes go2rtc to tear down and re-negotiate a brand new WebRTC session with Nest every ~20s — a continuous reconnect loop that has apparently been running for weeks.

Reproduction rate

Observed 6 consecutive fresh negotiations (passively, driven by Frigate's ffmpeg reconnect loop, no manual intervention) over ~90 seconds: 6/6 showed the same wrong wiring. Also reproduced immediately after a manual restart of the go2rtc service (2/2). This looks fully deterministic for this device, not a rare race.

Example /api/streams output (credentials redacted)

json
{
  "doorbell_nest": {
    "producers": [{
      "id": 194, 
      "format_name": "nest/webrtc",
      "protocol": "http+udp",
      "remote_addr": "74.125.247.225:19305 host",
      "url": "nest:?client_id=REDACTED&client_secret=REDACTED&refresh_token=REDACTED&project_id=REDACTED&device_id=REDACTED",
      "medias": ["video, recvonly, H264", "audio, recvonly, OPUS/48000/2"],
      "receivers": [
        {"id": 195, "codec": {"codec_name": "h264", "codec_type": "video"}, "childs": [196]},
        {"id": 197, "codec": {"channels": 2, "codec_name": "opus", "codec_type": "audio", "sample_rate": 48000}, "bytes": 1694,
"packets": 7},
        {"id": 198, "codec": {"codec_name": "h264", "codec_type": "video"}, "bytes": 9152, "packets": 9}
      ],
      "bytes_recv": 11230
    }],
    "consumers": [{
      "id": 193, 
      "format_name": "rtsp",
      "protocol": "rtsp+tcp",
      "senders": [{"id": 196, "codec": {"codec_name": "h264", "codec_type": "video"}, "parààà``ent": 195}]
    }]
  }
}

Note receiver 195 (parent of the RTSP sender 196) never appears with a bytes field across the entire session, while sibling receiver 198 (same producer, same codec, not wired to anything) accumulates bytes/packets continuously. This pattern repeats identically on every negotiation, only the IDs change.

Suspected root cause

Reading pkg/webrtc/conn.go, track binding in OnTrack matches purely on media.ID == transceiver.Mid() plus codec.PayloadType == remote.PayloadType(). My guess is Nest's SDP answer includes a retransmission (RTX) SSRC/payload type alongside the primary H264 payload for the same m=video line (standard WebRTC reliability mechanism, a=fmtp: apt=), and this matching logic doesn't correlate the RTX SSRC back to the primary track — so Pion fires two independent OnTrack events, and go2rtc creates two independent receivers instead of one. Whichever one is created/bound first ends up wired to the consumer, and empirically that's always the wrong one for this device (I have not confirmed which of the two is the RTX stream vs. primary from the logs alone — happy to capture raw SDP if that helps debug).