Friday, December 26, 2014

Binaries for Hardware Accelerated Qt Multimedia Backend on Raspberry Pi

As someone still have troubles building PiOmxTextures, I prepared a little package that contains the binaries needed to make it run and have a look. In the past I tried to provide an entire firmware, but it was large to upload and not very comfortable to update. This package only contains:

  • PiOmxTextures.tar: library to provide the playback capabilities, including ffmpeg 2.5.
  • Qt-rasp-5.4.0.tar: the entire tree of Qt 5.4.0 binaries built for Raspberry Pi (firmware ba43047, rpath is set to /usr/local/Qt-rasp-5.4.0).
  • Qt-rasp-5.4.0_host.tar: the utility to be used on the host when cross-building (built for x86 Kubuntu 13.10).
Current version of the package is 4.3.0: download.

To have a quick look, just place Qt-rasp-5.4.0 in /usr/local into your Pi, then place PiOmxTextures somewhere and add it to the runtime library path. Now you can test running qmlvideo or qmlvideofx from the Qt Multimedia examples. Something similar to this should come up: 
Bye! ;-)

36 comments:

  1. This is great thank you very much for your efforts, sorry for the dumb question but could you elaborate on how I "add it to the runtime library path"??

    ReplyDelete
    Replies
    1. http://www.eyrie.org/~eagle/notes/rpath.html

      Delete
    2. Thanks for this, works perfectly for me now.

      Delete
  2. Thanks man! Thats a nice Xmas gift

    ReplyDelete
  3. Should I use these steps ("http://thebugfreeblog.blogspot.com.br/2013/03/raspberry-pi-wheezy-image-with-qt-and.html) to setup QT properly?

    ReplyDelete
    Replies
    1. I don't know what you mean by setup. Do you want to run something on the Pi or to build something else with Qt?

      Delete
    2. I want to setup QT in my Ubuntu/x86 to cross compile with the provided tools (Qt-rasp-5.4.0_host.tar)

      QT is refusing the provided qmake when I add it on "Options > Build & Run > Qt Versions".

      Qmake not executable: "The qmake executable /usr/local/Qt5.4.0/bin/qmake could not be added. Cannot start /usr/local/Qt5.4.0/bin/qmake: No such file or directory"

      I own the file and it has the execute flag set...

      Thanks, Luca.

      Delete
    3. Can you run it from the command line? It is built for x86 on Kubuntu 13.10. Maybe your system is not compatible.

      Delete
    4. Can't run on command line as well: "No such file or drectory".

      I'm on Lubuntu x86_64... nothing too fancy.

      Delete
    5. http://askubuntu.com/questions/133389/no-such-file-or-directory-but-the-file-exists

      Delete
    6. Nailed it! Thanks, Luca!!!

      Delete
  4. hello dear luca ...i am working on my raspberry pi b+ and i need play mp3 music with qtmultimedia (i have my aplication on ubuntu 14.04 64bits and Qt 5.3.2 but i need its on my raspberry ) i tried with some tutorials but i can complilate qt on my rapberry , i dont know for where start .. can you help me how i can compilated qt with qtmultimedia ??? i am a begginer

    ReplyDelete
    Replies
    1. Playing music on Pi should be very simple. Just build with gstreamer support and you should be done.

      Delete
  5. i can do that http://thebugfreeblog.blogspot.it/2012/11/bring-up-qt-50-on-raspberry-pi.html ?????

    ReplyDelete
    Replies
    1. Yes, same way. But as you can see that build was not supporting gstreamer. You need to also add gstreamer libs and headers to the sysroot and then check Qt configure to ensure the build will include gstreamer support. Last time I did that was several months ago, but may still work.

      Delete
  6. So you're using the lib by itself? Without the Qt plugin?

    ReplyDelete
  7. Ok, Qt 5.4, but are you using the Qt backend plugin or libPiOmxTextures directly? What code do you use to play the video?

    ReplyDelete
  8. I suggest you use the Qt backend provided according to the articles on the blog instead. Using the library directly is pretty outdated.

    ReplyDelete
  9. I would like to use this without qtquick, but that is currently not possible.
    Could this be changed somehow?

    ReplyDelete
    Replies
    1. It depends on where you want to use it.

      Delete
    2. I created an app that has a QGraphicsView with in it a QVideoItem to play the video. That did not work.

      Currently I'm rewriting that app to use QML, which goes better than expected (I had no experience with QML yet) so maybe its not a problem after all.

      Delete
  10. Hi Luca

    I had been trying to use these binaries. I cross-compile succesfully with Qt Creator the qmlvideo example, and it executes but after I select the file and click a Video mode I got the following error:

    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
    qml: [qmlvideo] VideoItem.onError error 5 errorString The QMediaPlayer object does not have a valid service
    qml: [qmlvideo] Content.onFatalError

    And the video doesn't reproduce.

    I have followed the instructions and started in the clean distro of raspbian after installing all the libraries you mention in the older posts.

    Can you help me figuring out what the problem is?
    Thanks in advance.

    ReplyDelete
  11. Hi again Luca

    Yesterday I continued the cross-compiling of Qt5.3.2, following your instructions to get the openmaxil backend and add it to qtmultimedia, which I compiled and installed again.

    Now when I execute the example qmlvideo i don't get the error mentioned in the last post, but the video is played at a very low framerate, as if it where not hardware accelerated.

    Any ideas about this?

    ReplyDelete
    Replies
    1. Probably not using the correct plugin.

      Delete
    2. I forgot to mention that Qt Creator displays the following messages as Application output...

      Cannot connect to server socket err = No such file or directory
      Cannot connect to server request channel
      jack server is not running or cannot be started
      Warning: "A lot of buffers are being dropped."

      Delete
    3. That confirms you're not using this plugin. You're probably using the gstreamer plugin.

      Delete
    4. Thanks for your reply Luca... I'm newbie at all this...

      Where or How do I select the Plugin that uses qtmultimedia?

      When I compiled Qtmultimedia (after applying the patch) it found and compiled the Openmaxil Plugin, so I assumed it would use it from now on.
      Do I have to make some changes in qmlvideo? Same thing happens if I try to execute POCPlayer

      Delete
    5. Remove any media plugin but PiOmxTextures.

      Delete
    6. IIRC, I removed the libgstmediaplayer.so from the qt/plugins/mediaservice but now I have the same error than before

      defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
      qml: [qmlvideo] VideoItem.onError error 5 errorString The QMediaPlayer object does not have a valid service
      qml: [qmlvideo] Content.onFatalError

      I guess this is because the application is still looking for the gstreamer plugin...
      When you say "Remove any media player but PiOmxTextures" do you mean before compiling qtmultimedia (after the patch)?

      I'm really sorry if I'm asking nonsense for you, but I'm lost right now... Is there any other way to chat with you?

      Delete
    7. Got It!!!! I had the library path wrong....

      Thanks a Lot Luca!

      Delete
  12. Hi, All!!!
    Please help me! I try full week for create app with QT\QML with video output on Pi and no luck. :((((
    I can compile the QML without video plugin (using cross-compile as describe this http://qt-project.org/wiki/RaspberryPi_Beginners_guide) and all done, but if I it try using QTMultimeda I get error: "defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer".

    By reason of I try build piOmxTexture. But I can't this. (((
    Could you explain step-by-step how can I do it?

    ReplyDelete
    Replies
    1. Hi Yuriy

      First than all: Did you compile all Qt or just qtbase? The guide you mention tell you to compile qtbase first and then the other modules. Among the other modules you MUST compile qtmultimedia. Or just take the easy way and compile all qt (just do the configure, make and makeinstall steps on the qt folder)

      In the other hand: If you use correctly the binaries of this post you don't have to compile Qt and it will already have PiOmxTextures
      - Get sure of adding the library paths ( Explained here) for the folders you get from Qt-rasp-5.4.0.tar and PiOmxTextures.tar
      - The folder compressed in Qt-rasp-5.4.0_host.tar must be placed at /usr/local/ in your host machine
      - Get sure of having the necessary libraries.

      Delete
  13. Hi Luca,just wondering, what is the downside of directly compiling on the raspberry ? (if there is any), or is it just more convenient to code from a distant platform and cross compile the application.

    ReplyDelete