AlexxIT/go2rtc · error

unsupported method

Error message

unsupported method: %s

What it means

The RTSP server received a request whose method is not implemented by the Accept switch (outside OPTIONS/DESCRIBE/SETUP/PLAY/PAUSE/TEARDOWN etc.), so the session returns an error response. Names the unsupported method.

Solutions

  1. Ensure the RTSP client issues only standard methods supported by the server
  2. Update the server to handle the missing method if it is a valid RTSP extension
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/rtsp/server.go:217 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/bc27ad608ef95c82. Report an issue: GitHub.

Appendix: source

Thrown at pkg/rtsp/server.go:217

					if track.Media.ID != MethodSetup {
						track.Close()
					}
				}
			}

			res := &tcp.Response{Request: req}
			err = c.WriteResponse(res)
			c.playOK = true
			return err

		case MethodTeardown:
			res := &tcp.Response{Request: req}
			_ = c.WriteResponse(res)
			c.state = StateNone
			return c.conn.Close()

		default:
			return fmt.Errorf("unsupported method: %s", req.Method)
		}
	}
}

func reqTrackID(req *tcp.Request) int {
	var s string
	if req.URL.RawQuery != "" {
		s = req.URL.RawQuery
	} else {
		s = req.URL.Path
	}
	if i := strings.LastIndexByte(s, '='); i > 0 {
		if i, err := strconv.Atoi(s[i+1:]); err == nil {
			return i
		}
	}
	return -1
}

View on GitHub (pinned to c245815e75)