linuxqtqt4gstreamerqt-mobility

QtMultimedia failed to play audio on linux: GStreamer; Unable to play - ""


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!


Solution

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