PDA

View Full Version : How to use avi file in Qt?



vishal.chauhan
19th July 2007, 07:30
Hi All,

I m using Qt 4.1.5 on my MAC.

Is it possible to use avi file in Qt if yes then how i can use it ?
I have an application doing some long process and I have a progressBar but actually I also want to show somw avi within my application.


If any body knows then plz help me.

Thanks.

kernel_panic
19th July 2007, 09:58
in windows you have to use the winapi to show avi file. search on the codeproject or msdn for code examples. on linux look how mplayer does it.

vasanth
19th July 2007, 11:45
Hello guys

I am new to QT,

I am currently working on Qt with linux,

I am having lots of doubts in Qt... hope u ppl will solve it,


then I want to load a avi file in Qt,... how to do it..

thanks in advance

yop
19th July 2007, 13:33
Use QX11EmbedContainer (http://doc.trolltech.com/4.3/qx11embedcontainer.html) with mplayer passing -slave and setting the window id in the mplayer arguments. It 's pretty straightforward to achieve this.

The following is from the qxmp (http://www.xm1math.net/qxmp/index.html) video player sources illustrating a possible way to achieve that:


QX11EmbedContainer *container=new QX11EmbedContainer(ui.frame);
container->resize(w,h);
mp=new QProcess(container);
connect(mp, SIGNAL(readyReadStandardOutput()),this, SLOT(readPlayOutput()));
connect(mp, SIGNAL(finished(int)),this, SLOT(endPlayProcess(int)));
connect(mp, SIGNAL(started()),this, SLOT(startTimer()));
command=otherOptions+mplayerOptions+" -wid "+QString::number(container->winId())+" -slave "+playfile;
mp->start("mplayer "+command);