Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-104605

gst-pipeline url fails if RTSP password contains url-encoded symbols

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: P2: Important P2: Important
    • None
    • 5.15.10
    • Multimedia
    • Debian 11 Bullseye amd64
      GStreamer 1.18.4-2
    • Linux/X11

      Using GStreamer pipeline to play RTSP stream from IP camera with password that contains "@" or "?" like this:

      "gst-pipeline: rtspsrc location=rtsp://admin:admin%40123@192.168.1.109:554/cam/realmonitor?channel=1&subtype=0&unicast=true protocols=udp latency=100 ! rtph264depay ! avdec_h264 ! qtvideosink"
      

      Produces error:

      Error: "Could not open resource for reading and writing."

      And there's no video playback.

      Now, if I use simple URL, not a gstreamer pipeline, like this:

      rtsp://admin:admin%40123@192.168.1.109:554/cam/realmonitor?channel=1&subtype=0&unicast=true
      

      Streaming works. But we need gst-pipeline for performance tuning, like setting up lower latency, or complex queues to reach optimal performance on IMX devices, etc.

      Qt6 does not even support pipelines so I report it against Qt5 only (it also works fine with direct url).

      Running gst-launch-1.0 like this works fine:

      gst-launch-1.0 rtspsrc "location=rtsp://admin:admin%40123@192.168.1.109:554/cam/realmonitor?channel=1&subtype=0&unicast=true" protocols=udp latency=100 ! rtph264depay ! avdec_h264 ! glimagesink
      
      

      I see in Wireshak RTSP packet capture that url-encoded symbols somehow corrupts url, which in results looks like this:

      Real Time Streaming Protocol
          Request: OPTIONS rtsp://123@192.168.1.109:554/cam/realmonitor?channel=1&subtype=0&unicast=true RTSP/1.0\r\n
          CSeq: 1\r\n
          User-Agent: GStreamer/1.18.4\r\n
          User-Agent: RealMedia Player Version 6.0.9.1235 (linux-2.0-libc6-i386-gcc2.95)\r\n
          ClientChallenge: 9e26d33f2984236010ef6253fb1887f7\r\n
          CompanyID: KnKV4M4I/B2FjJ1TToLycw==\r\n
          GUID: 00000000-0000-0000-0000-000000000000\r\n
          RegionData: 0\r\n
          PlayerStarttime: [28/03/2003:22:50:23 00:00]\r\n
          ClientID: Linux_2.4_6.0.9.1235_play32_RN01_EN_586\r\n
          Date: Tue, 28 Jun 2022 06:29:54 GMT\r\n
          \r\n
      

      Note that it's rtsp://123@192.168.1.109:554 and not rtsp://192.168.1.109:554/

      This is RTSP packet snippet from working example (with direct URL, not pipeline):

      Real Time Streaming Protocol
          Request: OPTIONS rtsp://192.168.1.109:554/cam/realmonitor?channel=1&subtype=0&unicast=true RTSP/1.0\r\n
          CSeq: 1\r\n
          User-Agent: \r\n
          User-Agent: RealMedia Player Version 6.0.9.1235 (linux-2.0-libc6-i386-gcc2.95)\r\n
          ClientChallenge: 9e26d33f2984236010ef6253fb1887f7\r\n
          CompanyID: KnKV4M4I/B2FjJ1TToLycw==\r\n
          GUID: 00000000-0000-0000-0000-000000000000\r\n
          RegionData: 0\r\n
          PlayerStarttime: [28/03/2003:22:50:23 00:00]\r\n
          ClientID: Linux_2.4_6.0.9.1235_play32_RN01_EN_586\r\n
          Date: Tue, 28 Jun 2022 07:04:08 GMT\r\n
          \r\n
      
      
      

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtmultimediateam Qt Multimedia Team
            vdargis_at_uab_styritrade Vincas Dargis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes