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
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.Where to Download
Unfortunately the download is over 1GB.Please let me know if you experience troubles downloading or with the image itself. Bye!
Hi Luca,
ReplyDeleteI would love to test the image but unfortunately eMule downloads the file with 1 - 3KB/s, estimating almost a week for the download. Could you please upload the file as a torrent or could you please send it using something like SoShare (https://soshareit.com/v2) or some other file sharing service ed2k is so damn slow.
Thanks,
Catalin
Hi Luca,
DeleteThank you for your work!
I have the same troubles as Cata.
I managed to install qt on my raspberry Pi, but couldn't get qtwebkit and your video widget to work. Your all in one file is greatly appreciated :)
If you could upload it somewhere else it would be great!
Thanks.
Hi Lucas,
DeleteThanks 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
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.
DeleteAnd 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?
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?
DeleteDear Lucas,
DeleteThank 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
decryption key needed to download the file :
DeleteD--e3BtClFCcutbHAPLYdn4FxxMMkAC0rBs8Mnf8CJ0
omxplayer is using an entirely different component. So comparing might be useful, but there is no reason I should expect the same performance.
DeleteThere 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.
ReplyDeleteJust test to launch "http://html5test.com" and look the gradient in the background.
ReplyDeleteNote : if you launch with qmlscene --transparent **.qml, then gradient are okay ...
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.
ReplyDeleteCode is available on github.
DeleteHi,
ReplyDeleteI have finally downloaded your file and everything is working great!
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!!
Of course you can do whatever you want with the image, sharing on ed2k or uploading anywhere is ok for me.
DeleteUnfortunately 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?
Well, First I tried this :
DeleteonStopped: { 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...
Here is a torrent file which should be better :
Deletehttp://s000.tinyupload.com/index.php?file_id=29950714189124478933
If anyone has found a way to make the video loop, I am still interrested :D
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.
DeleteFirst, thx for the quick revision :D!
DeleteSo 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
Refer to the other article for the build procedure.
DeleteI 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.
DeleteBut 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.
I don't know where is the problem. Do you have any ideas about this problem?
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...
DeleteThanks a lot for the torrent, brosicle. 2,5 mbps sure beats 0,0 kbps. Will seed.
DeleteErwan, 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.
DeleteNope,I couldn't make it work :(
DeleteFrom 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!
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.
DeleteNice work but one question. I'm new on using QT5. How can i run the qtwebkit so i can display a webpage. Thx
ReplyDeleteRead the docs: http://qt-project.org/doc/qt-5.0/qtwebkit/qml-qtwebkit3-webview.html.
DeleteOh, 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!
DeleteHello Luca!
DeleteThx 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/'." 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/"
width: 1920
height: 1080
}
It seems the web process crashed but your not providing any information about the crash.
DeleteHow can i give you some extra information. Is there a switch to debug the error?
DeleteI'm sorry, I don't know. You can try with gdb, strace or similar. Also you can try to ask on #qtwebkit.
DeleteHi 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 ???
ReplyDeleteinto 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.
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:
Deletetotal 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
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.
DeleteI'm work on qt5+gstreamer... I think this is the best combination.
Thanks.
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.
DeleteI 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.
ReplyDeleteAnother 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.
Sorry, I know nothing about those projects.
DeleteAnd for the build of PiOmxTextures, you seem to have something very wrong in your env. Follow the instructions again.
Bye.
Hi,
ReplyDelete>You can download it with this excellent torrent.
wheezy_qt5_20130807.7z
http://goo.gl/P1Zuws (Max 4.7 MB/sec)
Overview of Google Drive
https://support.google.com/drive/answer/2424384?p=ww_unsupported&rd=1&hl=en
Google Drive lets you store and access your files anywhere -- on the web, on your hard drive, or on the go.
[..]
Store the first 15 GB of your stuff for free across Google Drive, Gmail, and Google+ Photos.
Thanks.
alanyih
There seemed to be a limit as well: http://stackoverflow.com/questions/16856102/google-drive-limit-number-of-donwload.
DeleteHi, can you tell me which commit hash is the qtWayland code in this image? Thanks
ReplyDeleteProbably e48ea148aa285e81ab78c23ded3a5f6224883a05.
DeleteHi Luca,
ReplyDeletethanks 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;37mMetadata update requested.
[0;37m [0;34mvoid OpenMAXILVideoRendererControl::onTextureReady(const OMX_TextureData*)
[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!
Does it happen with a specifc mp4 or with any video file?
DeleteIt appears to happen with several mp4 and avi files.
DeleteThe output remains the same.
Would it be possible for you to provide one of those files?
DeleteThis is one of them: http://www.auby.no/files/video_tests/h264_720p_hp_5.1_6mbps_ac3_planet.mp4
ReplyDeleteI downloaded it, transferred it to project file on the Pi and launched it.
Besides that I also tried the Windows sample file. ("Wildlife.mp4")
Works perfectly here. But I'm using the lastest version in git (or anyway pretty similar).
DeleteI tested using the POCPlayer.
DeleteIt indeed does work using the command line POCPlayer.
DeleteHowever it does not work straight out of QtMultimedia.
Do you have any guesses why that might be the case?
Thanks for your help!
POCPlayer uses nothing more than QtMultimedia. So maybe you're using it in a way slightly different... Check POCPlayer code to have an idea.
DeleteHi Luca,
ReplyDeleteI 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!
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?
DeleteAnyway, 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.
Hi Luca,
ReplyDeletei keep getting the "Failed to get QQuickWindow." when running "POCPlayer test.h264".
Shouldn't this be fixed/removed?
Running off your wheezy image ...
Yes it should, I didn't expect that t happen.
DeleteHi Luca
DeleteI'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...
You can safely remove the log.
DeleteHi Luca,
ReplyDeleteI 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.
Now i can qmake on raspberry pi with (qmake from http://twolife.be/raspbian/) and copy module to /usr/local/Qt-rasp-5.1.2/ for use PiOmxTextures and my module.
DeleteMaybe related to this? http://qt-project.org/forums/viewthread/24484
DeleteJust test the torrent ISO,
ReplyDeleteThe POCPlayer still get the bad color depth :( ( gradient in video are so ugly :( )
As I already said: at the moment I have no interest in improving the color depth. It depends on how your env is set.
DeleteHi 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?
ReplyDeleteThe gstreamer plugin is one of the plugins available. But the performance depends on the performance of gstreamer.
DeleteThis 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.
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.
DeleteHi, downloaded the file via torrent.
ReplyDeleteHave tried username: pi and password: rasp as well as username: pi and password: raspberry and none of them work.
I'm stuck at login.
I don't have the image anymore but you can try: username: pi, password: raspberry.
Deletesomebody have the image? really need it.. i tried to install Qt but always fail...
ReplyDeleteDownload from the torrent (I just updated it).
Deletei need it too
ReplyDeleteCan you post actual link to image?
ReplyDeleteI updated the link to the torrent. It is still available.
DeleteThanks!!
DeleteHello Luca, Thanks for the image. I downloaded it and write to SD. I tryed to start ./POCPlayer myvideo and it worked.
DeleteNow 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/
Hello Luca,
ReplyDeletetnx 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
Yes, it is known. I never bothered to implement the fix. Search the blog, you should find another discussion about this.
Deletetorrent not work. help!
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete