QCamera: incorrect frame size, resulting in the image data containing unitialized (garbage) segment
I have a very simple camera viewer program - I create
QCamera, set a
QViewfinderWidgetfor 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
QCamerais 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.
What OS is it ?
Violet Giraffe last edited by Violet Giraffe
Confirmed on Windows 10 and Windows 7.
Can you check what you get with supportedViewfinderResolutions
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?
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.
Yes, might well be a driver issue. It's just that the smallest size seems like the safest bet.
It should be yes