gstreamer:没有可用于“audio/x-wav”类型的解码器/找不到合适的插件
Posted
技术标签:
【中文标题】gstreamer:没有可用于“audio/x-wav”类型的解码器/找不到合适的插件【英文标题】:gstreamer: No decoder available for type 'audio/x-wav' / no suitable plugins found 【发布时间】:2021-02-02 13:28:29 【问题描述】:我开发了一个 Kivy Python 应用程序。它应该有声音效果。 在 Kivy 中,它很简单:
from kivy.core.audio import SoundLoader
...
def btn(self):
sound = SoundLoader.load("images/crunch.ogg")
if sound:
sound.play()
当这段代码运行时,我得到了:
[WARNING] [AudioGstplayer] b"No decoder available for type 'audio/x-wav'."
[ERROR ] [AudioGstplayer] b'Your GStreamer installation is missing a plug-in.'
[ERROR ] [AudioGstplayer] b'Internal data stream error.'
我了解到 Kivy 使用 GStreamer。所以我尝试在终端中使用它的基本实用程序播放声音:
(base) $ gst-play-1.0 -v PycharmProjects/dima_kivy/images/crunch.wav
Press 'k' to see a list of keyboard shortcuts.
Now playing /home/slv/PycharmProjects/dima_kivy/images/crunch.wav
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: ring-buffer-max-size = 0
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: buffer-size = -1
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: buffer-duration = -1
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: use-buffering = false
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: download = false
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: uri = file:///home/slv/PycharmProjects/dima_kivy/images/crunch.wav
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: connection-speed = 0
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: source = "\(GstFileSrc\)\ source"
/GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = audio/x-wav
WARNING No decoder available for type 'audio/x-wav'.
WARNING debug information: gsturidecodebin.c(921): unknown_type_cb (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0
ERROR Your GStreamer installation is missing a plug-in. for file:///home/slv/PycharmProjects/dima_kivy/images/crunch.wav
ERROR debug information: gsturidecodebin.c(988): no_more_pads_full (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0:
no suitable plugins found:
gstdecodebin2.c(4679): gst_decode_bin_expose (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
no suitable plugins found:
Missing decoder: WAV (audio/x-wav)
看来问题不在于 Kivy。 我在谷歌上搜索了安装帮助的人 - 我也是:
sudo apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
运行这个“全部安装”命令没有任何改变。行为保持不变。 我想有一些错误配置,但我什至不知道在哪里可以找到(
请帮忙!
我的系统:Ubuntu 20.04.1 LTS
gst-inspect-1.0 输出:
(base) slv@slv-ubuntu-comp:~$ gst-inspect-1.0 audio/x-wav
Factory Details:
Rank primary (256)
Name audio/x-wav
Caps audio/x-wav
Extensions wav
Plugin Details:
Name typefindfunctions
Description default typefind functions
Filename /home/slv/miniconda3/lib/gstreamer-1.0/libgsttypefindfunctions.so
Version 1.14.5
License LGPL
Source module gst-plugins-base
Source release date 2019-05-29
Binary package GStreamer Base Plug-ins source release
Origin URL Unknown package origin
(base) slv@slv-ubuntu-comp:~$ gst-inspect-1.0 | grep wav
typefindfunctions: application/x-shockwave-flash: swf, swfl
typefindfunctions: audio/x-wav: wav
typefindfunctions: audio/x-wavpack: wv, wvp
typefindfunctions: audio/x-wavpack-correction: wvc
【问题讨论】:
【参考方案1】:最后我发现当我使用 conda 安装时:
conda install kivy -c conda-forge
我不小心在 base conda 环境中创建了它,导致 gstreamer 的标准 Ubuntu 安装的系统路径被覆盖。 所以我通过在那个环境中删除 kivy 来修复我的 base conda 环境。 现在命令 gst-play-1.0 ~/PycharmProjects/dima_kivy/images/crunch.wav 运行良好,并在基本环境中产生预期的声音。
至于在我的开发环境中出现错误“gstreamer:没有可用于类型'audio/x-wav'的解码器/找不到合适的插件”,我通过安装 good 插件向前迈出了一步conda-forge 在我的开发环境中如下:
conda install gst-plugins-good -c conda-forge
它修复了标题中提到的错误,但我的电脑仍然没有声音。 对于这个新问题,我会向 *** 社区提出另一个问题。
【讨论】:
您好,您对这个问题有跟进吗?我遇到了同样的问题并以类似的方式解决了它,但我也没有音频。我确实有一个错误日志:GStreamer-CRITICAL **: 11:18:37.374: gst event set seqnum: assertion 'seqnum != GST SEQNUM INVALID' failed
但我猜解决这个问题不会解决我的问题:-)以上是关于gstreamer:没有可用于“audio/x-wav”类型的解码器/找不到合适的插件的主要内容,如果未能解决你的问题,请参考以下文章