linuxgstreamergst-launch

gstreamer rtsp client connection refused error


I have installed Gstreamer on my i.MX6 board. I want to stream the camera connected using RTSP.

The following command displays the camera content on the LVDS screen:

gst-launch tvsrc ! Imxv4vl2sink

Instead of displaying it on the screen, I want to send the content over network RTSP and display it on other device's display

I used the following command to start streaming which works without throwing any error

gst-launch-0.10 -vv imxv4l2src ! video/x-raw-yuv, framerate=30/1, width=1024
, height=768 ! vpuenc codec=avc ! rtph264pay ! udpsink host=127.0.0.1 port=5004
sync=false

On the other device, I executed the following command:

gst-launch rtspsrc location=rtsp://<ip Address>:5004 name=source ! queue ! rtph264depay !
vpudec low-latency=true ! imxv4l2sink

It fails with the following error:

gstrtspsrc.c(5685): gst_rtspsrc_retrieve_sdp (): /GstPipeline:pipeline0/GstRTSPSrc:source:
Failed to connect. (System error: Connection refused)

I can ping from the other device to the streaming device.

What can be the issue?


Solution

  • You are sending RTP over UDP, but do not provide any RTSP protocol. So your receiver which tries to connect via RTSP will fail. You either need to use the GstRTSPServer class and implement some logic as an application on the sender side or receive your data via udpsrc. For the latter you still need a way to transmit SDP data (which usually is one thing an RTSP server does).