Can not stream USB camera connected to AGX Xavier using GStreamer RTSP server to remote machine

I have AGX Xavier. Version: L4T 32.4.4 [ JetPack 4.4.1 ]
Logitech c922 pro stream webcam is connected to Xavier.

Built gst rtsp server from here:

From the Examples I ran:

./test-launch  --gst-debug=3 '( v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=30/1 ! x264enc tune="zerolatency" byte-stream=true bitrate=2000 ! rtph264pay name=pay0 pt=96 )'

Output of above command:

stream ready at rtsp://

Now at the client side (Other than Xavier in the same network):

gst-launch-1.0 --gst-debug=3 -v rtspsrc location=rtsp://IP_OF_XAVIER:8554/test latency=0 buffer-mode=auto ! decodebin ! videoconvert ! autovideosink sync=false

Output of above command at client side:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Got context from element 'autovideosink0':,"\ 
(GstGLDisplayX11\)\ gldisplayx11-0";
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://
0:00:02.231714505 15796 0x55709db94990 ERROR                default 
gstrtspconnection.c:1004:gst_rtsp_connection_connect_with_response: failed to connect: Could not connect to Connection refused
0:00:02.231816284 15796 0x55709db94990 ERROR                rtspsrc gstrtspsrc.c:4702:gst_rtsp_conninfo_connect: 
<rtspsrc0> Could not connect to server. (Generic error)
0:00:02.231824200 15796 0x55709db94990 WARN                 rtspsrc gstrtspsrc.c:7469:gst_rtspsrc_retrieve_sdp: 
<rtspsrc0> error: Failed to connect. (Generic error)
0:00:02.231860013 15796 0x55709db94990 WARN                 rtspsrc gstrtspsrc.c:7548:gst_rtspsrc_open:<rtspsrc0> 
can't get sdp
0:00:02.231871525 15796 0x55709db94990 WARN                 rtspsrc gstrtspsrc.c:5628:gst_rtspsrc_loop:<rtspsrc0> 
we are not connected
ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not open resource for reading and 
Additional debug info:
gstrtspsrc.c(7469): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
 Failed to connect. (Generic error)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

I have even tried with VLC giving stream “rtsp://”. But failed.

I have confirmed Camera node is there at /dev/video0

From here I can succesfully run videotestsrc and get this stream on remote.

Please help.

Also want to know how to use hardware acceleration for this?

Thanks in advance.

Please follow this and see if you can launch the camera successfully:
USB Camera MJPEG to h265 - #6 by Honey_Patouceul

Thanks a lot. It worked !!