Video playback using QMultimedia

  • Hi all, im trying to play back a video using QMultimedia - this is my code so far:

    int main(int argc, char** argv)
    QApplication app(argc, argv);

    QVideoWidget* videoWidget = new QVideoWidget;
    QMediaPlayer *player = new QMediaPlayer();
    return app.exec();


    Basically all that happens is the QVideoWidget is shown but that is it - no video at all.
    and when i try to play back an AVI the background goes black and i get two messages in the application output :
    handleSessionEvent: serious error = -2147467262
    handleSessionEvent: serious error = -2147467262

    does any one know what the issue is here?
    Regards, Tim.

  • Lifetime Qt Champion


    It seems that the current default backend for windows uses WMF and it doesn't support as much codec than the DirectShow backend. You could try to build the DirectShow backend and see if it fits your needs.

    Hope it helps

Log in to reply

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