Results 1 to 6 of 6

Thread: Playing movies

  1. #1
    Join Date
    Jan 2006
    Posts
    162
    Thanks
    9
    Qt products
    Qt3
    Platforms
    Windows

    Default Playing movies

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Playing movies

    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.

  3. #3
    Join Date
    Jan 2006
    Posts
    162
    Thanks
    9
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: Playing movies

    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Playing movies

    Quote Originally Posted by yellowmat
    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).

  5. #5
    Join Date
    Jan 2006
    Posts
    162
    Thanks
    9
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: Playing movies

    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 :
    Qt Code:
    1. void TestFullMainWindow::processMovieStatusChanged( int status )
    2. {
    3. switch(status)
    4. {
    5. case(QMovie::EndOfFrame):
    6. frame->setPixmap(movie->framePixmap());
    7. break;
    8.  
    9. default:
    10. break;
    11. }
    To copy to clipboard, switch view to plain text mode 

    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.

  6. #6
    Join Date
    Jan 2006
    Posts
    162
    Thanks
    9
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: Playing movies

    Hmmm finally I update my code with :
    Qt Code:
    1. QRect rect = frame->rect();
    2. bitBlt(frame, rect.topLeft(), &movie->framePixmap());
    To copy to clipboard, switch view to plain text mode 

    instead of :
    Qt Code:
    1. frame->setPixmap(movie->framePixmap());
    To copy to clipboard, switch view to plain text mode 

    and it flicks less.

    Is it the way to do ?

Similar Threads

  1. Playing mplayer inside QWidget
    By sinha.ashish in forum Qt Programming
    Replies: 21
    Last Post: 14th January 2011, 12:14
  2. playing mp3 file with QSound
    By highlightsong in forum Qt Programming
    Replies: 4
    Last Post: 6th August 2008, 09:24
  3. playing mplayer within a Qwidget in windows environment
    By ag.sitesh in forum Qt Programming
    Replies: 5
    Last Post: 18th April 2008, 11:11
  4. Playing Media files in Qt 4
    By sar_van81 in forum Qt Programming
    Replies: 2
    Last Post: 18th December 2007, 05:53
  5. Playing mpegs
    By lewis in forum Qt Programming
    Replies: 9
    Last Post: 21st July 2006, 16:21

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.