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. QMediaCaptureSession capture from QGraphicsScene?
Forum Updated to NodeBB v4.3 + New Features

QMediaCaptureSession capture from QGraphicsScene?

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

    If i have a QGraphicsScene (not necessarily connected to a view, or if required, an OFFSCREEN view), can i set its output as the input to a QMediaCaptureSession?

    I see i can connect a QWindowCapture, but must that window be showing? can that window be invisible? eg: h.264 output in the background, unrelated to the showing (visible) windows?

    I had asked this question a couple years ago, but times have changed and i wonder if it is now possible?

    if it is not possible from QGraphicsScene directly, then how about a temporary buffer of QImage? Can i feed QMediaCaptureSession a QImageCapture class, then feed the QImageCapture class a series of QImage or QVideoFrame refs?

    is there sample code for sending in-memory images into QMediaCaptureSession ?

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

      from @artem.dyomin :

      In 6.8, we added QVideoFrameInput, and QAudioBufferInput, which can be connected to QMediaCaptureSession as inputs.

      Note you cannot set QGraphicsScene as an input to QMediaCaptureSession. Instead, you may render QGraphicsScene to QImage, construct QVideoFrame from the image, and send your sequence of images to QVideoFrameInput, (which is connected to QMediaCaptureSession).

      from @jøger.hansegård :

      The current tests for encoding audio and video can be seen at this link. You may want to look at all the files in the test's directory

      In an earlier version of the tests, the usage pattern is a bit more explicit.

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

        @SGaist do you have any ideas?

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

          Hi,

          What exactly do you want to record ?

          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 davecotter
            #4

            the output of the QGraphicsScene, frame by frame, into an h.264 file (ie: export movie of generated frames) @SGaist

            1 Reply Last reply
            0
            • D Offline
              D Offline
              davecotter
              wrote on last edited by
              #5
              This post is deleted!
              1 Reply Last reply
              0
              • D Offline
                D Offline
                davecotter
                wrote on last edited by davecotter
                #6

                from @artem.dyomin :

                In 6.8, we added QVideoFrameInput, and QAudioBufferInput, which can be connected to QMediaCaptureSession as inputs.

                Note you cannot set QGraphicsScene as an input to QMediaCaptureSession. Instead, you may render QGraphicsScene to QImage, construct QVideoFrame from the image, and send your sequence of images to QVideoFrameInput, (which is connected to QMediaCaptureSession).

                from @jøger.hansegård :

                The current tests for encoding audio and video can be seen at this link. You may want to look at all the files in the test's directory

                In an earlier version of the tests, the usage pattern is a bit more explicit.

                1 Reply Last reply
                1
                • D davecotter has marked this topic as solved on
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #7

                  Nice ! Thanks for the feedback

                  That was more or less what I wanted to suggest but I did not know about QDataFrameInput yet thus it's even simpler :-)

                  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

                  • Login

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