2017-09-18 66 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