PDA

View Full Version : Playing mpegs



lewis
18th July 2006, 16:46
Hi, im trying to play an mpeg file inside a QT app, but without success. I tried to use QAxWidget but simply creating a new object gave linking error, eventho i did include QtAxWidget.

I dont mind using other libs, if u have any idea let me know.

jpn
18th July 2006, 16:52
To build Qt applications that can host COM objects and ActiveX controls link the application against the QAxContainer module by adding

CONFIG += qaxcontainer
to your application's .pro file.

(ActiveQt is only part of the commercial version of Qt)

lewis
18th July 2006, 16:55
Thx Ill try that.
I cant try it now cause Im working on it and it wont compile yet

lewis
18th July 2006, 20:08
I cant get anything to show up on the app...

QWidget *mainWidget = new QWidget();

QHBoxLayout *hbox = new QHBoxLayout();
mainWidget->setLayout(hbox);

QAxWidget *Video = new QAxWidget();
Video->setControl("ActiveMovieControl Object");
Video->dynamicCall("FileName","f1.mpg");
Video->dynamicCall("AllowHideControls",0);
Video->dynamicCall("AllowHideDisplay",0);
Video->dynamicCall("AllowChangeDisplayMode",0);
Video->dynamicCall("ShowTracker",1);
Video->dynamicCall("ShowControls",1);
Video->dynamicCall("ShowDisplay",1);
Video->dynamicCall("AutoStart",1);
Video->dynamicCall("PlayCount",1000);
Video->dynamicCall("EnableContextMenu",1);
Video->dynamicCall("EnablePositionControls",0);
Video->dynamicCall("EnableSelectionControls",0);
Video->dynamicCall("EnableTracker",1);
Video->dynamicCall("Volume",-600);

hbox->addWidget(Video);
setCentralWidget(mainWidget);

setWindowTitle("test");

I get the APP window with nothing inside it

jacek
18th July 2006, 20:31
Video->setControl("ActiveMovieControl Object");
Are you sure that this is correct name (especially that " Object" part)? Does setControl() return true?

lewis
18th July 2006, 20:39
hum, I thought i changed that, lemme check it up again...

lewis
18th July 2006, 20:47
indeed, I must have used an old version of the program in which that wasnt modified...

{6BF52A52-394A-11d3-B153-00C04F79FAA6}: that makes the window show... and more sense as well!

The video still doesnt play but I think ill recheck the program just in case its another dumb mistake like that... Ive made so many dumb mistakes today, i should go to bed.

ToddAtWSU
19th July 2006, 13:34
If you look at the last post in my thread here http://www.qtcentre.org/forum/f-qt-programming-2/t-solved-directshow-video-player-inside-qt-1612.html/?highlight=directshow you will see that I used DirectShow inside a QAxWidget and I can successfully play AVI and MPEG files. Hopefully this will help get you started as this is all basically Microsoft DirectShow code. You will have to download the DirectX SDK for some of their required libraries but if you want to use a QAxWidget, this is probably the best way to do it. Just search for DirectShow on this site and you will find numerous posts by me on this problem. Good luck and let me know if there is anything else I can try to help you with.:)

ToddAtWSU
21st July 2006, 13:21
Did that help at all?

lewis
21st July 2006, 16:21
not for now, there is way too much code there...didnt have time to go through...

All im trying to do is display a 5 seconds mpeg file in a QT app, so I just need the display part...

But if theres no simple solution ill just forget about it...