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. Need suggestion how to generate current scene image in performance sensitive app
Forum Updated to NodeBB v4.3 + New Features

Need suggestion how to generate current scene image in performance sensitive app

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 902 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.
  • N Offline
    N Offline
    nlazovic 0
    wrote on last edited by nlazovic 0
    #1

    I am working on app that is doing offscreen rendering (QOffscreenSurface / QOpenGLFramebufferObject).
    Once per every frame I have to get scene image (and process it)

    My current approach is to (on main thread) take image from QOpenGLFramebufferObject and process it. See below.
    Unfortunatelly QOpenGLFramebufferObject::toImage() executes very very slow, causing that my app can not render more then 5-8 fps.
    Without call to QOpenGLFramebufferObject::toImage(), I am getting easily 30fps+.

    When i make fbo copy (QOpenGLFramebufferObject::blitFramebuffer(workerFbo, m_fbo)) and pass workerFbo to worker thread to do toImage() on it, I am getting

    QOpenGLFramebufferObject::toImage() called without a current context
    
    1. Is there any other (faster) approach to get current scene image ?
    2. How to copy / set context on worker thread, so that I can do QOpenGLFramebufferObject::toImage() on worker thread ?

    Current approach

    MySceneRenderer::renderNext() {
        ... on main thread
        //get image from current QOpenGLFramebufferObject m_fbo
        QImage fboImage(m_fbo->toImage());
        //process image
        sceneProcessor.process(fboImage);
       ...
    }
    
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Out of curiosity, what processing do you need to apply ?

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

      N 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Out of curiosity, what processing do you need to apply ?

        N Offline
        N Offline
        nlazovic 0
        wrote on last edited by
        #3

        @SGaist
        ... take portion of overall scene, and stream to remote clients.
        Planning to use GStreamer/gst-rtsp-server to stream out. Running on separate thread.
        So far bottleneck is converting framebuffer to image ...

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

          Then you should check the QtGStreamer module. It might make things easier.

          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