我正在开发视频聊天应用程序,但在UDP流与TCP方面遇到问题。
当我使用下面的管道时,视频流可以接受。 (应用程序本身在python中,但是管道本质上如下)
sender:
gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=320,height=240 !
theoraenc ! oggmux ! tcpclientsink host=nnn.nnn.nnn.nnn port = 5000
receiver:
gst-launch-0.10 tcpserversrc host=nnn.nnn.nnn.nnn port=5000
! decodebin ! xvimagesink
但是,由于此应用程序要跨/通过NAT执行,因此我需要UDP流传输。
当我将tcpserversrc切换为“ udpsrc port = 5000”,并将tcpclientsink切换为“ udpsink host = nnn.nnn.nnn.nnnn port = 5000”时,性能急剧下降,以至接收计算机每5秒获得一帧或者。 (即使两个流都在同一台计算机上执行,也会发生这种情况)
发送管道生成以下内容(一次):
WARNING: from element /GstPipeline:pipeline0/GstUDPSink:udpsink0:
Internal data flow problem.
Additional debug info:
gstbasesink.c(3492): gst_base_sink_chain_unlocked (): /GstPipeline:pipeline0
/GstUDPSink:udpsink0:
Received buffer without a new-segment. Assuming timestamps start from 0.
...并且接收管道生成(每20秒左右):
WARNING: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
A lot of buffers are being dropped.
Additional debug info:
gstbasesink.c(2739): gst_base_sink_is_too_late (): /GstPipeline:pipeline0
/GstXvImageSink:xvimagesink0:
There may be a timestamping problem, or this computer is too slow.
我读过文档和手册页,上面充斥着udpsink的各种参数,但效果都不佳。
谁能将我引向我完全没有意识到的(无疑是显而易见的)事情?
提前致谢 :)
最佳答案
我有同样的问题。
尝试设定
sync=false
在tcpclientsink和xvimagesink上