[Solved] QML Video on the desktop
-
I'm so impatient waiting for QML to play well with video. When do you think it will get to the point that I can install Qt on my Ubuntu
machine and write a simple video application using the QML Video Element and have it just work? 4.8? -
Hi,
Sorry to hear the Video element is not working well for you. Can you give more specifics about the problems you are having? What version of Qt Mobility are you using? In general, your best bet for getting issues resolved is to report them via the "bug tracker":http://bugreports.qt.nokia.com.
Regards,
Michael -
Isn't it a bit strange that you need Qt Mobility to make multimedia work on the desktop?
-
I have tried installing QtMobility, all of the different versions, on my last attempt I had Qt 4.7 installed with the latest QtMobility and still could not get the simple Video Element example to work. I guess others have gotten it working but my post here is mainly to express frustration with the fact that getting it to work is not a straight forward process and I have trolled the internet looking for solutions to the various errors I was getting with no success. This is not my first time around the block as a developer.
I'm concerned that Qt is putting desktop development on the back burner. At the same time, I'm really interested in playing with QML, but I need multi-media functionality. There is no point in starting a project using phonon at this point.
-
Can You post the errors You are getting when trying to compile the examples?
-
Okay, I reinstalled Qt sdk 4.7 and QtMobility beta II. Gstreamer errors during install were resolved by adding the required dev libraries for gstreamer. Remaining errors were for opengl which I ignored. Made sure that qmake was in my path and LD_LIBRARY_PATH was set as in instructions. After compiling I noticed that the multimedia kit stuff was not contained in the ../install/lib directory. Why not?
Created a new Quick project in QtCreator and pasted the example using the Video Element from Qt Docs ...
@
import Qt 4.7
import Qt.multimedia 1.0Video {
id: video
width : 800
height : 600
source: "video.avi"MouseArea { anchors.fill: parent onClicked: { video.play() } } focus: true Keys.onSpacePressed: video.paused = !video.paused Keys.onLeftPressed: video.position -= 5000 Keys.onRightPressed: video.position += 5000
}
@
Not sure what changes are needed for video.qmlproject ??[edit: Highlighting added / Denis Kormalev]
-
Here is the error given when running the project ...
Starting /home/brian/qtsdk-2010.05/qt/bin/qmlviewer /home/brian/video/video.qml
file:///home/brian/video/video.qml:2:1: module "Qt.multimedia" is not installed
import Qt.multimedia 1.1 -
try this one:
import QtMultimediaKit 1.1
-
[quote author="Andre" date="1288082191"]Isn't it a bit strange that you need Qt Mobility to make multimedia work on the desktop? [/quote]
Andre, see "this
":http://developer.qt.nokia.com/forums/viewthread/1689/[quote author="Duff" date="1288298273"]I'm concerned that Qt is putting desktop development on the back burner. At the same time, I'm really interested in playing with QML, but I need multi-media functionality. There is no point in starting a project using phonon at this point.
[/quote]
Duff, the focus is definitely on Qt Quick and it should work equally well on desktop as compared to mobile platforms. Desktop development is definitely not on the back burner. -
Okay, good to hear that from someone at least. Looks like a new version of QtMobility has come out. I'll try to get the video working with QML video element once again. I understand this QML stuff is still new, so I am definitely not bailing on it. Hopefully, the documentation and build process will come around soon and make getting up and working with it a simpler process. I'll follow up here with my results with QtMobility 1.1 Final. I guess I'll uninstall the SDK since that is no longer supported any more. Should I go with Qt 4.7 or 4.7.1? Any suggestions? Also, there is a nice "project":http://piacentini.blog.br/2010/10/qtgstreamer-an-introduction/ going on to support gstreamer with Qt for more complete gstreamer support. Not applicable to QML at the moment but still worth keeping in mind.
-
4.7.1 has quite a few fixes if you see the change log
-
QML Video element works ok for me.
(Qt 4.7.1, Qt Mobility 1.1, QtCreator 2.1beta, Ubuntu 10.10) -
Yay!! It works! After installing Qt 4.7.1 and Qt Mobility 1.1 final, I was able to run the example QML video element with qmlviewer. As for LD_LIBRARY_PATH, I am on ubuntu and setting the path as instructed in the installation instructions (.profile) does not work for Ubuntu. I went the ld.so.conf.d route instead. I guess that worked. interesting that the .pro file was not necessary to get the example working.
Anyway, it looks like I finally get to have some fun with QML. Thanks for the help and suggestions.
-
Yes, it's quite simple to add video now.
Has anybody tried the same thing on other platforms except Ubuntu? -
My attempt at Windows 7 was a complete failure. While the library compiles, and I managed to get the component loaded, it simply does not show any video. The audio track for the video is audable though.
-
@Andre I had same issue on Windows. There was another thread in the forum discussing the same issue but the last time I checked there was not any solution.
In my case, I just gave up Qt Mobility and used VLC with some own binding between QML and VLC. It worked for me as I only needed to play video w/o any overlay QML stuffs on top of video.
-
[quote author="Andre" date="1288082191"]Isn't it a bit strange that you need Qt Mobility to make multimedia work on the desktop? [/quote]
I think of QtMobility more of taking advantage of extra hardware (that not every device has) - in most cases these are things desktops don't have but mobile devices do.
But, video is a bit different. Everything can and should play that. I think the reason why it is separate is it shares a lot of code with other mobility pieces (video record?) and is commonly required for mobile applications. In the past, Qt devs have used other things (like VLC mentioned above).
-
[quote author="moo1" date="1291424014"]@Andre I had same issue on Windows. There was another thread in the forum discussing the same issue but the last time I checked there was not any solution.
In my case, I just gave up Qt Mobility and used VLC with some own binding between QML and VLC. It worked for me as I only needed to play video w/o any overlay QML stuffs on top of video.[/quote]
Could you give some more details on that?
I am trying to play some video (also don't need to overlay QML on top) using MPlayer, but so far I am not having much luck. Playing using VLC sounds like a good option! -
[quote author="xsacha" date="1291425283"][quote author="Andre" date="1288082191"]Isn't it a bit strange that you need Qt Mobility to make multimedia work on the desktop? [/quote]
I think of QtMobility more of taking advantage of extra hardware (that not every device has) - in most cases these are things desktops don't have but mobile devices do.
But, video is a bit different. Everything can and should play that. I think the reason why it is separate is it shares a lot of code with other mobility pieces (video record?) and is commonly required for mobile applications. In the past, Qt devs have used other things (like VLC mentioned above).[/quote]
Well, I still think it is a weird choice. My guess is that it allowed for a faster development outside the main Qt branch. Recording video is equaly valid on non-mobile devices. Think of using a webcam for instance. Most of the other API in QtMobility I totally get being in there. Not many desktops or laptops have too many sensors or are equiped with localization hardware after all, but multimedia needs to be available and Just Work (TM) on all supported platforms, I think. -
Hi, moo1 and Andre! There was a huge bug in QtMobility "http://bugreports.qt.nokia.com/browse/QTMOBILITY-583":http://bugreports.qt.nokia.com/browse/QTMOBILITY-583. To fix it try to apply patch from here: "http://bugreports.qt.nokia.com/browse/QTMOBILITY-783":http://bugreports.qt.nokia.com/browse/QTMOBILITY-783. I've applied this patch and now qml video component works just fine.