Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How to duplicate video output with PySide6?
Qt 6.11 is out! See what's new in the release blog

How to duplicate video output with PySide6?

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 2 Posters 1.0k Views
  • 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.
  • J Offline
    J Offline
    jeertmans
    wrote on last edited by
    #1

    Hello,

    I am developing a video-slides player, using the QMediaPlayer class, and I would like to add a presenter mode (as in PowerPoint), with a duplicate view of what is shown on the main screen.

    For Qt5, there are solutions using video surfaces, which seem to have disappeared as of Qt6.
    I try to instantiate another QVideoWidget, and pass the QVideoFrame in between them with:

    media_player.videoSink().videoFrameChanged.connect(second_video_widget.videoSink().setVideoFrame)
    

    but it does not seem to be allowed (You can't add dynamic slots on an object originated from C++).

    Is there a Qt-way to display the same video content but multiple times?

    Thanks!

    JonBJ 1 Reply Last reply
    0
    • J jeertmans

      Hello,

      I am developing a video-slides player, using the QMediaPlayer class, and I would like to add a presenter mode (as in PowerPoint), with a duplicate view of what is shown on the main screen.

      For Qt5, there are solutions using video surfaces, which seem to have disappeared as of Qt6.
      I try to instantiate another QVideoWidget, and pass the QVideoFrame in between them with:

      media_player.videoSink().videoFrameChanged.connect(second_video_widget.videoSink().setVideoFrame)
      

      but it does not seem to be allowed (You can't add dynamic slots on an object originated from C++).

      Is there a Qt-way to display the same video content but multiple times?

      Thanks!

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @jeertmans
      Although I know nothing about QMediaPlayer I believe your attempted approach is correct. See https://forum.qt.io/topic/128382/qt6-porting-guidance-qcamera-and-qabstractvideosurface but for C++.

      To proceed the way you wish is a problem in PySide (PyQt fairs better). See the accepted solution's workarounds at https://stackoverflow.com/a/75620549/489865. Try the simplest Using a lambda, hopefully that will allow you to connect successfully?

      J 1 Reply Last reply
      0
      • JonBJ JonB

        @jeertmans
        Although I know nothing about QMediaPlayer I believe your attempted approach is correct. See https://forum.qt.io/topic/128382/qt6-porting-guidance-qcamera-and-qabstractvideosurface but for C++.

        To proceed the way you wish is a problem in PySide (PyQt fairs better). See the accepted solution's workarounds at https://stackoverflow.com/a/75620549/489865. Try the simplest Using a lambda, hopefully that will allow you to connect successfully?

        J Offline
        J Offline
        jeertmans
        wrote on last edited by
        #3

        @JonB Storing video sinks inside variables and using a lambda did the job! Thanks :D

        1 Reply Last reply
        1
        • J jeertmans has marked this topic as solved on

        • Login

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