0

我正在尝试用户 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。如果有人可以请指点我正确的文档或告诉我如何使用它会很棒。

4

1 回答 1

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能力。
有一个叫做 that 的元素mpegaudioparse(除了一些其他的东西)计算出 mpeg 流的细节并相应地设置它的输出上限。通过简单地将它放在你filesrctcpserversink你之间,你最终会得到一个工作管道:

$ gst-launch-0.10 filesrc location="/path/to/file.mp3" ! mpegaudioparse ! tcpserversink host=0.0.0.0 port=3000
于 2012-12-13T02:54:59.640 回答