rtpオーディオの送信と受信の両方を行う単一のgstreamerパイプラインを構築したいと思います。
私が見つけた例(いくつかあります)に基づいて、これが私のほぼ機能するコードです。
(プログラムはRexxで書かれていますが、何が起こっているのかはかなり明白だと思います。ここでは、bashによく似ています!)行のカテネーション文字はコンマです。「」ビットは、読みやすくするために空白行を挿入するだけです。
rtp_recv_port = 8554
rtp_send_port = 8555
pipeline = "gst-launch -e",
"",
"gstrtpbin",
" name=rtpbin",
"",
"udpsrc port="rtp_recv_port, -- do-timestamp=true
' ! "application/x-rtp,media=audio,payload=8,clock-rate=8000,encoding-name=PCMA,channels=1" ',
" ! rtpbin.recv_rtp_sink_0",
"",
"rtpbin. ",
" ! rtppcmadepay",
" ! decodebin ",
' ! "audio/x-raw-int, width=16, depth=16, rate=8000, channels=1" ',
" ! volume volume=5.0 ",
" ! autoaudiosink sync=false",
"",
"autoaudiosrc ",
" ! audioconvert ",
' ! "audio/x-raw-int,width=16,depth=16,rate=8000,channels=1" ',
" ! alawenc ",
" ! rtppcmapay perfect-rtptime=true mtu=2000",
" ! rtpbin.send_rtp_sink_1",
"",
"rtpbin.send_rtp_src_1 ",
" ! audioconvert",
" ! audioresample",
" ! udpsink port="rtp_send_port "host="ipaddr
pipeline "> pipe.out"
後の行をコメントアウトすると
" ! autoaudiosink sync=false",
受信専用部分は問題なく機能します。ただし、これらの行をそのままにしておくと、次のエラーが発生します。
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2582): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming task paused, reason not-linked (-1)
では、突然リンクが解除されたのは何ですか?エラーがautoaudiosrcの部分にあるかどうかはわかりますが、突然udpsrcセクションに表示されますか?
助けの提案、誰か?
(FWIW)このパーツが機能するようになったら、戻ってrtcpパーツまたはパイプラインを追加します。