Important: Please read the Qt Code of Conduct -

Qt Phonon with MinGW in QtCreator in windows XP ?

  • Hi All,

    i have configure QT 4.7 and also added MingW for compilation of QT programs.
    I want to write sample application that will play video in QT.
    For that i am using phonon but i am not able to build phonon with my application ?
    When i compile application that will use phonon framework then it gives undefined phonon ?
    Can anyone give me idea or link that how to integrate phonon with my QT SDK and MinGW ?


  • Did you add phonon to your *.pro file?
    QT += phonon

  • @#include <QtGui/QApplication>
    #include <Phonon/VideoPlayer>
    using namespace Phonon;

    int main(int argc, char *argv[])
    QApplication a(argc, argv);

    MediaSource m("file path");
    VideoPlayer *player = new   VideoPlayer(Phonon::VideoCategory, 0);
    QObject::connect(player, SIGNAL(finished()), player, SLOT(deleteLater()));
    return a.exec(&#41;;


    I think this code may help you a lot

  • thanks prajnaranjan.
    I have successfully compiled my application but when i run it then it shows nothing, only dialog appears. I have given right path of file and i have given .mp4 and .avi file as input video file. Any idea ?


  • ok....try to play any .wmv file ....It will surely work....

  • ok.. thanks for your help... now i am able to play .avi file.i will try .wmv file and let u know the result.

    One question for knowledge..
    How many file format is supported by the framework?
    I mean can i play all the file format like .mp4,.flv etc... ?
    just for knowledge where the decoder is come into picture in phonon framework itself or DirectX of microsoft ? How the actual flow when i give input file?


  • Actually I'm also new to Qt ....But in Qt you can not able to play flash files as there is no Flash NPAPI plugin in QtWebkit....go through this link,this may help you ....

Log in to reply