Rtspsrc element not working with default user-agent although username is in url for a particular camera, but working with username if given as user-agent value

I have an rtsp stream with the url of the format rtsp://<username>:<password>@<ipAddress>:554/cam/realmonitor?channel=1&subtype=0

When I launch a small gstreamer pipeline (rtspsrc -> fakesink) with the command: gst-launch-1.0 rtspsrc location='rtsp://<username>:<password>@<ipAddress>:554/cam/realmonitor?channel=1&subtype=0' protocols=tcp ! fakesink, it was giving error: Could not receive message. (Timeout while waiting for server response).

However, if I also include user-agent="<username>" for the rtspsrc element, it was working, i.e. pipeline is going to playing.

WORKING COMMAND: gst-launch-1.0 rtspsrc location='rtsp://<username>:<password>@<ipAddress>:554/cam/realmonitor?channel=1&subtype=0' protocols=tcp user-agent="<username>" ! fakesink

In the rtspsrc documentation, user-agent’s default value was mentioned to be Gstreamer/{VERSION} which I also had seen in the debug logs.

Here is some cherry-picked lines from the gstreamer logging, please notice two different user-name strings

0:00:00.036659633 3294983 0x55d5fae02b60 LOG                  rtspsrc gstrtspsrc.c:9391:dump_key_value:<rtspsrc0>    key: 'User-Agent', value: 'GStreamer/1.16.3'
0:00:00.036665161 3294983 0x55d5fae02b60 LOG                  rtspsrc gstrtspsrc.c:9391:dump_key_value:<rtspsrc0>    key: 'User-Agent', value: 'RealMedia Player Version 6.0.9.1235 (linux-2.0-libc6-i386-gcc2.95)'

<After some print statements>

0:00:00.036507326 3294983 0x55d5fae02b60 LOG                  rtspsrc gstrtspsrc.c:9432:gst_rtspsrc_print_rtsp_message:<rtspsrc0>    code:   '401'
0:00:00.036512153 3294983 0x55d5fae02b60 LOG                  rtspsrc gstrtspsrc.c:9433:gst_rtspsrc_print_rtsp_message:<rtspsrc0>    reason: 'Unauthorized'

<After some print statements>

0:00:00.036575459 3294983 0x55d5fae02b60 DEBUG                rtspsrc gstrtspsrc.c:6188:gst_rtspsrc_setup_auth:<rtspsrc0> Attempting authentication using credentials from the URL

<After some print statements>

0:00:00.036659633 3294983 0x55d5fae02b60 LOG                  rtspsrc gstrtspsrc.c:9391:dump_key_value:<rtspsrc0>    key: 'User-Agent', value: 'GStreamer/1.16.3'
0:00:00.036665161 3294983 0x55d5fae02b60 LOG                  rtspsrc gstrtspsrc.c:9391:dump_key_value:<rtspsrc0>    key: 'User-Agent', value: 'RealMedia Player Version 6.0.9.1235 (linux-2.0-libc6-i386-gcc2.95)'

<After some print statements>

0:00:20.054549219 3294983 0x55d5fae02b60 WARN                 rtspsrc gstrtspsrc.c:6323:gst_rtsp_src_receive_response:<rtspsrc0> error: Could not receive message. (Timeout while waiting for server response)

In the successful pipeline with my <username> as user-agent value, I see that GStreamer/1.16.3 is replaced by my <username>, but, RealMedia Player Version 6.0.9.1235 (linux-2.0-libc6-i386-gcc2.95) still exists.

Just a note that the pipeline which wasn’t working above was also tested with Gstreamer 1.24.2 on Ubuntu24, and it wasn’t working there too.

Question is, only this specific camera failed. All other cameras until now worked with the default user-agent value. Could this be gstreamer issue? ffprobe was working well with the same URL.

Make of the camera:

Manufacturer : 'CP PLUS'
Model        : 'CP-UNC-TA21PL3C-V3'
Firmware     : '2.800.00AT001.0.R 2021-12-15'