<html><head><style>pre,code,address {
  margin: 0px;
}
h1,h2,h3,h4,h5,h6 {
  margin-top: 0.2em;
  margin-bottom: 0.2em;
}
ol,ul {
  margin-top: 0em;
  margin-bottom: 0em;
}
blockquote {
  margin-top: 0em;
  margin-bottom: 0em;
}
</style></head><body><div>Le lundi 21 août 2023 à 20:46 +0530, Sulthan Amanu a écrit :</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr">Hi Team<br><br>How to establish a connection between sender and receiver using TCP? I've successfully achieved the connection using UDP, but I'm facing difficulties in establishing a connection between the server and receiver using TCP. I'm encountering an error that says "Could not open resource for reading."<br><br>My goal is to save images from the server.<br><br><b>UDP Workable commend</b><br><br><b>Sender:</b><br>gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw,width=1280,height=720 ! jpegenc ! rtpjpegpay ! queue ! udpsink host=192.168.53.207 port=7001</div></blockquote><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr"><br><b>Receiver:</b><br>gst-launch-1.0 udpsrc port=7001 ! application/x-rtp,encoding-name=JPEG,payload=26 ,x-dimensions=\"4192,3120\" ! queue  ! rtpjitterbuffer latency=200 !  rtpjpegdepay ! multifilesink location="image%d.jpg"<br><br><b>TCP - Non workable commend<br></b><br><b>Sender:</b><br><br>gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=50 ! video/x-raw,width=1280,height=720 ! jpegenc ! rtpjpegpay ! tcpserversink host=192.168.53.207 port=7001</div></blockquote><div><br></div><div>Unlike UDP, you have to configure the server IP,here you have configured the receiver IP (or 0.0.0.0 to bind to all ipv4 interfaces). Also, in absence of datagram, you need a secondary level payloading.</div><div><br></div><pre>gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=50 ! video/x-raw,width=1280,height=720 ! jpegenc ! rtpjpegpay ! rtpstreampay ! tcpserversink host=<server-ip> port=7001</pre><div><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr"><br><b>Receiver:</b><br><br>gst-launch-1.0 tcpclientsrc host=192.168.53.207 port=7001 ! application/x-rtp,encoding-name=JPEG,payload=26 ! queue ! rtpjitterbuffer latency=200 ! rtpjpegdepay ! multifilesink location="image%d.jpg"</div></blockquote><div><br></div><pre>gst-launch-1.0 tcpclientsrc host=<server-ip> port=7001 ! application/x-rtp-stream,encoding-name=JPEG,payload=26 ! queue ! rtpstreamdepay ! rtpjitterbuffer latency=200 ! rtpjpegdepay ! multifilesink location="image%d.jpg"</pre><div><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div dir="ltr"><br><br>e$ gst-launch-1.0 tcpclientsrc host=192.168.53.207 port=7001 ! application/x-rtp,encoding-name=JPEG,payload=26 ! queue ! rtpjitterbuffer latency=200 ! rtpjpegdepay ! multifilesink location="image%d.jpg"<div><br>Setting pipeline to PAUSED ...<br>ERROR: Pipeline doesn't want to pause.<br>ERROR: from element /<b>GstPipeline:pipeline0/GstTCPClientSrc:tcpclientsrc0: Could not open resource for reading.</b><br>Additional debug info:<br>gsttcpclientsrc.c(459): gst_tcp_client_src_start (): /GstPipeline:pipeline0/GstTCPClientSrc:tcpclientsrc0:<br>Failed to connect to host '<a href="http://192.168.53.207:7001">192.168.53.207:7001</a>': Connection refused<br>Setting pipeline to NULL ...<br>Freeing pipeline ...<br></div></div></blockquote><div><br></div><div>This should in theory resolve the issue.</div><div><br></div><div>regards,</div><div>Nicolas</div><div><span></span></div></body></html>