5

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?

user3542154
  • 91
  • 1
  • 2
  • 8
  • Try to launch the same file using gst-launch -v playbin first. This will give the exact decoder used. There is one plugin called "mad" for mp3 I guess, that might be missing. Try locating it using gst-inspect – user2618142 Sep 29 '14 at 12:21
  • I ran gst-launch -v playbin song.mp3 and got `Setting pipeline to PAUSED ... ERROR: Pipeline doesn't want to pause. ERROR: from element /GstPlayBin:playbin0: No URI specified to play from. Additional debug info: gstplaybasebin.c(1655): gen_source_element (): /GstPlayBin:playbin0 Setting pipeline to NULL ... Freeing pipeline ... ` and i ran `gst-inspect mad` and got `No such element or plugin 'mad'` – user3542154 Sep 29 '14 at 13:11
  • There is now a Qt-specific library for GStreamer named, not surprisingly, `QtGStreamer`: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/index.html. It is available in the Ubuntu and Debian Jessie repositories under the name `qtgstreamer` – Carlton Feb 15 '17 at 19:24

4 Answers4

5

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

Menuka Ishan
  • 5,164
  • 3
  • 50
  • 66
  • It seems [that PPA](https://launchpad.net/~mc3man/+archive/ubuntu/gstffmpeg-keep) doesn't have `gstreamer0.10-plugins-ugly`. – frogatto Dec 17 '16 at 05:58
  • It seems they have remove `gstreamer0.10-plugins-ugly` after 14.04 http://packages.ubuntu.com/search?keywords=gstreamer0.10-plugins-ugly but you can try new version of it http://www.linuxfromscratch.org/blfs/view/cvs/multimedia/gst10-plugins-ugly.html – Menuka Ishan Dec 19 '16 at 02:59
  • @HiI'mFrogatto MayBe, Its => `gstreamer1.0-plugins-bad` for you – Mr. Pundir Mar 29 '17 at 16:22
1

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
Larpon
  • 812
  • 6
  • 19
0

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.

Sajib Khan
  • 22,878
  • 9
  • 63
  • 73
0

On Ubuntu20.04, I solved this problem by:

sudo apt-get install gstreamer1.0-libav
zhiyi
  • 111
  • 1
  • 9