0

It's just plain luck my program is so simple, so I eventually found out what causes the mysterious log message. My program log looks like this:

Debugging starts
failed to start
Debugging has finished

Which happens after:

camera = new QCamera(QCameraInfo::defaultCamera());
// see http://omg-it.works/how-to-grab-video-frames-directly-from-qcamera/
camera->setViewfinder(frameGrabber = new CameraFrameGrabber());
camera->start();

The start() method causes this message in console. Now the meaning of the message is obvious, what it's not very helpful. What steps should I take to troubleshoot it?

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
  • I wonder how could two users vote to close as unclear, yet have no clarification questions... Does anyone else here not understand the question? I'm not sure what should I elaborate on, it seems pretty clear. – Tomáš Zato Mar 03 '17 at 01:00

1 Answers1

1

Reasons for this might differ, but in my case it was simply because I provided invalid QCameraInfo. The culprit is that QCameraInfo::defaultCamera() might return invalid value if Qt fails to detect any cameras on your system, which unfortunately happens even if cameras are present.

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778