我正在尝试使用gst-launch来通过tcp传输mp3音频,这就是我正在尝试的:
$ gst-launch-0.10 filesrc location="/path/to/file.mp3" ! tcpserversink host=0.0.0.0 port=3000
但输出不起作用如下:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstTCPServerSink:tcpserversink0: Internal GStreamer error: negotiation problem. Please file a bug at http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer.
Additional debug info:
gstmultifdsink.c(2700): gst_multi_fd_sink_render (): /GstPipeline:pipeline0/GstTCPServerSink:tcpserversink0:
Received first buffer without caps set
Execution ended after 94657 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ..
我出错的问题是什么?
我在互联网上进行了大量搜索,但没有找到正确的文档如何正确使用gst-launch。如果有人可以请我指向正确的文件或告诉我如何使用它会很棒。
答案 0 :(得分:1)
tcpserversink
抱怨其水槽上缺少帽子:
Received first buffer without caps set
这是因为tcpserversink想知道它发送了什么 告诉它的一种方法是手动解码和重新编码流:
gst-launch-0.10 filesrc location="/path/to/file.mp3" ! mad ! audioconvert ! lame ! tcpserversink host=0.0.0.0 port=3000
但这只是浪费CPU能力
有一个名为mpegaudioparse
的元素(除了其他一些东西之外)计算出mpeg流的细节并相应地设置其输出上限。只需将其放在filesrc
和tcpserversink
之间,您最终就会得到一个有效的管道:
$ gst-launch-0.10 filesrc location="/path/to/file.mp3" ! mpegaudioparse ! tcpserversink host=0.0.0.0 port=3000