AlexxIT/go2rtc · error

wrong transport

Error message

wrong transport: %s

What it means

In TCP interleaved mode the camera's SETUP response Transport header either lacks a usable interleaved= field or is malformed (including the Escam Q6 bug variant), so the RTP channel cannot be determined. The offending transport string is included.

Solutions

  1. Extend the Transport header parser to accept the returned variant
  2. Fall back to UDP transport if the server's TCP interleaved response is unparseable
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at pkg/rtsp/client.go:379 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/a143da3cf87db8eb. Report an issue: GitHub.

Appendix: source

Thrown at pkg/rtsp/client.go:379

					_, _ = c.WriteToUDP([]byte{0x80, 0x00, 0x00, 0x00}, channel)
					_, _ = c.WriteToUDP([]byte{0x80, 0xC8, 0x00, 0x01}, channel+1)
				}()
			}
		}

		return channel, nil
	} else {
		// we send our `interleaved`, but camera can answer with another

		// Transport: RTP/AVP/TCP;unicast;interleaved=10-11;ssrc=10117CB7
		// Transport: RTP/AVP/TCP;unicast;destination=192.168.1.111;source=192.168.1.222;interleaved=0
		// Transport: RTP/AVP/TCP;ssrc=22345682;interleaved=0-1
		// Escam Q6 has a bug:
		// Transport: RTP/AVP;unicast;destination=192.168.1.111;source=192.168.1.222;interleaved=0-1
		s := core.Between(transport, "interleaved=", "-")
		i, err := strconv.Atoi(s)
		if err != nil {
			return 0, fmt.Errorf("wrong transport: %s", transport)
		}

		return byte(i), nil
	}
}

func (c *Conn) Play() (err error) {
	req := &tcp.Request{Method: MethodPlay, URL: c.URL}
	return c.WriteRequest(req)
}

func (c *Conn) Teardown() (err error) {
	// allow TEARDOWN from any state (ex. ANNOUNCE > SETUP)
	req := &tcp.Request{Method: MethodTeardown, URL: c.URL}
	return c.WriteRequest(req)
}

func (c *Conn) Close() error {

View on GitHub (pinned to c245815e75)