2

I'm running Ubuntu 10.10, I successfully installed Qt 4.7.3 SDK (using qt online installer, not from packages) and compiled QtMobility multimedia module so my little test code compile:

QMediaPlayer    player;

player.setMedia(QUrl::fromLocalFile("/home/username/test.mp3"));
player.setVolume(100);
player.play();

I'm building this code using QtCreator and have the following lines in my .pro file:

CONFIG += console mobility
MOBILITY += multimedia

Everything is fine until i run the binary, which gives me this nice error:

GStreamer; Unable to play - ""

I tried different path (relative, absolute) and formats (mp3, wav, ogg) but nothing changed. Then i tried to compile the QtMobility demo "player" application to check the result, and i got exactly the same error. So i found the problem does not come from my code.

And now i need some help to find out where does it comes from as i can't find on google anything talking about this kind of problem.

Thanks for your help!

Adrien Rey-Jarthon
  • 1,015
  • 2
  • 9
  • 22
  • Can you play MP3s outside of Qt using some other application (mpg321, mplayer, amarok, Rhythmbox, etc)? – Casey Apr 25 '11 at 16:58
  • @Casey: Yes, i use rhythmbox every day to play mp3, ogg, aac. And mplayer for exotic formats. I think i have all the gstreamer plugins avilables from packages. The problem looks like Qt can't manage to give the filename to gstreamer, that's why it says: Unable to play - “” (there should be a filename here) – Adrien Rey-Jarthon Apr 26 '11 at 05:59
  • You could run your app using GST_DEBUG="play*:4" ./myapp 2>debug.log and check if you can find the uri string in the log (to narrow down, where it get lost). – ensonic May 18 '11 at 13:56

2 Answers2

1

I finally dropped high level playback for lower level one (using QAudioOutput) and ffmpeg for decoding, which is more portable.

Adrien Rey-Jarthon
  • 1,015
  • 2
  • 9
  • 22
0

My guess is that you don't have the necessary codec (Gstreamer plugin) installed. So I'd recommend to make sure that:

1) Development files for GStreamer are installed

2) All the necessary GStreamer plugins are installed

Hope this helps.

Barbaris
  • 1,256
  • 7
  • 7
  • Yes development files for gstreamer are installed because QtMobility require them and i had to install them all in order to build it successfully. And i thinks so for plugins, as i mentioned in my messages above, i think the problem comes when Qt transmit the filename to gstreamer, as gstreamer does not seams to know which file to read. – Adrien Rey-Jarthon Apr 26 '11 at 06:02