In GStreamer 1.20 times I fixed the handling of RTSP control URIs in GStreamer's RTSP source element by making use of GstUri for joining URIs and resolving relative URIs instead of using a wrong, custom implementation of those basic URI operations (see RFC 2396).
This was in response to a bug report which was caused by a regression in 1.18 when fixing that custom implementation some years before. Now that this is handled according to the standards, one would expect that the topic is finally solved.
Unfortunately that was not the case. As it turns out, various RTSP servers are
not actually implementing the URI operations for constructing the control URI
but instead do simple string concatenation. This works fine for simple cases
but once path separators or query parameters are involved this is not
sufficient. The fact that both VLC and ffmpeg on the client-side also only do string
concatenation unfortunately does not help this situation either as these
servers will work fine in VLC and ffmpeg but not in GStreamer, so it initially
appears like a GStreamer bug.
To work around these cases automatically, a workaround with a couple of
follow-up fixes 1 2 3 4 was implemented. This workaround is available since 1.20.4.
Unfortunately this was also not enough as various servers don't just implement
the URI RFC wrong, but also don't implement the RTSP RFC correctly and don't
return any kind of meaningful errors but, for example, simply close the
connection.
To solve this once and for all, Mathieu now added a new property to rtspsrc
that forces it to directly use string concatenation and not attempt proper URI
operations first.
$ gst-launch-1.0 rtspsrc location=rtsp://1.2.3.4/test force-non-compliant-url=true ! ...
This property is available since 1.24.7 and should make it possible to use
such misbehaving and non-compliant servers.
If GStreamer's rtspsrc fails on an RTSP stream that is handled just fine by
VLC and ffmpeg, give this a try.