rtspsrc Content-Base regression?
In GStreamer 1.16.3, when receiving a Content-Base header in the response of a DESCRIBE call, the URI for the SETUP command uses this Content-Base. In GStreamer 1.20.1, it appears that the Content-Base is ignored?
In both examples the location
is rtsp://relay.something.com:443/<REDACTED/ipcam_h264.sdp?token=<MYTOKEN>
1.16.3 example:
rtspsrc gstrtspsrc.c:9395:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m RTSP request message 0x58a9591c
rtspsrc gstrtspsrc.c:9396:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m request line:
rtspsrc gstrtspsrc.c:9397:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m method: 'DESCRIBE'
rtspsrc gstrtspsrc.c:9399:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m uri: 'rtsp://relay.something.com:443/<REDACTED/ipcam_h264.sdp?token=<MYTOKEN>'
rtspsrc gstrtspsrc.c:9400:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m version: '1.0'
rtspsrc gstrtspsrc.c:9402:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m headers:
rtspsrc gstrtspsrc.c:9375:dump_key_value:<rtspsrc0>^[[00m key: 'User-Agent', value: 'GStreamer/1.16.3'
rtspsrc gstrtspsrc.c:9375:dump_key_value:<rtspsrc0>^[[00m key: 'Accept', value: 'application/sdp'
rtspsrc gstrtspsrc.c:9404:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m body:
rtspsrc gstrtspsrc.c:9484:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m --------------------------------------------
rtspsrc gstrtspsrc.c:9392:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m --------------------------------------------
rtspsrc gstrtspsrc.c:9414:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m RTSP response message 0x58a95948
rtspsrc gstrtspsrc.c:9415:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m status line:
rtspsrc gstrtspsrc.c:9416:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m code: '200'
rtspsrc gstrtspsrc.c:9417:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m reason: 'OK'
rtspsrc gstrtspsrc.c:9418:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m version: '1.0
rtspsrc gstrtspsrc.c:9420:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m headers:
rtspsrc gstrtspsrc.c:9375:dump_key_value:<rtspsrc0>^[[00m key: 'CSeq', value: '2'
rtspsrc gstrtspsrc.c:9375:dump_key_value:<rtspsrc0>^[[00m key: 'Date', value: 'Wed, Apr 27 2022 00:00:08 GMT'
rtspsrc gstrtspsrc.c:9375:dump_key_value:<rtspsrc0>^[[00m key: 'Content-Base', value: 'rtsp://<REDACTED>/stream1-2/'
rtspsrc gstrtspsrc.c:9375:dump_key_value:<rtspsrc0>^[[00m key: 'Content-Type', value: 'application/sdp'
rtspsrc gstrtspsrc.c:9375:dump_key_value:<rtspsrc0>^[[00m key: 'Content-Length', value: '650'
rtspsrc gstrtspsrc.c:9423:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m body: length 651
rtspsrc gstrtspsrc.c:9426:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m v=0
o=- 1609459213178256 1 IN IP4 <REDACTED>
s=ch1-2
i=ch1-2
t=0 0
a=tool:LIVE555 Streaming Media v2015.04.22
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:ch1-2
a=x-qt-text-inf:ch1-2
m=video 0 RTP/AVP 96
c=IN IP4 <REDACTED>
b=AS:500
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=640028;sprop-parameter-sets=Z2QAKKzSAoC/5ZuAgICgAAB9AAAOpgCA,aOqPLA==
a=control:track1
m=audio 0 RTP/AVP 97
c=IN IP4 <REDACTED>
b=AS:16
a=rtpmap:97 MPEG4-GENERIC/16000
a=fmtp:97 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1408
a=control:track2
(651)
RTSP request message 0x58a95808
rtspsrc gstrtspsrc.c:9396:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m request line:
rtspsrc gstrtspsrc.c:9397:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m method: 'SETUP'
rtspsrc gstrtspsrc.c:9399:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m uri: 'rtsp://<REDACTED>/stream1-2/track1'
rtspsrc gstrtspsrc.c:9400:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m version: '1.0'
rtspsrc gstrtspsrc.c:9402:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m headers:
rtspsrc gstrtspsrc.c:9375:dump_key_value:<rtspsrc0>^[[00m key: 'User-Agent', value: 'GStreamer/1.16.3'
rtspsrc gstrtspsrc.c:9375:dump_key_value:<rtspsrc0>^[[00m key: 'Transport', value: 'RTP/AVP/TCP;unicast;interleaved=0-1'
rtspsrc gstrtspsrc.c:9404:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m body:
rtspsrc gstrtspsrc.c:9484:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m --------------------------------------------
rtspsrc gstrtspsrc.c:9392:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m --------------------------------------------
rtspsrc gstrtspsrc.c:9414:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m RTSP response message 0x58a95834
rtspsrc gstrtspsrc.c:9415:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m status line:
rtspsrc gstrtspsrc.c:9416:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m code: '200'
rtspsrc gstrtspsrc.c:9417:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m reason: 'OK'
rtspsrc gstrtspsrc.c:9418:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m version: '1.0
rtspsrc gstrtspsrc.c:9420:gst_rtspsrc_print_rtsp_message:<rtspsrc0>^[[00m headers:
rtspsrc gstrtspsrc.c:9375:dump_key_value:<rtspsrc0>^[[00m key: 'CSeq', value: '3'
rtspsrc gstrtspsrc.c:9375:dump_key_value:<rtspsrc0>^[[00m key: 'Date', value: 'Wed, Apr 27 2022 00:00:08 GMT'
rtspsrc gstrtspsrc.c:9375:dump_key_value:<rtspsrc0>^[[00m key: 'Transport', value: 'RTP/AVP/TCP;unicast;destination=<REDACTED>;source=<REDACTED>;interleaved=0-1'
rtspsrc gstrtspsrc.c:9375:dump_key_value:<rtspsrc0>^[[00m key: 'Session', value: '<REDACTED>;timeout=95'
1.20.1 example:
rtspsrc gstrtspsrc.c:9799:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m RTSP request message 0x16f72ac60
rtspsrc gstrtspsrc.c:9800:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m request line:
rtspsrc gstrtspsrc.c:9802:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m method: 'DESCRIBE'
rtspsrc gstrtspsrc.c:9803:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m uri: 'rtsp://relay.something.com:443/<REDACTED>/ipcam_h264.sdp?token=<TOKEN>'
rtspsrc gstrtspsrc.c:9805:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m version: '1.0'
rtspsrc gstrtspsrc.c:9806:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m headers:
rtspsrc gstrtspsrc.c:9780:dump_key_value:<rtspsrc>[00m key: 'User-Agent', value: 'GStreamer/1.20.1'
rtspsrc gstrtspsrc.c:9780:dump_key_value:<rtspsrc>[00m key: 'Accept', value: 'application/sdp'
rtspsrc gstrtspsrc.c:9808:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m body:
rtspsrc gstrtspsrc.c:9888:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m --------------------------------------------
rtspsrc gstrtspsrc.c:9796:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m --------------------------------------------
rtspsrc gstrtspsrc.c:9818:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m RTSP response message 0x16f72ac00
rtspsrc gstrtspsrc.c:9819:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m status line:
rtspsrc gstrtspsrc.c:9820:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m code: '200'
rtspsrc gstrtspsrc.c:9821:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m reason: 'OK'
rtspsrc gstrtspsrc.c:9823:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m version: '1.0
rtspsrc gstrtspsrc.c:9824:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m headers:
rtspsrc gstrtspsrc.c:9780:dump_key_value:<rtspsrc>[00m key: 'CSeq', value: '2'
rtspsrc gstrtspsrc.c:9780:dump_key_value:<rtspsrc>[00m key: 'Date', value: 'Wed, Apr 27 2022 00:13:35 GMT'
rtspsrc gstrtspsrc.c:9780:dump_key_value:<rtspsrc>[00m key: 'Content-Base', value: 'rtsp://<REDACTED>/stream1-2/'
rtspsrc gstrtspsrc.c:9780:dump_key_value:<rtspsrc>[00m key: 'Content-Type', value: 'application/sdp'
rtspsrc gstrtspsrc.c:9780:dump_key_value:<rtspsrc>[00m key: 'Content-Length', value: '650'
rtspsrc gstrtspsrc.c:9827:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m body: length 651
rtspsrc gstrtspsrc.c:9830:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m v=0
o=- 1609459213178256 1 IN IP4 <REDACTED>
s=ch1-2
i=ch1-2
t=0 0
a=tool:LIVE555 Streaming Media v2015.04.22
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:ch1-2
a=x-qt-text-inf:ch1-2
m=video 0 RTP/AVP 96
c=IN IP4 <REDACTED>
b=AS:500
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=640028;sprop-parameter-sets=Z2QAKKzSAoC/5ZuAgICgAAB9AAAOpgCA,aOqPLA==
a=control:track1
m=audio 0 RTP/AVP 97
c=IN IP4 <REDACTED>
b=AS:16
/
a=rtpmap:97 MPEG4-GENERIC/16000
a=fmtp:97 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1408
a=control:track2
(651)
rtspsrc gstrtspsrc.c:9799:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m RTSP request message 0x16ba72a90
rtspsrc gstrtspsrc.c:9800:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m request line:
rtspsrc gstrtspsrc.c:9802:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m method: 'SETUP'
rtspsrc gstrtspsrc.c:9803:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m uri: 'rtsp://relay.something.com:443/<REDACTED>/ipcam_h264.sdp/track1?token=<TOKEN>'
rtspsrc gstrtspsrc.c:9805:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m version: '1.0'
rtspsrc gstrtspsrc.c:9806:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m headers:
rtspsrc gstrtspsrc.c:9780:dump_key_value:<rtspsrc>[00m key: 'User-Agent', value: 'GStreamer/1.20.1'
rtspsrc gstrtspsrc.c:9780:dump_key_value:<rtspsrc>[00m key: 'Transport', value: 'RTP/AVP/TCP;unicast;interleaved=0-1'
rtspsrc gstrtspsrc.c:9808:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m body:
rtspsrc gstrtspsrc.c:9888:gst_rtspsrc_print_rtsp_message:<rtspsrc>[00m --------------------------------------------
rtspsrc gstrtspsrc.c:6524:gst_rtsp_src_receive_response:<rtspsrc>[00m error: Could not receive message. (Parse error)
In 1.20.1 if I change the URI manually to be rtsp://<REDACTED>/stream1-2/track1
, the setup succeeds.
The reliance on this may be an issue with the server but what is the intent with the code? Or is this because the SDP specifies control as * so then the base URL ends up being used? The relevant code blocks in rtspsrc.c don't seem to have changed much between 1.16.3 and 1.20.1 at first glance.
I'm mainly looking for answers to:
- Which is the correct construction of the URI for SETUP? (Is this a regression in 1.20.1?)
- If 1.20.1's is correct, then what would be a good workaround for this? If content_base is correctly being parsed out from the headers but is just not being used, it's not externally accessible I think? Maybe modifying the SDP control:* part?
Thanks in advance!