gst-launch与tcpserversink不工作。

时间:2021-12-24 07:02:59

I am trying to user gst-launch to stream mp3 audio over tcp, this is what I am trying :

我正在尝试用gst-launch来传输mp3音频的tcp,这是我正在尝试的:

$ gst-launch-0.10 filesrc location="/path/to/file.mp3" ! tcpserversink host=0.0.0.0 port=3000

but it doesn't work the output is as follow :

但它不工作输出如下:

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 ..

Whats the problem where I am going wrong?

我哪里出错了?

I did lots of search on internet but didn't found the right document how to use gst-launch properly. if anyone can please point me to right doc or tell me how to use it it will great.

我在网上做了很多搜索,但是没有找到正确的文档如何正确使用gst-launch。如果有人能告诉我正确的医生或告诉我如何使用它,它将是伟大的。

1 个解决方案

#1


1  

tcpserversink complains about missing caps on its sink pad:

tcpserversink抱怨它的接收器上没有盖子:

Received first buffer without caps set

This is because tcpserversink wants to know what it sends.
One way to tell it would be to manually decode and re-encode the stream:

这是因为tcpserversink想知道它发送了什么。一种方法是手动解码和重新编码流:

gst-launch-0.10 filesrc location="/path/to/file.mp3" ! mad ! audioconvert ! lame ! tcpserversink host=0.0.0.0 port=3000

But that's just waste of CPU power.
There's an element called mpegaudioparse that (apart from some other stuff) figures out the details of the mpeg stream and sets its output caps accordingly. By simply putting it between your filesrc and the tcpserversink you'll end up with a working pipeline:

但这只是浪费CPU的能力。有一个名为mpegaudioparse的元素(除了一些其他的东西),计算出mpeg流的详细信息,并据此设置输出上限。只要把它放在文件rc和tcpserversink之间,你就会得到一个工作管道:

$ gst-launch-0.10 filesrc location="/path/to/file.mp3" ! mpegaudioparse ! tcpserversink host=0.0.0.0 port=3000

#1


1  

tcpserversink complains about missing caps on its sink pad:

tcpserversink抱怨它的接收器上没有盖子:

Received first buffer without caps set

This is because tcpserversink wants to know what it sends.
One way to tell it would be to manually decode and re-encode the stream:

这是因为tcpserversink想知道它发送了什么。一种方法是手动解码和重新编码流:

gst-launch-0.10 filesrc location="/path/to/file.mp3" ! mad ! audioconvert ! lame ! tcpserversink host=0.0.0.0 port=3000

But that's just waste of CPU power.
There's an element called mpegaudioparse that (apart from some other stuff) figures out the details of the mpeg stream and sets its output caps accordingly. By simply putting it between your filesrc and the tcpserversink you'll end up with a working pipeline:

但这只是浪费CPU的能力。有一个名为mpegaudioparse的元素(除了一些其他的东西),计算出mpeg流的详细信息,并据此设置输出上限。只要把它放在文件rc和tcpserversink之间,你就会得到一个工作管道:

$ gst-launch-0.10 filesrc location="/path/to/file.mp3" ! mpegaudioparse ! tcpserversink host=0.0.0.0 port=3000