0

I have a project built using Qt5 which has to play a video. Just like in the videowidget sample code.

I've followed these instructions to build qt5 on my Pi. And it went just fine. But when I try to run any qt program that uses QMediaPlayer, I get the error message:

defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"

Which means I don't have a backend to play the video, right? Is there any one that I can use which will with Qt, like ffmpeg? And how can I get it to work? Specially for h264 videos.

I've tried to install gstreamer as is told on this link, but it's not working. Will I have to rebuild the entire qt5 again?

P.S.: I have the raspberry pi 1 model B with raspbian installed.

Edit: As mentioned by Greenflow, I checked the ./configure log and saw that the GStreamer was compiled in, but the video apps are still not working...

The message on the log was like this:

GStreamer .............. yes (0.10)

And the message on Greenflow's log was like this:

GStreamer .............. yes (1.0)

Clearly it's another version of GStreamer, but is it the problem?

I've also found this post which says QtMultimedia on the Pi is rather useless, but the post is from 2013, so I'm not sure if it's really relevant. I'd like to have this app playing hardware accelerated videos on my Raspberry Pi, but I'm almost dropping the idea.

Anyways, thanks Greenflow for the head start.

Edit 2: Found this thread on the Qtcentre. Damn, this thing is not going to be easy to solve, I guess...

Community
  • 1
  • 1
Mauker
  • 11,237
  • 7
  • 58
  • 76
  • Yes, I do. The latest version. – Mauker May 01 '15 at 13:56
  • 1
    When you compiled Qt, did you check the summary before 'make'? Should have told you if gstreamer was compiled in. gstreamer 1.0 works fine for me. If it was compiled in, you probably only need to install missing gstreamer modules. If not... have fun recompiling qt. Btw... much more convenient to setup a cross compiler than compiling on RPi itself. – Greenflow May 01 '15 at 14:33
  • Well, I saved the log and I'll look for it there then. If it was compiled in, how can I know which modules are missing? – Mauker May 03 '15 at 01:28
  • Summary after ./configure: GStreamer .............. yes (1.0) – Greenflow May 03 '15 at 08:17
  • Well, I checked and it was like this: GStreamer .............. yes (0.10). Perhaps it's the version? Now what? – Mauker May 04 '15 at 14:42
  • Good enough. Means that you don't need to recompile your Qt... this I can say for sure. I guess you just need to install the correct gstreamer packages. And this really is only speculation. Don't ask me which packages. Always worked for me... means I have not much experience to trouble shoot. – Greenflow May 04 '15 at 15:26
  • Well, that's a start. I've edited the post with some new info, but I'm still not sure how I can solve this, or if it's really going to work as I expect... Can I ask you how did you compile your Qt? Perhaps I can find which package is missing and try to install it. – Mauker May 05 '15 at 20:29
  • Gstreamer 0.1 or 1.0 makes not much of a difference. At least not at first glance. 1.0 has better hardware support. But I suppose that's a detail to be solved when you got it running at all. This is how I compiled my Qt5... but I did a cross compile: – Greenflow May 05 '15 at 22:01
  • ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/home/greenflow/x-tools2/bin/arm-linux-gnueabihf- -xplatform linux-arm-gnueabi-g++ -sysro ot /home/greenflow/rasp -opensource -confirm-license -optimized-qmake -release -make libs -prefix /usr/local/qt5pi -v -libinput -linuxfb -directfb -xcb -fontconfig -tslib -evdev -iconv -xinput2 -xkbcommon-evdev -eglfs -icu -qt-pcre -lpthread -system-sqlite -no-sql-sqlite2 -gstreamer 1.0 -reduce-exports – Greenflow May 05 '15 at 22:02
  • Most of the stuff would have been autodetected...but by specifying everything explicitly I get an error message when I overlooked a dependency. – Greenflow May 05 '15 at 22:03
  • I'll try to check the file again to see if it found any errors. Damn, this is getting annoying haha. Anyways, thanks again for the help. Can you provide me a link on how can I cross compile for the Raspberry? Or should I create another question for this? – Mauker May 05 '15 at 23:54
  • 1
    I prepare a question/self answer for cross compiling Qt on Raspian. Seems to be of general interest. And.... annoying? Try to compile Qt5 on Windows with MinGW... **then** you know what's annoying. :-D – Greenflow May 06 '15 at 08:13
  • 1
    I started how to create the necessay cross-toolchain for Raspberry Pi here: http://stackoverflow.com/questions/30072209/how-can-i-create-a-modern-toolchain-for-the-use-with-the-raspberry-pi-1/30072864#30072864. See if you have any problems with this step, so if I revise my answer, if necessary. – Greenflow May 06 '15 at 09:37
  • Well, I've ran to this problem again on rasp2... More details here: http://raspberrypi.stackexchange.com/questions/31666/is-it-possible-to-install-qt5-on-ubuntu-mate-or-raspbian-with-raspberry-pi-2 This time I couldn't even compile Qt properly! I'm really almost dropping this idea. – Mauker May 18 '15 at 20:38
  • I don't have an RPi 2. But AFAIK it should be easier to compile Qt5 on RPi2 since you don't need to create your own toolchain. I think Debian has a working on in its repository. But... as I said: No own experiences with RPi2. – Greenflow May 18 '15 at 21:26
  • Yes, Debian does have it on its repository... but on the unstable branch. I could successfully do an apt-get install on the qt core. But not on the other modules... So it wasn't good enough for me. (More details on the question I've left up there). Because I also need QtMultimedia, and I need that to work on hardware accelerated decoding... About the rasp2, I found this: https://wiki.qt.io/Native_Build_of_Qt_5.4.1_on_a_Raspberry_Pi but it didn't work as I expected... Perhaps cross-compiling is the best way... – Mauker May 19 '15 at 05:14

1 Answers1

0

sudo apt-get install libqt5multimedia-plugins solved this for me.