Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions
Using QtMultimedia Without a QGuiApplication
zbendefy last edited by
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.
qmediaplayer->setMedia( QUrl::fromLocalFile( "...somevideo..." ) ); qmediaplayer->setVolume( 100 ); qmediaplayer->setVideoOutput( this ); //<-- Crashes here. 'this' is the class inheriting from QAbstractVideoSurface qmediaplayer->play();
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?
If I am not mistaken, you cannot use any QObject-based class without a Q*Application, it won't work.
It's mandatory as it's that object that creates all the plumbing needed with your platform graphics system.