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. How to get the resolution of the Camera in QML
Forum Updated to NodeBB v4.3 + New Features

How to get the resolution of the Camera in QML

Scheduled Pinned Locked Moved General and Desktop
qt5.4qmlubuntu 14.04
6 Posts 2 Posters 3.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.
  • L Offline
    L Offline
    lalvishnu12
    wrote on last edited by
    #1

    Hi,

    I am using the Qml Camera element for capturing camera output and using the VideoOutput for diplaying it.
    How can I find the resolution of the Camera in Qml ?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tarod.net
      wrote on last edited by tarod.net
      #2

      @lalvishnu12 According to the documentation, the property resolution holds the resolution/size of the image to be captured. If empty, the system chooses the appropriate resolution.

      + info

      Maybe you could try to get the value of that property when you start the camera.

      "Individually, we are one drop. Together, we are an ocean."

      1 Reply Last reply
      1
      • L Offline
        L Offline
        lalvishnu12
        wrote on last edited by
        #3

        Thanks for the reply.

        But it is showing only QSize(-1,-1) when I console it.

        T 1 Reply Last reply
        0
        • L lalvishnu12

          Thanks for the reply.

          But it is showing only QSize(-1,-1) when I console it.

          T Offline
          T Offline
          tarod.net
          wrote on last edited by
          #4

          @lalvishnu12 Hi,

          I've been working with some examples, and I afraid you must set the resolution or you'll get that size if you request it.

          I suppose you know how to set the resolution, but anyway, here you have a piece of code:

           Camera {
              id: camera
          
              imageCapture {
                  onImageCaptured: {
                      console.log(vRecorder.resolution)
                  }
              }
          
              videoRecorder {
                  id: vRecorder
                  resolution: "320x240"
                  frameRate: 30
              }
          }
          

          "Individually, we are one drop. Together, we are an ocean."

          1 Reply Last reply
          1
          • L Offline
            L Offline
            lalvishnu12
            wrote on last edited by
            #5

            Thank you for the reply.
            I tried setting the resolution property of the CameraCapture and the console printed the given value. But the resolution of the image captured was in the camera's default resolution.

            I didn't tried it in the VideoRecorder. I will try it.

            T 1 Reply Last reply
            1
            • L lalvishnu12

              Thank you for the reply.
              I tried setting the resolution property of the CameraCapture and the console printed the given value. But the resolution of the image captured was in the camera's default resolution.

              I didn't tried it in the VideoRecorder. I will try it.

              T Offline
              T Offline
              tarod.net
              wrote on last edited by
              #6

              @lalvishnu12 Thanks.

              Let me know if you get any progress.

              "Individually, we are one drop. Together, we are an ocean."

              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