Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Solved layered video / graphics media player strategy

    General and Desktop
    2
    7
    196
    Loading More Posts
    • 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
      davecotter last edited by davecotter

      say i wish to create a media player with these features:

      • composition has transparency
      • comp is made of zero or more layers
      • each layer may be either animated graphics, still graphics, or video
      • comp may be sent to multiple "Displays" in realtime (eg: render once, display many)
      • comp may be piped to a file-storage routine (not necessarily realtime)

      what would be the best strategy for this?

      i see QGraphicsScene, and it seems like it might be the thing? each layer would be a QGraphicsItem? the "comp" would be the QGraphicsView? or would the comp actually be the QImage rendered by QGraphicsView? i don't want the scene rendered once for each Display, i'd like a cached image for that.

      Am i thinking along the right lines? Thoughts?

      update: another "layer" may be an editing mode, in that mode the layer may have a dozen graphical elements that may be selected or dragged around in groups or individually. seems like that might be a sub-scene? cuz i only want that layer's items to be editable (click-draggable).

      how do i bind the "view" to multiple windows, or to panels within a window?

      it seems that the "scene" is constructed by passing the window (view) into it? but then you create a view and pass the scene into that? the logic doesn't quite hang together in my mind

      eg: the constructor for my video window:

      QVideoWindow::QVideoWindow(
      	PREF_WindType	windType, 
      	QWidget			*parent
      ) :
      	_inherited(windType),
      	ui(new Ui::VideoWindow)
      {
      	QGraphicsView		*graphicsView = new QGraphicsView(new QGraphicsScene(this));
      
      	... ?
      }
      

      but i want to create the scene and the view independent of the window (so i can show it in multiple windows or in a panel in a window), and just have the window or panel "subscribe" to its output...

      1 Reply Last reply Reply Quote 0
      • D
        davecotter last edited by

        it seems nobody has an opinion. which i guess is the "right" answer

        1 Reply Last reply Reply Quote 0
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Hi,

          Just to be sure I understand correctly, are you trying to implement something like kdenlive ?

          On a side note, you should avoid prefixing your custom classes name with Q. It's going to be harder to maintain and people will try to look for these classes in Qt itself.

          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 Reply Quote 1
          • D
            davecotter last edited by davecotter

            no i'm implementing a karaoke player, that allows for transparent animated graphics playing (so the words can appear over a user-selected background), or video (cuz some karaoke is just plain video), with overlays (like scrolling text across the bottom), and transcoding (eg: convert to mp4)

            1 Reply Last reply Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              Then I would say that QtQuick might be better fitted for that.

              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 Reply Quote 0
              • D
                davecotter last edited by

                no, this is a QT Widgets app. i've already put years into it

                1 Reply Last reply Reply Quote 0
                • D
                  davecotter last edited by

                  it seems nobody has an opinion. which i guess is the "right" answer

                  1 Reply Last reply Reply Quote 0
                  • D
                    davecotter last edited by

                    my solution was to give up on caching the result of the scene rendering and sending it to multiple views, because i wanted to have different scenes (with different layers) displayed in each view.

                    so yes: each view is a QGraphicsView, which has a QGraphicsScene, and each "layer" is presented as a QGraphicsItem in each separate scene. even a QMediaPlayer (movie) can be presented to multiple QGraphicsVideoItems, one per scene. so it all works out.

                    :)

                    1 Reply Last reply Reply Quote 2
                    • First post
                      Last post