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
Forum Updated to NodeBB v4.3 + New Features

Get Camera's Resolutions

Scheduled Pinned Locked Moved Solved General and Desktop
qimageencoderseqcameraimagecapqcamera
6 Posts 2 Posters 2.5k Views 2 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.
  • S Offline
    S Offline
    Suji
    wrote on 16 Mar 2016, 10:04 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 16 Mar 2016, 20:53 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 17 Mar 2016, 08:12 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 17 Mar 2016, 14:40 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 17 Mar 2016, 19:00 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 18 Mar 2016, 08:14 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

              2/6

              16 Mar 2016, 20:53

              4 unread
              • Login

              • Login or register to search.
              2 out of 6
              • First post
                2/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved