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. Get Camera's Resolutions
QtWS25 Last Chance

Get Camera's Resolutions

Scheduled Pinned Locked Moved Solved General and Desktop
qimageencoderseqcameraimagecapqcamera
6 Posts 2 Posters 2.5k 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.
  • S Offline
    S Offline
    Suji
    wrote on last edited by Suji
    #1

    Hi guys !

    I have a camera conected and I want to get its available resolutions. I can already display stream, and play with camera parameters like contrast, gamma, saturation, exposition etc.

    I constructed a QCamera object like this :

    QCamera m_camera = new QCamera;
    

    Then i tried to do like this :

        if(m_camera!=NULL)
            m_camera->start();
    
        QCameraImageCapture * imageCapture = new QCameraImageCapture(m_camera);
        QImageEncoderSettings imageSettings;
        imageSettings.setResolution(3584, 2752);
        imageCapture->setEncodingSettings(imageSettings);
    
        QList<QSize> resolutions = imageCapture->supportedResolutions();
        std::cout << "Ready to use ? " << imageCapture->isAvailable() << std::endl;
        qDebug() << "Resolutions List : " << resolutions;
    

    The first line returns true, but the second returns an empty list.

    I have an empty list, moreover, when I verify, the resolution stay fixed to 896*688...

    Do someone have an idea for my problem please ?

    Have a nice day, you, who read my post ! :)

    EDIT : if I use qDebug() << imageSettings.resolution(), that returns Qlist<3584, 2752> which is what I entered, but not what is displayed.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      michelson
      wrote on last edited by
      #2

      I think this one may come in handy:
      https://forum.qt.io/topic/41412/how-to-get-camera-supported-resolutions-using-qt5/3
      As far as i understnad you have to call load() function to get acces to resolutions.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Suji
        wrote on last edited by
        #3

        Hi @michelson ! Thanks for your answer!

        I saw this topic, but i though that my start() is similar to load(). I'll try the load() so.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Suji
          wrote on last edited by
          #4

          Finally, that changed nothing... i still can't change my resolution...

          1 Reply Last reply
          0
          • M Offline
            M Offline
            michelson
            wrote on last edited by
            #5

            Im sorry but I think its not your fault that the resolutions are not showing up on screen. Ive seen some more discutions about it and I guess someone has already reported this as a bug

            https://bugreports.qt.io/browse/QTBUG-32743

            I guess your only option now is to either use camera API or try to apply resolution fixed by yourself (if possible).

            1 Reply Last reply
            1
            • S Offline
              S Offline
              Suji
              wrote on last edited by
              #6

              Hi @michelson !

              Yes, i finally found this bug report too, but i forgot to post it yesterday. The table which Yoann Lopes gave (in your link) explains what is possible or not to do : http://wiki.qt.io/Qt_5.5.0_Multimedia_Backends.

              Thanks for your help again ! I'll use my camera API then.

              Have a nice day !

              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