I recently started using IVT, and I find that some webcams work, and some don't. The one that doesn't work is a Philips PCVC690K. In the CaptureApp, it does open the camera, but it fails to capture and falls through immediately. This webcam is fine in combination with e.g. NetMeeting. Could it be the picture format? How to diagnose this?
Thanks for any help.
I assume you are using Windows (since you mentioned NetMeeting) and thus the CVFWCapture module?
Does "fall through" mean that it exits without any errors or crashing? The application doesn't print "error: could not open camera" in the console window?
To get a first hint you could print out the contents of the variables width, height, type, nCameras, right after they are defined.
Are you familiar with debugging with the Visual Studio? Switching to debug mode and stepping through the code during execution is often very helpful...
Unfortunately I don't have a camera here that produces the same problems.
No error messages, no crashes. Behaviour is the same on Win98se and WinXP SP3. Stepping through the code reveals:
width = 176
height = 144
type = eRGB24
nCameras = 1
(This is not the max. resolution, b.t.w.)
It breaks in function CVFWCapture::CaptureImage() on this condition:
if (!m_bCameraOpened || !m_hCaptureWnd || !ppImages || !ppImages || m_nWidth != ppImages->width || m_nHeight != ppImages->height || m_nBitsPerPixel != ppImages->bytesPerPixel * 8)
m_nBitsPerPixel = 12
ppImages->bytesPerPixel * 8 = 3 * 8 = 24
B.t.w., it's not good practice to return from a critical section this way.
Apparently, this cam has something like a 420 format.
How can this be made working?
thank you for pointing to the problem with the critical sections - it has been fixed in the version 1.3.2 of the IVT.
I have also prepared the class CVFWCapture for other color encodings. If you want to add the handling of Y'UV 420p (or whatever encoding your camera uses), I will be happy to integrate your code in the next version. For instance, there is some available on this topic on:
Unfortunately I don't have such a camera myself. If you want, you can also send me a file with the raw data of one image. Then I could take care of implementing a conversion routine - but I can't promise when this will be.
Thanks. Another site that has useful info on this webcam is http://www.pk3.org/Astro/index.htm?astrophoto_vesta_pro.htm
Half way down that page there's some details on the data stream.
Using the Wiki formulas, I was able to modify the function CVFWCapture::CaptureImage in file C:\Program Files\IVT\src\VideoCapture\vfwcapture.cpp. Note that the FlipY should not be used in this case.
I can send you the code, but it's not optimized in any way. The picture looks ok to me. If I can help with testing your code for this web cam, let me know.
that sounds good! If you send me the code I can release the update with the next version (maybe slightly optimized).
You can find my e-mail address on the contact page of the IVT homepage (http://ivt.sourceforge.net).
I sent you some code that happens to work for me on Win XP and supports my cameras with I420 and YUY2 formats.
thank for the code! Your update is available with the current version 1.3.3 of the IVT.