Cannot use two webcams simultaneously using QtMultimedia under Mac OS
I am trying to grab video frames for further processing from two USB cameras under MAC OS X. I am using Qt 5.3 (the same applies to 5.2) and QtMultimedia library. From my application, I can connect to each of two cameras separately. But when I'm trying to use both at a time - an error is occurring for the second one: "Runtime camera error" - that's what I see in output.
The error occurs in AVFoundation plugin: https://qt.gitorious.org/qt/qtmultimedia/source/0e280e78e2fe0f0417ca284f6b0d7a536a970bfd:src/plugins/avfoundation/camera/avfcamerasession.mm#L295
I have four OSes installed on a different hardware: MacOS 10.9, MacOS 10.8 and two MacOS 10.7
Strange, but two cameras work fine with 10.8 and one of the 10.7 machines. Another 10.7 machine and 10.9 machine do not allow to connect to the second camera with "Runtime camera error" message.
What can it be?
The solution was found.
The second camera could not be connected due to limitation of USB bandwidth. The QCamera doesn't allow to choose resolution and always connects to the maximum available (HD as usually).
We could reproduce the same behavior by writing the native AVFoundation based classes on our own. Then, we reduced the cameras resolution to a smaller one (e.g. 320x240) and two-three cameras worked great.
Hi and welcome to devnet,
Missing resolution selection might be (in lack of better terms) a missing feature for the OS X backend. You can check the "bug report system":http://bugreports.qt-project.org to see if it's something that's already been asked