After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768232 - rtspsrc: protocols aren't reset after rtsp redirect
rtspsrc: protocols aren't reset after rtsp redirect
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
Other Linux
: Normal normal
: 1.8.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2016-06-30 08:11 UTC by Brad Lackey
Modified: 2016-07-25 10:26 UTC
See Also:
GNOME target: ---
GNOME version: ---

Patch allowing redirection (2.25 KB, patch)
2016-06-30 23:20 UTC, Brad Lackey
reviewed Details | Review
Patch with suggestions implemented (1.93 KB, patch)
2016-07-01 10:05 UTC, Brad Lackey
committed Details | Review

Description Brad Lackey 2016-06-30 08:11:24 UTC
When consuming an RTSP source such as in fig.2, and assuming the protocol order such as in fig.1 everything works properly as long as the RTSP source doesn't redirect. 

I'm experiencing an issue where the unicast UDP protocol is attempted, then the server redirects to another URI, the RTSP negotiation starts over again using the new URI only this time unicast UDP is not attempted by gstreamer, instead it moves on to the next protocol.


gst-launch-1.0 rtspsrc debug=true location="rtsp://" ! queue ! rtph264depay ! h264parse ! matroskamux ! filesink location=file.mkv
Comment 1 Sebastian Dröge (slomo) 2016-06-30 08:45:48 UTC
Do you want to provide a patch to reset it so it starts again from UDP unicast?
Comment 2 Brad Lackey 2016-06-30 14:10:44 UTC
Sure, cloning the code for the first time now so bear with me.
Comment 3 Brad Lackey 2016-06-30 23:20:33 UTC
Created attachment 330680 [details] [review]
Patch allowing redirection

Added the patch as an attachment. The gst_rtspsrc_reconnect function was forcing TCP be used previously, I modified it to use the protocols parameter when the stream is being redirected otherwise use TCP as before.
Comment 4 Sebastian Dröge (slomo) 2016-07-01 09:43:05 UTC
Review of attachment 330680 [details] [review]:

::: gst/rtsp/gstrtspsrc.c
@@ +4890,3 @@
+   * try TCP when we were configured with an SDP. */
+  if(!src->need_redirect) {
+    if (!(src->protocols & GST_RTSP_LOWER_TRANS_TCP) || src->from_sdp)

These two ifs could be combined into one

@@ +4898,3 @@
+        ("RTSP redirect occurred after %.4f seconds.",
+            gst_guint64_to_gdouble (src->udp_timeout / 1000000.0)));

Why a warning on redirect? That's not really a problem, is it?
Comment 5 Brad Lackey 2016-07-01 10:05:12 UTC
Created attachment 330708 [details] [review]
Patch with suggestions implemented

Your suggestions have been added in this new patch
Comment 6 Sebastian Dröge (slomo) 2016-07-01 10:22:23 UTC
commit 6d3071f20070dd5ca5338908d3fa0b4c41be0e86
Author: Brad Lackey <>
Date:   Fri Jul 1 10:05:00 2016 +0000

    rtspsrc: Don't disable UDP protocols on redirecting