PDA

View Full Version : Playing movies



yellowmat
28th March 2006, 10:10
Hi,

I need to play some movies in my application.

The format of all movie files are .avi.

I hava tried to play such files but I don't see anything, isn't it possible to play avi files ? Must I convert them to mng files (if it is possible) to be able to play such movies ? What are the movie format supported by QT 3.3.3. ?

Thanks in advance.

wysota
28th March 2006, 11:04
You have to use an external movie player, for example using ActiveX or by embedding one of existing players like xine or mplayer. Qt doesn't handle movies on itself.

yellowmat
28th March 2006, 12:33
Isn't it possible to have an object such as QMovie to play movies ? If this object is not able to play movie files, it should have been named QAnimation instead.

I have thought about the windows media player activex (because xine and mplayer do not work on a windows platform) to play other format, but I don't find the API of this activex so if someone could tell me where to find it ... and also tell me if it is possible to play a movie (not necessarly in full screen) without the control (play, stop, pause) bar.

Thanks in advance.

wysota
28th March 2006, 13:43
Isn't it possible to have an object such as QMovie to play movies ?
Yes it is. You "just" need to implement apropriate classes to handle them (which you probably wouldn't like to do).


If this object is not able to play movie files, it should have been named QAnimation instead.
Why? Isn't move an animation and animation a movie? Aren't they synonyms?

Also please remember that sound support in Qt is very limited.


xine and mplayer do not work on a windows platform
Hmm... mplayer surely works on Windows (and it's easiest to embed it, it can be done in two minutes once you read mplayer docs).


to play other format, but I don't find the API of this activex so if someone could tell me where to find it
http://www.msdn.com


... and also tell me if it is possible to play a movie (not necessarly in full screen) without the control (play, stop, pause) bar.
Yes (for example look at mplayer).

yellowmat
29th March 2006, 13:54
Thanks a lot for your reply.

Finally, my need is quite simple (I do not need sound support, and the animations are just as a gif files) so a mng file used through a QMovie object will be enough.

I did an application test with a QMovie object and I see that the displaying of each frames flicks, probably due to the way I do to process the display.

So I connect the status notification signal (using QMovie::connectStatus) to a slot in my application and when the status equals to QMovie::EndOfFrame I get the QPixmap and process the drawing using a QLabel ... here is my code :

void TestFullMainWindow::processMovieStatusChanged( int status )
{
switch(status)
{
case(QMovie::EndOfFrame):
frame->setPixmap(movie->framePixmap());
break;

default:
break;
}


I know that there is something called double buffering to avoid flicking effect but I don't know how to apply it to my case, but maybe my problem comes from the way I'm trying to code the frame displaying ?

Thanks in advance.

yellowmat
29th March 2006, 14:07
Hmmm finally I update my code with :

QRect rect = frame->rect();
bitBlt(frame, rect.topLeft(), &movie->framePixmap());


instead of :

frame->setPixmap(movie->framePixmap());

and it flicks less.

Is it the way to do ?