How to set the frame rate of camera preview in QT
-
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?
-
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.
-
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.