Is there a way to change Camera frame rate?
-
Hello,
I am using my webcam asCamera
in a QML application in Linux, but the frame rate is too slow and I can't seemingly change it.
I try to modify itscamera.videoRecorder.frameRate
property but I don't see real changes in the application. It still looks like 2 fps, event thought the video is smoother when I use VLC.
Also, I realized this frame rate property is no longer available in Qt 6.2 or 6.4 (I was seeing the 5.15 doc when coding), so does this means that it is no longer possible to change the frame rate of aCamera
object? Is there a workaround?I'll leave the code just in case but it is very simple:
Popup { id: cameraPopup property string sourceWebCam: QtMultimedia.availableCameras.length > 0 ? QtMultimedia.availableCameras[0].deviceId : "" VideoOutput { id: viewfinder anchors.centerIn: parent height: cameraPopup.height * 0.75 width: cameraPopup.width * 0.5 source: camera flushMode: VideoOutput.LastFrame fillMode: VideoOutput.PreserveAspectCrop } Camera { id: camera deviceId: sourceWebCam captureMode: Camera.CaptureViewfinder videoRecorder.frameRate: 25 } }
I have also added some buttons to increase and decrease the frame rate property, and a console log shows me that it has effectively been changed, but I thought it was no use to add them in the code above.