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. Custom video in QVideoWidget
Forum Updated to NodeBB v4.3 + New Features

Custom video in QVideoWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 2.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.
  • J Offline
    J Offline
    JakaBac
    wrote on last edited by
    #1

    Hello,

    Is there any example which shows how to draw custom video in the QVideoWidget?
    The documentation here http://doc.qt.io/qt-5/videooverview.html provides examples on how to implement a class which receives video frames from QT Multimedia but not the other way around.

    Thanks,
    Jaka

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

      Hi and welcome to devnet,

      What do you mean by "the other way around" ?

      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
      • J Offline
        J Offline
        JakaBac
        wrote on last edited by JakaBac
        #3

        There is an example how to get video frames from let's say a QMediaPlayer.
        But there is no example how to draw into a QVideoWidget

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

          Because you usually don’t draw on QVideoWidget. You create a custom media source were you generate the video frames you want to show.

          Out of curiosity, what are you trying to achieve ?

          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
          • J Offline
            J Offline
            JakaBac
            wrote on last edited by
            #5

            Well you have to draw to some surface in any event, or you queue video frames to "something" and it draws them for you.
            In any case the question remains... How do you do this?

            Looking at the source of QtMultimedia is not very enlightening since everything is a bit complex. But it seems that on Windows QMediaPlayer uses MediaFoundation's EVR or DirectShow's VMR with a custom presenter and that then somehow ends on the QVideoWidget.

            What I want to achieve is to display video from a HD-SDI video board. The board has a custom cross-platform SDK and I wanted a cross-platform way of showing the video.
            I know I can always use OpenGL or Direct3D or something like that to render the video, but that is not the point...

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

              Brings back memories...

              Then implement a QCamera backend. It's not overly complicated and you'll be able to re-use it on all the needed platforms. This will also allow you to integrate nicely in your Qt applications whether it's widgets or QtQuick.

              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
              • J Offline
                J Offline
                JakaBac
                wrote on last edited by
                #7

                In any case this all goes back to the original question...
                How do you do that?

                I glimpsed over DirectShow backend for QCamera and it is not much different than QMediaPlayer backend.
                And I don't need camera controls.

                It would be nice to see a simple sample where you somehow obtain the QAbstractVideoSurface of the rendering target and just draw silly things, even random noise...

                Documentation only states pretty obvious facts and even states that some things that I should do in order to accomplish what I want are out of the scope of the documentation

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  DavidEmmanuel
                  wrote on last edited by
                  #8

                  Hi! have a similar need, @JakaBac can solve this?

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

                    @DavidEmmanuel Hi and welcome to devnet,

                    The easiest is to look at the already existing backend. Which usually boils down to have one central class that does the various bits and create all the need control class that will you that central class to provide the various interface you want to support from the QCamera pipeline.

                    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