我的语法分析有什么问题?它无法正确解析opus caps(但不是speex)并导致它无法正常工作任何人都知道,在哪里我必须添加更多的\或/或“或”符号才能使其有效大写?
$ gst-launch-0.10 -v gstrtpbin name=rtpbin latency=100 udpsrc caps="application/x-rtp, media=(string)audio, clock-rate=(int)48000, encoding-name=(string)X-GST-OPUS-DRAFT-SPITTKA-00, caps=(string)\"audio/x-opus\\,\\ multistream\\=\\(boolean\\)false\\,\\ streamheader\\=\\(buffer\\)\\<\\ 4f707573486561640101000080bb0000000000\\,\\ 4f707573546167731e000000456e636f6465642077697468204753747265616d6572204f707573656e63010000001a0000004445534352495054494f4e3d617564696f74657374207761766501\\ \\>\", ssrc=(uint)3090172512, payload=(int)96, clock-base=(uint)4268257583, seqnum-base=(uint)10001" port=5002 ! rtpbin.recv_rtp_sink_1 rtpbin. ! rtpopusdepay ! opusdec ! audioconvert ! audioresample ! alsasink device=2 name=uudpsink0 udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 rtpbin.send_rtcp_src_1 ! udpsink port=5007 host=%s sync=false async=false
(gst-plugin-scanner:25672): GStreamer-WARNING **: Failed to load plugin '/usr/lib/gstreamer-0.10/libgstsimsyn.so': /usr/lib/gstreamer-0.10/libgstsimsyn.so: undefined symbol: gst_controller_sync_values
(gst-plugin-scanner:25672): GStreamer-WARNING **: Failed to load plugin '/usr/lib/gstreamer-0.10/libgstaudiodelay.so': /usr/lib/gstreamer-0.10/libgstaudiodelay.so: undefined symbol: gst_base_transform_set_gap_aware
(gst-plugin-scanner:25672): GStreamer-WARNING **: Failed to load plugin '/usr/lib/gstreamer-0.10/libgstbml.so': /usr/lib/gstreamer-0.10/libgstbml.so: undefined symbol: gst_base_src_set_format
WARNING: erroneous pipeline: could not set property "caps" in element "udpsrc0" to "application/x-rtp, media=(string)audio, clock-rate=(int)48000, encoding-name=(string)X-GST-OPUS-DRAFT-SPITTKA-00, caps=(string)"audio/x-opus\,\\ multistream\=\(boolean\)false\,\\ streamheader\=\(buffer\)\<\\ 4f707573486561640101000080bb0000000000\,\\ 4f707573546167731e000000456e636f6465642077697468204753747265616d6572204f707573656e63010000001a0000004445534352495054494f4e3d617564696f74657374207761766501\\ \>", ssrc=(uint)3090172512, payload=(int)96, clock-base=(uint)4268257583, seqnum-base=(uint)10001"
最佳答案
我认为不需要特别的逃跑。如果您的管道是正确的,那么这应该可以工作:
gst-launch-0.10 -v gstrtpbin name=rtpbin latency=100 udpsrc caps="application/x-rtp, media=(string)audio, clock-rate=(int)48000, encoding-name=(string)X-GST-OPUS-DRAFT-SPITTKA-00, caps=(string)audio/x-opus, multistream=(boolean)false, streamheader=(buffer)<4f707573486561640101000080bb0000000000,4f707573546167731e000000456e636f6465642077697468204753747265616d6572204f707573656e63010000001a0000004445534352495054494f4e3d617564696f74657374207761766501>, ssrc=(uint)3090172512, payload=(int)96, clock-base=(uint)4268257583, seqnum-base=(uint)10001" port=5002 ! rtpbin.recv_rtp_sink_1 rtpbin. ! rtpopusdepay ! opusdec ! audioconvert ! audioresample ! alsasink device=2 name=uudpsink0 udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 rtpbin.send_rtcp_src_1 ! udpsink port=5007 host=%s sync=false async=false
如果需要处理bash可能要解释的特殊字符,请将
caps="..."
更改为caps='...'
。下面是一个笨拙的python版本:
import subprocess
args=[ 'gst-launch-0.10',
'-v',
'gstrtpbin',
'name=rtpbin',
'latency=100',
'udpsrc',
'caps="application/x-rtp, media=(string)audio, clock-rate=(int)48000, encoding-name=(string)X-GST-OPUS-DRAFT-SPITTKA-00, caps=(string)audio/x-opus, multistream=(boolean)false, streamheader=(buffer)<4f707573486561640101000080bb0000000000,4f707573546167731e000000456e636f6465642077697468204753747265616d6572204f707573656e63010000001a0000004445534352495054494f4e3d617564696f74657374207761766501>, ssrc=(uint)3090172512, payload=(int)96, clock-base=(uint)4268257583, seqnum-base=(uint)10001"',
'port=5002',
'!',
'rtpbin.recv_rtp_sink_1',
'rtpbin.',
'!',
'rtpopusdepay',
'!',
'opusdec',
'!',
'audioconvert',
'!',
'audioresample',
'!',
'alsasink',
'device=2',
'name=uudpsink0',
'udpsrc',
'port=5003',
'!',
'rtpbin.recv_rtcp_sink_1',
'rtpbin.send_rtcp_src_1',
'!',
'udpsink',
'port=5007',
'host=%s',
'sync=false',
'async=false',
]
child = subprocess.Popen(args, stdout=subprocess.PIPE)
streamdata = child.communicate()[0] # streamdata will contain output of gst-launch-0.10
rc = child.returncode # rc will contain the returncode of gst-launch-0.10
print streamdata
print "\nprocess returned %d" %(rc)
我认为您最好为gstreamer找到一个好的python模块,而不是使用subprocess或类似的方法。
希望这有帮助!
关于linux - Gstreamer-Opus Caps分析错误,有人知道如何解决?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23356609/