You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, April 16th 2012, 8:01am

Video Avi and QT

Hi,
I tried to play a vedeo Avi in Windows XP using QT4.

My code is very simple:

QString fileName = QFileDialog::getOpenFileName(this, tr("Open Movie"), QDir::homePath(), NULL);
Phonon::VideoPlayer *player = new Phonon::VideoPlayer(Phonon::VideoCategory, ui->graphicsView);
player->play(fileName);

I have no errors, but starting the program nothing happens, the graphicsView remains empty and the video does not start.

On Windows XP I loaded the video codec, in fact the video start normally using any video player.

2

Monday, April 16th 2012, 8:17am

This won't answer your question but since phonon is not supported anymore, have you consider the idea of using the module Multimedia of qt mobility ?
There are some exemples here :
http://doc.qt.nokia.com/qtmobility/player.html

http://doc.qt.nokia.com/qtmobility/multi…ay-a-media-file

3

Monday, April 16th 2012, 8:21am

why should the graphics view show anything? :confused:

http://qt-project.org/doc/qt-4.8/phonon-…ml#videoWidgetx
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

4

Monday, April 16th 2012, 8:36am

why should the graphics view show anything? :confused:

http://qt-project.org/doc/qt-4.8/phonon-…ml#videoWidgetx
I have already read the documentation on qt-project.org.

In my code, I opened a video stream and redirected it on the GraphicsView. So I should see the video in the GraphicsView. There are more examples like my code, I don't see where is the problem.

5

Monday, April 16th 2012, 10:00am

I didn't think setting the parent will show your video there.

I've shown you , above, where the video is.
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

This post has been edited 1 times, last edit by "Amleto" (Apr 16th 2012, 10:21am)


6

Monday, April 16th 2012, 10:23am

so how do I do to watch the video?

Similar threads