Important: Please read the Qt Code of Conduct -

Using QtMultimedia Without a QGuiApplication

  • Hi!
    I'm experimenting with the QtMultimedia module. I would like to use it without the other parts of Qt.
    The goal is to open a video file and render it into an OpenGL texture.
    To do this, I set up a QMediaPlayer and my custom class inheriting from QAbstractVideoSurface.

    Some code:

        qmediaplayer->setMedia( QUrl::fromLocalFile( "...somevideo..." ) );
        qmediaplayer->setVolume( 100 );
        qmediaplayer->setVideoOutput( this );  //<-- Crashes here. 'this' is the class inheriting from QAbstractVideoSurface

    When I'm opening a video, Qt will assert:


    Note that I don't have any QGuiApplications running, I'm using my own event loop etc.
    Is there a way to use Qt only for multimedia rendering, or is it a requirement for multimedia to have a QGuiApplication?

  • Moderators

    If I am not mistaken, you cannot use any QObject-based class without a Q*Application, it won't work.

  • Lifetime Qt Champion


    It's mandatory as it's that object that creates all the plumbing needed with your platform graphics system.

Log in to reply