Phonon::VideoPlayer does not display video

  • I configured and built using DirectX and Visual C++ Express v2008. When I open any video (.avi, .mp4, etc.), the video does not display for .avi file, application crashes with .mp4. Audio does play. Here is relevant code:

    #include "mainwindow.h"
    #include <Phonon/MediaObject>
    #include <Phonon/VideoPlayer>
    #include <Phonon/BackendCapabilities>
    #include <QUrl>
    #include <QListWidget>
    #include <QDir>
    #include <QFileDialog>

    MainWindow::MainWindow(QWidget parent)
    : QMainWindow(parent)
    QStringList mimeTypes;
    player =
    new Phonon::VideoPlayer(Phonon::VideoCategory, parent);
    QString fileName = QFileDialog::getOpenFileName(this, tr("Open Movie"),
    QDir::homePath(), NULL);
    Phonon::MediaSource ms(fileName);
    QString type = ms.type();
    QString fn = ms.deviceName();
    qint64 tt = player->totalTime(); // returns -1



    The following libraries are in <qt_dir>/plugins/photon_backend:
    libphonon_ds9.a libphonon_ds9d.a phonon_ds94.dll phonon_ds94.lib
    libphonon_ds94.a libphonon_ds9d4.a phonon_ds94.exp phonon_ds9d4.dll

    <directx_sdk>/Developer Runtime/x86 is in PATH

    [edit: code highlighted / Denis Kormalev]

  • allready discussed in "this": thread.
    I think you didnt have direct show installed.

  • Hello,

    I can see my video with windows media player, so i think i have the right codec. It's a avi file, but i can't see it with phonon : segmentation fault when uses Phonon::createPath(video, vwidget);
    It works with audio, but not with video.

    I am on windows XP, mingw, QtCreator 2.0.1 , Qt 4.0.7 and phonon 4.
    Please help me, thanks.

  • I download the latest version of Qt (QtSDK V1.1) and all is fine now !
    Thanks to all of you (especially vinb) !

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.