How to fix gstreamer error in Qt5?

半城伤御伤魂 提交于 2019-12-21 15:44:30

问题


I want to create a small mp3 player as a toy project so started with Qt for the GUI. When I try to play an mp3 file i get this error.

Warning: "No decoder available for type 'audio/mpeg, mpegversion=(int)1, 
mpegaudioversion=(int)1, layer=(int)3, rate=(int)44100, channels=(int)2,
parsed=(boolean)true'." 
Error: "Your GStreamer installation is missing a plug-in." 

I installed gstreamer and it's plugins after googling around

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

But I still get the error. How do I fix it?


回答1:


I had the same problem. After using below code it fixed.

sudo add-apt-repository ppa:mc3man/gstffmpeg-keep
sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg
sudo apt-get install gstreamer0.10-plugins-ugly

Qt Creator 3.4.2 Ubuntu 14.04




回答2:


I tried digging a little into this and according to this thread in the Qt forums the issue seems to be that the QtMultimedia module is still using GStreamer 0.10 as a backend - and from that it needs the gstreamer-0.10-ffmpeg plugin which is not available in some distros anymore due to the move to libav.

If you're using a flavour of Ubuntu you can try installing gstreamer-0.10-ffmpeg from Doug McMahon's ppa:

sudo add-apt-repository ppa:mc3man/gstffmpeg-keep
sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg



回答3:


On Debian8, QT5.7, I'm executing this:

sudo apt-get install gstreamer1.0*
sudo apt-get install gstreamer0.10*

this is not the best way, but it works.

Regards.



来源:https://stackoverflow.com/questions/26099139/how-to-fix-gstreamer-error-in-qt5

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!