您好,我正在尝试使用 gstreamer-1.0 将数据从 linux box (Raspberry Pi) 流式传输到 Macbook pro。
在树莓派 (Linux) 上
pi@raspberrypi:[~]$ gst-launch-1.0 filesrc location="video.h264" ! tcpclientsink host="192.168.1.140" port=5000
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstTCPClientSink:tcpclientsink0: Could not open resource for reading.
Additional debug info:
gsttcpclientsink.c(366): gst_tcp_client_sink_start (): /GstPipeline:pipeline0/GstTCPClientSink:tcpclientsink0:
Failed to connect to host '192.168.1.140:5000': Connection refused
Setting pipeline to NULL ...
Freeing pipeline ...
在苹果机上
punits@punits-mac:rover $ gst-launch-1.0 -v tcpserversrc port=5000 ! fakesink
Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstTCPServerSrc:tcpserversrc0: current-port = 5000
Pipeline is PREROLLING ...
在 raspberry-pi 本地主机上同时使用客户端和服务器工作正常。请让我知道我做错了什么。
最佳答案
我遇到了连接被拒绝的两个主要原因:
- 如果没有指定主机; tcpclientsink 使用 ipv6 而不是 ipv4。
- 服务器没有监听;这给出了“连接被拒绝”错误。您必须先启动服务器!
关于linux - gstreamer tcpclientsink 连接被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23329043/