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. Is there a way to change Camera frame rate?
Forum Updated to NodeBB v4.3 + New Features

Is there a way to change Camera frame rate?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 575 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.
  • D Offline
    D Offline
    diego-qt
    wrote on last edited by diego-qt
    #1

    Hello,
    I am using my webcam as Camera in a QML application in Linux, but the frame rate is too slow and I can't seemingly change it.
    I try to modify its camera.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 a Camera 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.

    1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      The whole module of Qt multimedia in Qt 6 was reworked. Better to use the latest Qt or stick to 5.15.

      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