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. Video player not work in child dialog. Error:Failed to activate video surface
Qt 6.11 is out! See what's new in the release blog

Video player not work in child dialog. Error:Failed to activate video surface

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.3k 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.
  • joeQJ Offline
    joeQJ Offline
    joeQ
    wrote on last edited by
    #1

    From my video analysis project, In MainWindow, I have one QMediaPlayer and setVideoOutput(subclassVideoSurface) to play video. It is work well. And a button to show one child dialog, this dialog also has QMediaPlayer and setVideoOutput(subclassVideoSurface) to play another video. but, it was not work after MainWindow's palyer had some operate. eg: i paused MainWindow's player before child dialog to show.

    I found the demo(Qt5.7.0/Examples/Qt-5.7/multimediawidgets/customvideosurface/customvideowidget) to test my problem.

    It had the same question.

    If the first player not play video, the child dialog's player can work well.
    If the first player played one video and pause it, the child dialog's player can not to work. and had the Error message: Failed to activate video surface

    I modified the demo at here, you can download it to test the problem.

    Download test demo

    Just do it!

    jsulmJ 1 Reply Last reply
    0
    • joeQJ joeQ

      From my video analysis project, In MainWindow, I have one QMediaPlayer and setVideoOutput(subclassVideoSurface) to play video. It is work well. And a button to show one child dialog, this dialog also has QMediaPlayer and setVideoOutput(subclassVideoSurface) to play another video. but, it was not work after MainWindow's palyer had some operate. eg: i paused MainWindow's player before child dialog to show.

      I found the demo(Qt5.7.0/Examples/Qt-5.7/multimediawidgets/customvideosurface/customvideowidget) to test my problem.

      It had the same question.

      If the first player not play video, the child dialog's player can work well.
      If the first player played one video and pause it, the child dialog's player can not to work. and had the Error message: Failed to activate video surface

      I modified the demo at here, you can download it to test the problem.

      Download test demo

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @joeQ Do you set same surface in both QMediaPlayers?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      joeQJ 1 Reply Last reply
      0
      • jsulmJ jsulm

        @joeQ Do you set same surface in both QMediaPlayers?

        joeQJ Offline
        joeQJ Offline
        joeQ
        wrote on last edited by
        #3

        @jsulm

        mainwindow----> obj1 = new player ---> sur1 = new surface ----> obj1.setVideoOutpus(sur1)
        child dialog----->  obj2 = new player ---> sur2 = new surface ----> obj2.setVideoOutpus(sur2)
        

        same subclass surface, different object to used.

        Just do it!

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

          Hi,

          What OS/Distribution are you running on ? Can you also check with the latest version of Qt ?

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

          joeQJ 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            What OS/Distribution are you running on ? Can you also check with the latest version of Qt ?

            joeQJ Offline
            joeQJ Offline
            joeQ
            wrote on last edited by
            #5

            @SGaist

            I used Mac, I let one friend to test it on Windows10, It had not the problem. So it is maybe the cause of operating system.

            Just do it!

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

              That's why I'm suggesting to test a more recent version current is 5.9.2.

              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