Search code examples
gstreamervlcamazon-kinesis

How to pass authentication in GST Launch?


I am passing User name and password in the URI. But, I am getting Unauthorized Error. I followed this doc https://developer.ridgerun.com/wiki/index.php?title=GstRtspSink_-_Basic_Authentication. According to the documentation, I can send uername and password in URI. It's working for VLC but not for GST launch.

For VLC:

vlc rtsp://user:[email protected]:7001/camera-id

For GST-Launch:

gst-launch-1.0 rtspsrc location="rtsp://user:[email protected]:7001/camera-id" 

Error:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://user:[email protected]:7001/camera-id
Progress: (open) Retrieving server options
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Not authorized to access resource.
Additional debug info:
gstrtspsrc.c(5623): gst_rtspsrc_send (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
Unauthorized
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

How to pass authentication in GSt Launch? I can provide more details if you have anything from my side

Any help would be appreciable.


Solution

  • From gst-inspect-1.0 rtspsrc:

      user-id             : RTSP location URI user id for authentication
                            flags: readable, writable
                            String. Default: null
      user-pw             : RTSP location URI user password for authentication
                            flags: readable, writable
                            String. Default: null