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. Is it possible to record a dynamic QWidget into a video?
Forum Updated to NodeBB v4.3 + New Features

Is it possible to record a dynamic QWidget into a video?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 970 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.
  • S Offline
    S Offline
    sylorr
    wrote on last edited by
    #1

    Hi,

    I am recently using QOpenGLWidget to draw something in the runtime. I wonder if it is possible to record the whole drawing process into a video. I found a bunch of examples saying Qt5 could support multimedia by using webCam(QCamera). However, it didn't say if this camera can be set the target to QWidget itself. Any idea? Thanks!

    Note: Qt5.6.2 (Could upgrading if needed), Ubuntu16.04

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sylorr
      wrote on last edited by
      #2

      The only way I could think of is using QScreen::grabWindow() and QTimer to save my widget's screen shots sequentially. And how could I make this raw image data to a video?

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

        Hi,

        Do you want that integrated in your application or would like to just record what is happening for some other purpose ?

        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
        • S Offline
          S Offline
          sylorr
          wrote on last edited by
          #4

          for sure it is integrated in my application. Right now I have a solution that using openCV's VideoWriter to grabFrameBuffer() per frame and write it into a VideoWriter. However, this grabFrameBuffer() function seems a pretty heavy task that causing my output video sometimes flickering. I don't quite care about what is rendering currently in my window, I am caring the output video that should seem to be fluent enough.

          My render method is based on QOpenGLWidget. Right now I want to use a FramBufferObject to "steal" content from my paintGL() function call every frame. And using QOpenGLGFrambufferObject::toImage to get an image and write it into a video. However right now I could only "steal" black screen in my window. and my window is rendering nothing for sure. I think there might be a way to hand over all gl's draw calls and save it into my framebufferobject.

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

            You should post the code you are currently using. That will allow other eyes to take a look at it and maybe find what is happening with it.

            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