2017-09-18 63 views
0

这里是我的GStreamer流管:的GStreamer流媒体视频到公网IP地址

gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480 ! \ 
    x264enc tune=zerolatency byte-stream=true \ 
    bitrate=3000 threads=2 ! \ 
    h264parse config-interval=1 ! \ 
    rtph264pay ! udpsink host=xxx.xxx.xxx.xxx port=5600 

和相关的GStreamer接收管道:

gst-launch-1.0 udpsrc port=5600 ! \ 
    application/x-rtp,\ 
    encoding-name=H264,payload=96 ! \ 
    rtph264depay ! h264parse ! avdec_h264 ! \ 
    autovideosink 

我的问题是,当我进入我的公网IP地址,而不是xxx.xxx.xxx.xxx。我无法收到我的视频。但是当我使用我的本地IP视频时,它正在接收。 有谁知道问题出在哪里。我在同一台PC上同时打开两个管道,也许这是问题所在?

回答

0

首先,您应该使用像Wireshark这样的工具监视流量。 如果在Linux上,您可以查看loopback(lo)接口。

此外,还有一个address财产上udpsrc您可以设置:

gst-launch-1.0 udpsrc port=5600 address=xxx.xxx.xxx.xxx ! \ 
    application/x-rtp,\ 
    encoding-name=H264,payload=96 ! \ 
    rtph264depay ! h264parse ! avdec_h264 ! \ 
    autovideosink 
+0

我有地址属性试过了,现在我得到这个错误: '设置管道停顿了一下。 错误:管道不想暂停。 错误:来自元素/ GstPipeline:pipeline0/GstUDPSrc:udpsrc0:无法从/在资源上获取/设置设置。 额外调试信息: gstudpsrc.c(1494):gst_udpsrc_open():/ GstPipeline:pipeline0/GstUDPSrc:udpsrc0: 绑定失败:错误绑定地址:不能分配请求的地址 管道设置为NULL ...... 管道解放出来...' GStreamer是否有可能仅在本地网络上传输,并且无法通过公共IP进行传输? – suny99