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. "Failed to activate video surface"
Qt 6.11 is out! See what's new in the release blog

"Failed to activate video surface"

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 2 Posters 1.4k 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.
  • D Offline
    D Offline
    davecotter
    wrote on last edited by davecotter
    #1

    On mac, using 5.15.2.

    I have 3 QGraphicsScenes. In each scene I have one (or more but we'll get to that) layers of type QGraphicsVideoItem (plus a QGraphicsSimpleTextItem but that's probably not a factor).

    Now each that QGraphicsVideoItem may be generated by me (i paint "CDG" into a QPixmap then send it into the videoItem for presentation), OR it may be generated by a QMediaPlayer presenting "Movie" frames directly. Note that either way, the items are presented into a vector of QAbstractVideoSurfaces, cuz as i said there are 3 scenes.

    Normally there's only one video item, and all is well. But during transitions, there is a short window of crossfade, where the previous and next song are playing at the same time.

    Works fine MOST of the time. And more often when going from CDG->CDG or Movie->Movie, or even Movie->CDG. But if i transition from CDG->Movie, inevitably i get "Failed to activate video surface".

    I can't for the life of me figure out why.

    If you need, i can provide a debug app that exhibits this behavior.

    if it is relevant, i do have Qt::AA_ShareOpenGLContexts turned on.

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

      Hi,

      What if you nuke the CDG before the transition ?

      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
      0
      • D Offline
        D Offline
        davecotter
        wrote on last edited by
        #3

        then we don't get crossfade, which is a major feature of the app

        1 Reply Last reply
        0
        • D Offline
          D Offline
          davecotter
          wrote on last edited by davecotter
          #4

          note that i'm STILL getting "Failed to activate video surface" intermittently and sporadically, just that given the steps above i KNOW i can cause the bug very reliably. I figure if THAT bug is fixed, the sporadic bug is also fixed.

          I've not turned off Qt::AA_ShareOpenGLContexts because I need that for performance reasons, since the 3 scenes are in separate windows. But if you feel i should shut that off as a test to gather intel, i'll do so.

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

            How do you implement crossfade ?

            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
            0
            • D Offline
              D Offline
              davecotter
              wrote on last edited by davecotter
              #6

              by adding both layers to the scene, and animating the opacity of the top layer

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

                What if you duplicate the pixmap, nuke the CDG and do the crossfade using the duplicated pixmap ?

                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
                0
                • D Offline
                  D Offline
                  davecotter
                  wrote on last edited by
                  #8

                  Well, that's not how my pipeline works. I appreciate your suggestion about that, but it would be a hack to try to do it that way. I'm not really looking for a hack or a workaround, I'm hoping for a bugfix or a true solution like "oh you forgot to set the fubar opengl bit here do this" kind of answer. :-)

                  By the way, at transition time, the video that is the CDG is still playing, still animating, still presenting new frames through its QGraphicsVideoItem layer, while it is "fading out", it's not a static image. This happens while the mp4 video is also playing behind it, being revealed.

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    davecotter
                    wrote on last edited by
                    #9

                    okay this is not related to order of ops or having two different types of graphics items.

                    if i just play then stop then play, over and over, eventually it will cause the problem.

                    yes it's hard to repro this way, but then sometimes, it happens every time i play, same file.

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

                      Can you provide a minimal compilable example that shows this behaviour ?

                      Does it happen with a specific file or any will do ?

                      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
                      0

                      • Login

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