Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Using QtMultimedia Without a QGuiApplication
Forum Updated to NodeBB v4.3 + New Features

Using QtMultimedia Without a QGuiApplication

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 231 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zbendefy
    wrote on last edited by
    #1

    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
        qmediaplayer->play();
    

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

    1cd52ac7-1c24-4632-9648-f30b60227a60-image.png

    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?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

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

      (Z(:^

      1 Reply Last reply
      3
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

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

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved