Results 1 to 10 of 10

Thread: Playing mpegs

  1. #1
    Join Date
    Jul 2006
    Posts
    26
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Playing mpegs

    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.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Playing mpegs

    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)
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    lewis (18th July 2006)

  4. #3
    Join Date
    Jul 2006
    Posts
    26
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Playing mpegs

    Thx Ill try that.
    I cant try it now cause Im working on it and it wont compile yet

  5. #4
    Join Date
    Jul 2006
    Posts
    26
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Playing mpegs

    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
    Last edited by lewis; 18th July 2006 at 20:15.

  6. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Playing mpegs

    Quote Originally Posted by lewis
    Video->setControl("ActiveMovieControl Object");
    Are you sure that this is correct name (especially that " Object" part)? Does setControl() return true?

  7. #6
    Join Date
    Jul 2006
    Posts
    26
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Playing mpegs

    hum, I thought i changed that, lemme check it up again...

  8. #7
    Join Date
    Jul 2006
    Posts
    26
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Playing mpegs

    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.

  9. #8
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Thumbs up Re: Playing mpegs

    If you look at the last post in my thread here http://www.qtcentre.org/forum/f-qt-p...ght=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.

  10. #9
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Question Re: Playing mpegs

    Did that help at all?

  11. #10
    Join Date
    Jul 2006
    Posts
    26
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Playing mpegs

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

Similar Threads

  1. Playing movies
    By yellowmat in forum Newbie
    Replies: 5
    Last Post: 29th March 2006, 14:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.