# Raspberry Pi Wheezy Image With OpenMAX-based Multimedia Backend

Please take into consideration that this firmware is based on an old firmware and an old PiOmxTextures version.

As I see still someone has troubles building PiOmxTextures, I built a new image based on the Raspbian wheezy image released the 26th of July (http://www.raspberrypi.org/downloads). This version of the image also contains Qt version 5.1.2 (35fe76d9c343f98ec55c7cacd8c402e90d91ef38) and an OpenMAX-based Qt Multimedia plugin (PiOmxTextures). The available Qt modules are:

• qtbase
• qtscript
• qtxmlpatterns
• qtjsbackend
• qtdeclarative
• qtsensors
• qtquick1
• qtgraphicaleffects
• qtwebkit
• qtwayland
• qtsvg
• qtserialport
• qttolls
• qttranslations
• qtquickcontrols
• qtmultimedia
• qtimageformats

The mediaservice plugin installed is the openmaxil plugin (available here: https://github.com/carlonluca/pi). It is based on ffmpeg version 2.0 and that version of ffmpeg is statically built inside the PiOmxTextures library available in /usr/lib.
Note that the wayland module and the wayland and xkbcommon libs are available in the image, but I never tested those. Also, PiOmxTextures won’t work with wayland but only using the eglfs platform plugin.

## How to Test

Of course all this is experimental and if you seriously intend to use in production I suggest you start working on the sources in https://github.com/carlonluca/pi. I placed a build of the POCPlayer (sources are available in the same repository under tools/POCPlayer) in the home directory of the pi user. You can run it and see how it works:

./POCPlayer [video_file]

By pressing the “l” button, you can see the possible options. The POC player is experimental as well and it is entirely implemented in QML.
You can help improve and fix both PiOmxTextures lib and the openmaxil plugin by simply replacing libPiOmxTextures in /usr/lib and/or libopenmaxilmediaplayer.so in /usr/local/Qt-rasp-5.1.2/plugins/mediaservice.

## How to Use

Refer to Raspberry Pi Wheezy Image With Qt and Wayland Support for instructions on how to use. The procedure is almost identical. Then, you can simply build your QtMultimedia-based application and test.

## 78 thoughts on “Raspberry Pi Wheezy Image With OpenMAX-based Multimedia Backend”

1. This comment has been removed by a blog administrator.

2. Hi Luca

I'm getting the same error that mschorer reported…

ERROR: [0;31mFailed to get QQuickWindow. [0m

This happens everytime I instantiate a MediaPlayer component. Nevertheless It reproduces audio and video after 2 or 3 seconds…

3. Anonymous says:

torrent not work. help!

4. Yes, it is known. I never bothered to implement the fix. Search the blog, you should find another discussion about this.

5. Hello Luca,
tnx for the huge work. After some attemps I could finally play videos.
However there is some kind of tearing on the video that I couldn't solve and this issue does not appear playing the same with the repository version of omxplayer.
Is this a known issue?
My Qt version is 5.3.1 compiled with this configure command:
./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/raspbian-chroot/ -opensource -confirm-license -no-xcb -no-pch -no-icu -optimized-qmake -release -make libs -make tools -no-qml-debug -nomake tests -prefix /opt/Qt/5.3.1/arm/ and i'm using a chroot environment based on the Raspbian Wheezy released on raspberrypi.org on 2014-06-20.
Extra packeges installer are: libv4l-dev libboost-all-dev libssl-dev libpcre3-dev

6. Anonymous says:

Hello Luca, Thanks for the image. I downloaded it and write to SD. I tryed to start ./POCPlayer myvideo and it worked.
Now i want to setup qt cross-compile from Ubuntu. I use VMware player+ Ubuntu on them.
I installed last version qt creator. I copyed lib to opt/rpi/sysroot from raspberry. and libs from Qt-rasp-5.1.2.tar.bz2
1.Shoud i install any toolchane?
2. Now i add new compiler to QTCreator. I use this path(/usr/local/Qt-rasp-5.1.2/bin/qmake) to QMAKE What path i shoud use for compilator? my qt i installed into /opt/qt/

7. Anonymous says:

Thanks!!

8. I updated the link to the torrent. It is still available.

9. Anonymous says:

Can you post actual link to image?

10. Anonymous says:

i need it too

11. somebody have the image? really need it.. i tried to install Qt but always fail…

12. I don't have the image anymore but you can try: username: pi, password: raspberry.

14. I suppose there is something in PiOmxTextures about camera acquisition. But you'll have to work on that cause my Pi kernel used to crash by just plugging a camera in, so I couldn't work much on that. Now it seems to work better but work is not completed. Bye.

15. The gstreamer plugin is one of the plugins available. But the performance depends on the performance of gstreamer.
This image has nothing to do with acquisition from camera. What exactly do you mean by "suitable"? Acquiring from camera only requires v4l2, which can be installed from apt.

16. Anonymous says:

Hi Luca, I read through the introduction and comments, but I don't understand if QtMultimedia is build with gstreamer plugin. Anyway, I need to show a video stream provided by a /dev/video device, using v4l2 driver. Do you think your image is suitable for this?

17. As I already said: at the moment I have no interest in improving the color depth. It depends on how your env is set.

18. Anonymous says:

Just test the torrent ISO,

The POCPlayer still get the bad color depth 🙁 ( gradient in video are so ugly 🙁 )

19. Hi Luca,

I try to build qt on host machine for this image (PiOmxTextures).
I extract Qt-rasp-5.1.2.tar.bz2 and use qmake in Qt-rasp-5.1.2/bin/qmake.

.qmake.conf:1: Cannot find feature qt_build_config
Could not find qmake configuration file devices/linux-rasp-pi-g++.

When export QMAKEPATH=\$THIS/Qt-rasp-5.1.2/
I got error "Project ERROR: Cannot load qmodule.pri!"

Thanks a lot!, POCPlayer is work for me.

20. Anonymous says:

Hi Luca,

i keep getting the "Failed to get QQuickWindow." when running "POCPlayer test.h264".
Shouldn't this be fixed/removed?
Running off your wheezy image …

21. I only tested http once with an mp4 and it was "working". I never tested mpeg ts. ffmpeg should be able to demux and if h264 is inside it, then it might be played correctly. Did you try?
Anyway, I think you'll have to work somehow on buffering: months ago omxplayer added a new buffering technique. My reimplementation of that anyway resulted in bad performance for local files. Fixing that might be necessary to play remote content.
Bye.

22. Anonymous says:

Hi Luca,
I was wondering whether it would be possible to play http streams (MPEG2-TS format) with this backend and if it's possible whether you would be so kind to give me a hint on how to implement/use it?

Thanks a lot!

23. POCPlayer uses nothing more than QtMultimedia. So maybe you're using it in a way slightly different… Check POCPlayer code to have an idea.

24. Anonymous says:

It indeed does work using the command line POCPlayer.
However it does not work straight out of QtMultimedia.

Do you have any guesses why that might be the case?

25. Works perfectly here. But I'm using the lastest version in git (or anyway pretty similar).

26. Would it be possible for you to provide one of those files?

27. Anonymous says:

It appears to happen with several mp4 and avi files.
The output remains the same.

28. Does it happen with a specifc mp4 or with any video file?

29. Anonymous says:

Hi Luca,
thanks for your fantastic work. This is exactly what I've been looking for.
I sadly do have a little problem with it.
I am using the image you provided, set up QT and imported my application code.
However if I try to play a (.mp4) video using the QT MediaPlayer I see nothing but a black screen and the overlaying QML components.

This is the output in the Qt console:
(…)
[0;37mOpening video using OMX…

[0;37m
[0;34mvirtual OMX_TextureData* OpenMAXILPlayerControl::instantiateTexture(QSize)

[0;37m [0;34mGetting EGL display…
[0;37m [0;34mGetting OpenGL context…
[0;37m [0;34mEnjoying with OpenGL structures…
[0;37m
[0;37mOpening audio using OMX…
[0;37m
[0;34mvoid OMX_MediaProcessor::setState(OMX_MediaProcessor::OMX_MediaProcessorState)

[0;37m [0;34mState changed…

[0;37m

Besides that the applications runs perfect.
Do you have an idea how to fix that?
Please tell me that I have forgotten something extremely obvious and this is easy to fix 🙂

Thank you so much!

30. Anonymous says:

Hi, can you tell me which commit hash is the qtWayland code in this image? Thanks

31. Sorry, I know nothing about those projects.
And for the build of PiOmxTextures, you seem to have something very wrong in your env. Follow the instructions again.
Bye.

32. I was trying to say is that I have not a development machine so I'm not doing "CROSSCOMPILE". On the other hand, during this last time I have been working with the libraries QT5/Gstreamer twolife repo (twolife.be) and the new repo GStreamer (vontaene.de) that as I have seen and read work very well but I'm still putting together a project work with QT5 + gstreamer.

Another problem that I have presented is that every time I try to compile "PiOmxTextures" throws me an error "/usr/include/features.h: 356:25: fatal error: sys/cdefs.h: No such file or directory ". Clearly I'll have that problem with any other project that requires the module "sys". Still do not understand that there is the folder "sys" with its modules.

Someone could say that I can do to install these folders and fix that error message???
How fast as I copied the folder "sys" from "Linaro toolchain". They work some compilations but do not know if he's quite right.

I hope you can help me with this.
Thank you very much.

33. I'm not following you, anyway if you have problems with a specific revision of PiOmxTextures then report it to me and I'll have a look.

34. Well, I have not the development machine. I'm working with the twolife(qt5 repo/gstreamer), vontaene(gstreamer repo) and work very good for me but the last "piotexture" dont work any more. I looking for solution of problems.

I'm work on qt5+gstreamer… I think this is the best combination.

Thanks.

35. Those are not supposed to be on the device. Those are supposed to be on the host machine you use for development. I provided those files in the archive that also contains the image:

total 34364
-rwxr-xr-x 1 luca luca 1558488 Aug 4 19:59 lconvert
-rwxr-xr-x 1 luca luca 1763296 Aug 4 19:59 lrelease
-rwxr-xr-x 1 luca luca 2119748 Aug 4 19:59 lupdate
-rwxr-xr-x 1 luca luca 1513436 Aug 4 17:26 moc
-rwxr-xr-x 1 luca luca 1611740 Aug 4 17:26 qdbuscpp2xml
-rwxr-xr-x 1 luca luca 1501136 Aug 4 17:26 qdbusxml2cpp
-rwxr-xr-x 1 luca luca 2981428 Aug 4 17:26 qdoc
-rwxr-xr-x 1 luca luca 16513079 Aug 4 17:04 qmake
-rwxr-xr-x 1 luca luca 1210336 Aug 4 17:58 qmlmin
-rwxr-xr-x 1 luca luca 1275832 Aug 7 00:00 qtwaylandscanner
-rwxr-xr-x 1 luca luca 1255328 Aug 4 17:26 rcc
-rwxr-xr-x 1 luca luca 49109 Aug 3 14:45 syncqt.pl
-rwxr-xr-x 1 luca luca 1730464 Aug 4 17:26 uic
-rwxr-xr-x 1 luca luca 77879 Aug 3 21:30 wayland-scanner

36. Hi guys, today I have test the image that you upload Luca and I test the POCPlayer and this is running good but I have a problem when I try compile someone personal basic proyect. I see the message "-bash: qmake: command not found"… The image dont have full install qt5 ???

into de folder "/usr/local/Qt-rasp-5.1.2/" is not the all files (lconvert, lrelease, qmake, etc) missing many files but do not know why. Will I downloaded image is not complete ? I have to compile all QT5 ??

I hope someone help me.

Thanks.

37. Yes, pretty difficult to do something like that. Also pretty useless as this is a proof of concept. Not ready for production. Which means you should be able to work on it as well to make it work. I'll try to provide a more recent lib soon anyway.

38. Nope,I couldn't make it work 🙁
From what I understood from previous article, you have to compile the qtmultimedia part with the openmaxil folder in it (after a patch). (See http://thebugfreeblog.blogspot.co.uk/2013_04_01_archive.html)
But it didn't change anything for me. I probably copy the wrong file onto my Pi (or in the wrong location I don't know).
Compilations are very long and I can't spend too much time on it so I stopped trying.

It would be great if Luca could upload the new version for this plugin but I understand you can't keep compile and upload your work each time XD

Anyway, Andreas, if you find a way to do it, I would be glad to know how!

39. Anonymous says:

Erwan, please report back if you get it to work, I too am stuck with having successfully compiled the openmaxil backend, and not getting it to work after I copy it to the Pi.

40. I'm sorry, I don't know. You can try with gdb, strace or similar. Also you can try to ask on #qtwebkit.

41. Anonymous says:

How can i give you some extra information. Is there a switch to debug the error?

42. It seems the web process crashed but your not providing any information about the crash.

43. Anonymous says:

Hello Luca!

Thx for helping me. But now i have an other problem. I can open some webpages with WebKit but if i want to open HTML5test.com i always get the warning message "WARNING: The web process experienced a crash on 'http://html5test.com/&#39;." and the page will not be displayed.
I use this code to display the Page:

import QtQuick 2.0
import QtWebKit 3.0

WebView {
url: "http://www.HTML5test.com/&quot;
width: 1920
height: 1080
}

44. Anonymous says:

Thanks a lot for the torrent, brosicle. 2,5 mbps sure beats 0,0 kbps. Will seed.

45. omxplayer is using an entirely different component. So comparing might be useful, but there is no reason I should expect the same performance.

46. Anonymous says:

D–e3BtClFCcutbHAPLYdn4FxxMMkAC0rBs8Mnf8CJ0

47. Anonymous says:

Dear Lucas,

Thank you for your answer. I've tried the same test this morning using your pre-built image including Qt5.1.2 and your media service plugin. There is the same color depth problem that I've noticed in my own image.

omxplayer display a smooth 720p h264/aac video with full true color and when trying with POCPlayer the result is jerky with a 16 bits color depth. You can see it on the screen capture that I've done here (https://mega.co.nz/#!nBh1VIIS). Wait for the apparition of the blue "bear" in his den, it's easy to notice the color depth problem (omxplayer first and then POCPlayer). The logs say that the same decoder is used (omx-h264) in each case.
It's even worth with a 1080p video file.

I've also check the CPU usage in the two cases : POCPlayer is around 40% and omxplayer is around 22%.

Very strange…

Best regards,
Thomas

48. Use the QT_DEBUG_PLUGIN variable to get an idea of what is not ok. Check the needed libs are available, check with ldd etc…

49. I tried to follow the procedure of this article (http://thebugfreeblog.blogspot.it/2013/03/bring-up-qt-501-on-raspberry-pi-with.html), all my file are compiled in "/opt/rpi/sysroot" and I have copied those files into my raspberry.
But again if I replace the libPiOmxTextures files in /usr/lib I get the same error as before ("defaultServiceProvider::requestService(): no service found for – "org.qt-project.qt.mediaplayer""), even after I replaced the old libopenmaxilmediaplayer.so by the new one.

50. First, thx for the quick revision :D!

So I tried to compiled and it went almost fine.
I got an error with the prepare_openmaxil_backend.sh script: "pcre.h not found" I had to install "libpcre3-dev" on my raspberry and the copy back the "usr/lib" and "usr/include" to my computer.

But anymway, it compiled and now I have two directories in my PiOmxTextures folder : "lib" and "include". I put the files from "PiOmxTextures/lib" into my raspberry (/usr/lib) and in my sysroot (/opt/rpi/sysroot/usr/lib) on my computer.

I am not sure what to do next, in your article you talk about a "libopenmaxilmediaplayer.so" file but I don't know where it is.

Now when i want to launch my programm I get this error :
"defaultServiceProvider::requestService(): no service found for – "org.qt-project.qt.mediaplayer""

which seems related to the "libopenmaxilmediaplayer.so" file.

Thx

51. Oh, btw, also read the article about 32 bit color depth. Unless it was implemented recently, it was not possible to use QtWebKit with something other than 32 bit color depth. And 32 bit colors where not working oob with eglfs AFAIK. Bye!

52. As for the color depth issue, I don't exactly know where the problem is. Maybe in the eglfs plugin or in the policy used by the eglconvenience portion in the platform section. Anyway, I tried the same modification made in the other post and the images in QML seem to be rendered better. Couldn't test the video because I don't have a proper video. Don't you see any difference at all?

53. Checkout the latest revision. I implemented what was needed to restart the omxplayer component. I created a test sample and I'm currently over 170 consecutive iterations.

54. Anonymous says:

Nice work but one question. I'm new on using QT5. How can i run the qtwebkit so i can display a webpage. Thx

55. Well, First I tried this :

onStopped: { play() }

The sound is looping well but the video is stuck at the last frame. So I tried to force the loop by assigning a position to the video with the seek() function but as the seekable variable is still to false I couldn't do do it 🙁

I might do this the wrong way…

56. Of course you can do whatever you want with the image, sharing on ed2k or uploading anywhere is ok for me.

Unfortunately the seek functionality is still to be completed. I had difficulties integrating the one from omxplayer code, so some changes might be needed. It is in my TODO list, which is unfortunately getting longer and longer… 🙂 But do you need to seek to create a loop?

57. Hi,
If a lot of people have trouble with the ed2k file I can upload it somewhere if Luca is OK with it.

I tried to make a video loop with qml, but couldn't do it. I checked your code and it seems you return false in the OpenMAXILPlayerControl::isSeekable() function. I would like to change this part but last time I tried to compiled your module I failed.

Do you see another way to bypass this problem (the loop video)?

Thanks again!!

58. Anonymous says:

It would be really great if you could upload this file to mega.co.nz or something. At the rate that ed2k uploads, I'd be amazed if a single person got the file from you, and even if someone does, he'd be the only one. I've been trying to get smooth video working on QtonPi for the better part of six months, and your code holds the key to that locker, I just wish I could have it.

59. Anonymous says:

Just test to launch "http://html5test.com&quot; and look the gradient in the background.

Note : if you launch with qmlscene –transparent **.qml, then gradient are okay …

60. There will be some interruptions in the data source for the ed2k link during the week, sorry. If you're in a hurry please be patient.

61. I'm sorry, but unfortunately I need the bandwidth and providing more is impossible for me at the moment. There are 3 or 4 of you downloading concurrently at the moment.

And for the other question: sorry, never tested 32bit color depth thoroughly. Are you saying QtWebKit is showing 32bit color depth while the rest of Qt is not?

62. Anonymous says:

Hi Lucas,

Thanks for your terrific work on the raspberry, your are pushing the limit in every post !

Following all the instruction in your post, I've succeeded to build QT5 and your custom mediaservice plugin based on omxplayer_lib. I have also succeed in running your QTMultimedia POCPlayer test app and your standalone PiOmxTextures app.

But at the end, all my videos seems to be displayed with a 16 bits color depth ! So I have followed your post regarding forcing 32 bit color depth for EGLFS… I have rebuilt the pluqin libeglfs.so and the logs are indicating that I have now a 32 bit EGLFS config (RGBA(8, 8, 8, 8).) but I have still the same problem…

It seems all QML elements (video images etc …) are displayed in 16 bits color depth because I've also try the QT5 cinematic demo and all the gradient in background are dirty…

On the other hand, omxplayer command line display a pure video in 32 bit color depth with the same video file. Of course I have already set a 256 Mb for gpu mem and a 32 bit framebuffer depth in config.txt…

I am totally stuck on this color problem … would you have any idea that could help me to fix this problem ?

Bests regards,
Thomas

63. Hi Luca,