使用GStreamer时音乐可视化错误

1 投票
2 回答
1629 浏览
提问于 2025-04-15 19:45

你好,我正在尝试使用以下命令在gstreamer中可视化一个音乐文件:

gst-launch filesrc location=file.mp3 ! decodebin ! audioconvert ! 
tee name=myT myT. ! queue ! autoaudiosink myT. ! queue ! goom ! 
colorspace ! autovideosink

但是我遇到了这个错误:“可能是时间戳有问题,或者这台电脑太慢了。”

Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstAudioSinkClock
WARNING: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstDshowVideoSink:autovideosink0-actual-sink-dshowvideo: A lot of buffers are being dropped.
Additional debug info:
..\Source\gstreamer\libs\gst\base\gstbasesink.c(2572): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstDshowVideoSink:autovideosink0-actual-sink-dshowvideo:
There may be a timestamping problem, or this computer is too slow.
ERROR: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0

我猜这可能和线程有关,所以我尝试了以下命令:

gst-launch filesrc location=file.mp3 ! decodebin ! audioconvert ! tee name=myT 
{ ! queue ! autoaudiosink } { tee. ! queue ! goom ! colorspace ! autovideosink }

但接着出现了以下链接错误:

** (gst-launch-0.10:5308): WARNING **: Trying to connect elements that don't share a common ancestor: tee and queue1
0:00:00.125000000  5308   003342F0 ERROR           GST_PIPELINE grammar.tab.c:656:gst_parse_perform_link: could not link tee to queue1
WARNING: erroneous pipeline: could not link tee to queue1

有人能告诉我哪里出错了吗?谢谢

2 个回答

0

对于 可能存在时间戳问题,或者这台电脑太慢了。 错误,可以尝试使用 sync=false,像这样:

`gst-launch filesrc location=file.mp3 ! decodebin ! audioconvert ! tee name=myT myT. ! queue ! autoaudiosink myT. ! queue ! goom ! colorspace ! autovideosink sync=false`

或者你可能需要在Tee的两个输出端都尝试一下,像这样:

`gst-launch filesrc location=file.mp3 ! decodebin ! audioconvert ! tee name=myT myT. ! queue ! autoaudiosink sync=false myT. ! queue ! goom ! colorspace ! autovideosink sync=false`

我还注意到,如果把 autovideosink 替换成 xvimagesink 或者 ximagesink,时间戳的问题似乎就解决了。

1

我不能给你确切的答案,因为我没有安装Windows。

为了调试这个问题,你可以使用你的第一个管道(在Linux上可以工作)。在使用gst-launch时加上-v这个参数,并把元素identity放在autovideosink之前。这样会打印出通过identity元素的数据缓冲区信息,看看有没有什么奇怪的地方。

你也可以试试用directdrawsink代替autovideosink。还有一个测试我会做的是用audiotestsrc来生成音频。

记住,如果你发现了bug,可以在gnome bugzilla上提交一个bug报告,这样GStreamer的开发者就会知道有问题。你甚至可以自己修复它,然后提交一个补丁。

撰写回答