如何修复“警告:错误的管道:没有元素 "mad"”

How to fix `WARNING: erroneous pipeline: no element "mad"`

我是 运行 gstreamer 命令,使用以下命令从终端播放 mp3:

gst-launch-1.0 -v filesrc location=/home/user/songs/song.mp3 !疯狂的 !音频转换!音频重采样! autoaudiosink

我收到以下错误消息,mp3 无法播放

警告:错误的管道:没有元素“mad”

我已经使用以下命令安装了 gstreamer 插件:

sudo apt-get install gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav

安装成功,但错误依旧。

另外我检查了mad插件是否被列入黑名单使用 gst-inspect-1.0 且未列入黑名单。

我清除了~/.cache/gstreamer-1.0/registry.*.bin.

下面的命令在 ubuntu 18.04

中失败

gst-launch-1.0 -v filesrc location=/home/user/songs/song.mp3 !疯狂的 !音频转换!音频重采样!自动音频接收器

下面的命令有效,但我想使用“mad:而不是”decodebin:

gst-launch-1.0 -v filesrc location=/home/user/songs/song.mp3 !解码箱!音频转换!音频重采样! autoaudiosink

来自 GStreamer 的 1.12 插件删除更新日志:

The mad mp1/mp2/mp3 decoder plugin was removed from gst-plugins-ugly, as libmad is GPL licensed, has been unmaintained for a very long time, and there are better alternatives available. Use the mpg123audiodec element from the mpg123 plugin in gst-plugins-ugly instead, or avdec_mp3 from the gst-libav module which wraps the ffmpeg library. We expect that we will be able to move mp3 decoding to gst-plugins-good in the next cycle seeing that most patents around mp3 have expired recently or are about to expire.