October 25, 2010

Duff Duff
Ant Farmer
80 posts

[Solved] QML Video on the desktop

Page  
1

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?

 Signature 

—Duff

20 replies

October 26, 2010

mbrasser mbrasser
Lab Rat
452 posts

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 [bugreports.qt.nokia.com].

Regards,
Michael

October 26, 2010

Andre Andre
Robot Herder
6399 posts

Isn’t it a bit strange that you need Qt Mobility to make multimedia work on the desktop?

October 28, 2010

Duff Duff
Ant Farmer
80 posts

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.

 Signature 

—Duff

October 28, 2010

kkrzewniak kkrzewniak
Lab Rat
219 posts

Can You post the errors You are getting when trying to compile the examples?

 Signature 

Me, Grimlock, not “nice dino”. ME BASH BRAINS!

October 29, 2010

Duff Duff
Ant Farmer
80 posts

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 …

  1. import Qt 4.7
  2.  import Qt.multimedia 1.0
  3.  
  4.  Video {
  5.      id: video
  6.      width : 800
  7.      height : 600
  8.      source: "video.avi"
  9.  
  10.      MouseArea {
  11.          anchors.fill: parent
  12.          onClicked: {
  13.              video.play()
  14.          }
  15.      }
  16.  
  17.      focus: true
  18.      Keys.onSpacePressed: video.paused = !video.paused
  19.      Keys.onLeftPressed: video.position -= 5000
  20.      Keys.onRightPressed: video.position += 5000
  21.  }

Not sure what changes are needed for video.qmlproject ??

edit: Highlighting added / Denis Kormalev

 Signature 

—Duff

October 30, 2010

Duff Duff
Ant Farmer
80 posts

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

 Signature 

—Duff

November 10, 2010

borut123 borut123
Lab Rat
73 posts

try this one:

import QtMultimediaKit 1.1

November 10, 2010

Deleted Member # 4a2 Deleted Member # 4a2
Ant Farmer
1481 posts

Andre wrote:
Isn’t it a bit strange that you need Qt Mobility to make multimedia work on the desktop?

Andre, see this [developer.qt.nokia.com]

Duff wrote:
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.

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.

November 11, 2010

Duff Duff
Ant Farmer
80 posts

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 [piacentini.blog.br] 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.

 Signature 

—Duff

November 11, 2010

Deleted Member # 4a2 Deleted Member # 4a2
Ant Farmer
1481 posts

4.7.1 has quite a few fixes if you see the change log

November 11, 2010

borut123 borut123
Lab Rat
73 posts

QML Video element works ok for me. (Qt 4.7.1, Qt Mobility 1.1, QtCreator 2.1beta, Ubuntu 10.10)

November 12, 2010

Duff Duff
Ant Farmer
80 posts

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.

 Signature 

—Duff

November 12, 2010

borut123 borut123
Lab Rat
73 posts

Yes, it’s quite simple to add video now.
Has anybody tried the same thing on other platforms except Ubuntu?

December 2, 2010

Andre Andre
Robot Herder
6399 posts

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.

December 4, 2010

moo1 moo1
Lab Rat
33 posts

@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.

Page  
1

  ‹‹ QML and font family      Separating Design from UI Elements ››

You must log in to post a reply. Not a member yet? Register here!