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. Render same video on 2 different surfaces
Qt 6.11 is out! See what's new in the release blog

Render same video on 2 different surfaces

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.5k Views 1 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.
  • Y Offline
    Y Offline
    yarospo
    wrote on last edited by
    #1

    Hello,

    Basically I'm trying to render the same video source onto 2 locations in my window, using QtMultimedia5.
    I'm doing it in QML, but if there is a solution in C++ I will be happy to implement it instead.

    What I see is happening is that QMediaService::requestControl is called, which returns a QVideoRendererControl object. Then QVideoRendererControl::setSurface is called to set the surface to which it renders the video.
    So from what I gather QMediaService has one surface to which it renders the video.

    How can I render to 2 surfaces or more?

    Cheers

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      yarospo
      wrote on last edited by
      #2

      Well, this was fairly simple, not the way I expected though. You gotta love QtQuick2.

      So I have a MediaPlayer source and a VideoOutput item in my QML code:

      @MediaPlayer {
      id: mp1
      source: "slide-1.wmv"
      }
      VideoOutput {
      id: tbltSlides
      anchors.fill: parent
      visible: true
      source: mp1
      }@

      All I had to do was just to add a ShaderEffectSource and set tbltSlides as its source. So simple:

      @ShaderEffectSource {
      id: slides
      x: 600
      width:250
      height: 250
      sourceItem: tbltSlides
      visible: true
      }@

      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