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. layered video / graphics media player strategy
Forum Updated to NodeBB v4.3 + New Features

layered video / graphics media player strategy

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 587 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

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

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

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

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

          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
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4

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

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

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

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

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

                  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
                  2

                  • Login

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