Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to set the frame rate of camera preview in QT

How to set the frame rate of camera preview in QT

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 3.4k 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.
  • E Offline
    E Offline
    econtech
    wrote on last edited by
    #1

    I am using QAbstractVideoSurface for rendering the preview using QCamera class. I want to set the camera streaming frame rate as 30pfs. How I can set the frame rate?

    Any one give idea its very helpful.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Boy2melo
      wrote on last edited by
      #2

      I have the same problem. I want to access and manipulate the frames of a webcam by using QAbstractVideoSurface. I am currently only achieving a frame rate of 15-16 fps from the camera stream. I desire ~30 fps.

      Any suggestions? Is there a restriction in QT?

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Boy2melo
        wrote on last edited by
        #3

        WORKAROUND: I did not manage to increase the frame rate by using the QCamera and QAbstractVideoSurface from QT. But I did manage to increase it by using the OpenCV library:

        Use VideoCapture to capture frames from a camera or a video. You will receive the frames in the OpenCV format Mat. To convert Mat to QImage also see: http://asmaloney.com/2013/11/code/converting-between-cvmat-and-qimage-or-qpixmap/

        This solution works fine for me. I now achieve a framerate ~30Hz.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          flyfisher1952
          wrote on last edited by
          #4

          It turns out that there is a bug in Qt that makes actually setting the frame rate difficult. My colleague is submitting a patch that will fix this.

          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