Github ソース、バージョン 1.5.2 から Gstreamer をビルドしました。UDP 経由で 4 つの RTP ストリームを受信し、それらを 1 つのシンクにミックスしようとしています。
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.
デバッグ出力のスニペットを次に示します。
0:00:00.030580800 7944 0x1a0a180 DEBUG udpsrc gstudpsrc.c:920:gst_udpsrc_open:<udpsrc0> allocating socket for 0.0.0.0:8001
0:00:00.030776434 7944 0x1a0a180 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.030906105 7944 0x1a0a180 DEBUG udpsrc gstudpsrc.c:933:gst_udpsrc_open:<udpsrc0> got socket 0x1a82130
0:00:00.030973628 7944 0x1a0a180 DEBUG udpsrc gstudpsrc.c:940:gst_udpsrc_open:<udpsrc0> binding on port 8001
0:00:00.031013585 7944 0x1a0a180 INFO udpsrc gstudpsrc.c:1008:gst_udpsrc_open:<udpsrc0> have udp buffer of 212992 bytes
0:00:00.031048025 7944 0x1a0a180 DEBUG udpsrc gstudpsrc.c:1081:gst_udpsrc_open:<udpsrc0> bound, on port 8001
このパイプラインを 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
か、間違ったプロパティを設定しましたか?