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. QCamera: incorrect frame size, resulting in the image data containing unitialized (garbage) segment
Forum Updated to NodeBB v4.3 + New Features

QCamera: incorrect frame size, resulting in the image data containing unitialized (garbage) segment

Scheduled Pinned Locked Moved Unsolved General and Desktop
qcamera
8 Posts 2 Posters 2.2k 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.
  • V Offline
    V Offline
    Violet Giraffe
    wrote on last edited by
    #1

    I have a very simple camera viewer program - I create QCamera, set a QViewfinderWidget for display and call QCamera::start. It's all fine with my laptop's web camera (640x480), but there is a problem with the camera I'm actually making the program for. It's an analog camera connected to an EasyCap USB video capture card. The capture card is visible as QCamera, I can connect to it and stream the video feed just fine. But there is one problem: the frame size reported by QCamera is larger than the actual image resolution. It's taller, i. e. more lines. That results in the image having garbled data at the bottom where the unreferenced lines are.

    I would think it's a driver glitch or whatever, the capture card might be reporting wrong size. But the thing is, this program does report the correct size (720x480). The size reported by Qt is something like 720x576 (I'll check and report the actual value later, if it's of any use).
    If I set the viewfinder resolution manually to 720x480 the problem goes away, but I would very much like to avoid the need for manual setup.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What OS is it ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • V Offline
        V Offline
        Violet Giraffe
        wrote on last edited by Violet Giraffe
        #3

        Confirmed on Windows 10 and Windows 7.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Can you check what you get with supportedViewfinderResolutions

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          V 1 Reply Last reply
          1
          • SGaistS SGaist

            Can you check what you get with supportedViewfinderResolutions

            V Offline
            V Offline
            Violet Giraffe
            wrote on last edited by
            #5

            @SGaist
            Great suggestion. I should have done that at once, but totally forgot about that property. There are 2 items in the list: 720x480 and 720x576 (in that order). The latter is selected, and apparently, it's wrong.

            Should I always pick the smaller frame size?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              I wouldn't say always. I'd check with the values returned. You might also be victim of something the camera driver reports that is inaccurate.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              V 1 Reply Last reply
              0
              • SGaistS SGaist

                I wouldn't say always. I'd check with the values returned. You might also be victim of something the camera driver reports that is inaccurate.

                V Offline
                V Offline
                Violet Giraffe
                wrote on last edited by
                #7

                @SGaist
                Yes, might well be a driver issue. It's just that the smallest size seems like the safest bet.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  It should be yes

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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