Gstreamer udpsrc read或s

2024-06-28 18:58:09 发布

您现在位置:Python中文网/ 问答频道 /正文

我从Github源代码1.5.2版构建了Gstreamer。 我尝试通过UDP接收四个RTP流,并将它们混合到一个sink中。在

gst-launch-1.0执行管道时没有问题:

gst-launch-1.0 adder name=mix \
mix. ! audioresample ! "audio/x-raw, rate=(int)48000" ! audioconvert ! alsasink device=hw:0,0 sync=true\
udpsrc port=8001 ! "application/x-rtp, payload=(int)127, clock-rate=(int)48000, encoding-name=(string)L24, channels=(int)2" ! queue ! rtpL24depay ! audiorate ! "audio/x-raw, rate=(int)48000" ! audioconvert ! mix. \
udpsrc port=8002 ! "application/x-rtp, payload=(int)127, clock-rate=(int)48000, encoding-name=(string)L24, channels=(int)2" ! queue ! rtpL24depay ! audiorate ! "audio/x-raw, rate=(int)48000" ! audioconvert ! mix. \
udpsrc port=8003 ! "application/x-rtp, payload=(int)127, clock-rate=(int)48000, encoding-name=(string)L24, channels=(int)2" ! queue ! rtpL24depay ! audiorate ! "audio/x-raw, rate=(int)48000" ! audioconvert ! mix. \
udpsrc port=8004 ! "application/x-rtp, payload=(int)127, clock-rate=(int)48000, encoding-name=(string)L24, channels=(int)2" ! queue ! rtpL24depay ! audiorate ! "audio/x-raw, rate=(int)48000" ! audioconvert ! mix.

下面是调试输出的片段:

^{pr2}$

当我在Python 3.4程序中构建此管道时,udpsrc失败,输出如下:

 0:00:00.209166227  8783 0x7f23ac005330 DEBUG                 udpsrc gstudpsrc.c:920:gst_udpsrc_open:<udpsrc0> allocating socket for 0.0.0.0:8001
 0:00:00.209216934  8783 0x7f23ac005330 DEBUG                 udpsrc gstudpsrc.c:891:gst_udpsrc_resolve:<udpsrc0> IP address for host 0.0.0.0 is 0.0.0.0
 0:00:00.209256307  8783 0x7f23ac005330 DEBUG                 udpsrc gstudpsrc.c:933:gst_udpsrc_open:<udpsrc0> got socket 0x7f23b4012bb0
 0:00:00.209281194  8783 0x7f23ac005330 DEBUG                 udpsrc gstudpsrc.c:940:gst_udpsrc_open:<udpsrc0> binding on port 8001
 0:00:00.209318428  8783 0x7f23ac005330 INFO                  udpsrc gstudpsrc.c:1008:gst_udpsrc_open:<udpsrc0> have udp buffer of 212992 bytes
 0:00:00.209351430  8783 0x7f23ac005330 DEBUG                 udpsrc gstudpsrc.c:1081:gst_udpsrc_open:<udpsrc0> bound, on port 8001
 ...
 0:00:00.216234022 10012 0x7f1e80001d90 LOG                   udpsrc gstudpsrc.c:628:gst_udpsrc_create:<udpsrc0> read packet of 1398 bytes
 0:00:00.216279688 10012 0x7f1e80001d90 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<udpsrc0> error: Internal data flow error.
 0:00:00.216297871 10012 0x7f1e80001d90 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<udpsrc0> error: streaming task paused, reason not-negotiated (-4)
 Error received from element udpsrc0: Internal data flow error.
 Debugging information: gstbasesrc.c(2943): gst_base_src_loop (): /GstPipeline:INPUT/GstUDPSrc:udpsrc0:
 streaming task paused, reason not-negotiated (-4)OUTPUT Pipeline state changed from ready to paused.

我在调试输出中看到的唯一区别是套接字地址。 gst-launch-1.0打印7字节的套接字地址,Python程序打印12字节的套接字地址。在

这里出什么问题了? 我是忘记了queue还是设置了错误的属性?在


Tags: namedebugrawratequeueportopenaudio