Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to grab whole window without monitor or HDMI dummy plug?
Forum Update on Monday, May 27th 2025

How to grab whole window without monitor or HDMI dummy plug?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 3 Posters 258 Views
  • 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.
  • H Offline
    H Offline
    harlan56
    wrote on last edited by
    #1

    I'm doing a streaming work, the device is without any monitors or HDMI dummy plug. I tried to use "grab()" but it seems to be forced to update all widgets, however, these widgets are required to update at specific time so "grab()" is not suitable for this situation. And "grabWindow(this->winId())" had been tried, but it only captrues 1/4 area of the window, other areas were shown as black. I doubt the incorrect "winId()" caused error result because gnome terminal would be startup first to execute shell script. Anyone please advise some effective methods or enlightenments, thanks!

    system: ubuntu18.0.4
    qt version: 5.9.5
    device: nvidia tx2

    program execute steps:
    1、startup shell script is be executed by a gnome terminal after booting
    2、above mentioned script execute the qt program

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

      Hi and welcome to devnet,

      How are you doing the streaming part ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      H 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        How are you doing the streaming part ?

        H Offline
        H Offline
        harlan56
        wrote on last edited by
        #3

        @SGaist Hi, i grab window images through a "QTimer", and images encoded into H.264 format frames using "ffmpeg", then frames are streamed using the 3rd party API. The frame's size and proportions are the same as the original grabbed window image.

        I can get the correct whole window image by "grab()", stream frames and show them normally. Due to using "QOpenGLWidget" to render some textures, some image flickering occurred, and no effective ways i can solve currently.

        I later tried to use X11 to grab the window image, but still need a monitor or HDMI dummy plug to realize such as make the GPU perform initialization process.

        I am curious about how the "grab()" implements grabbing the correct full image without the monitor or HDMI dummy plug.

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

          Did you try with Qt's offscreen plug-in to see if does what you need ?

          Another option is to use a headless X
          Or maybe Xvfb

          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
          • H harlan56

            @SGaist Hi, i grab window images through a "QTimer", and images encoded into H.264 format frames using "ffmpeg", then frames are streamed using the 3rd party API. The frame's size and proportions are the same as the original grabbed window image.

            I can get the correct whole window image by "grab()", stream frames and show them normally. Due to using "QOpenGLWidget" to render some textures, some image flickering occurred, and no effective ways i can solve currently.

            I later tried to use X11 to grab the window image, but still need a monitor or HDMI dummy plug to realize such as make the GPU perform initialization process.

            I am curious about how the "grab()" implements grabbing the correct full image without the monitor or HDMI dummy plug.

            Ronel_qtmasterR Offline
            Ronel_qtmasterR Offline
            Ronel_qtmaster
            wrote on last edited by
            #5

            @harlan56 Hi, have you tried QApplication::desktop()->grab(); function?

            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