Sample Grabbing on Windows XP

Feb 2, 2010 at 1:26 PM

Hi! Great work you've done with this library Thank you.

I found it really useful, specially for me that have very little (if not zero) background on video processing software programming.

 

Here's a little problem I'm running into. I'm using your library to display a webcam live video on a WPF application. I'm also showing the user a "Capture" button, that is intended to take a picture.

My Window is subscribed to the NewVideoFrame event of VideoCaptureElement, and I've set the EnableSampleGrabbing property to "true". However, the event never gets fired on my development computer (Windows XP SP3, DirectX 9.0c), but if a try the same application on a Windows 2008 PC, it works as expected.

Is there any compatibility issues with my current development PC configuration? If that's the case, is there any quick fix I can try to make it work? If not, I'll finally be forced to upgrade to Windows 7 or similar....

 

Thanks in advance!

Gonzalo

Feb 2, 2010 at 3:50 PM

I am experiencing a similar problem.  I believe its only recentally occured.  Could be something to do with a Windows update perhaps?

Feb 3, 2010 at 2:57 PM

Hi, I had the same problem. I don't know the cause of it, but I found a solution that worked for me and may work for you as well. Checkout my post on Dec 15, "Sample grabber does not invoke callback function / no live webcam image".

Feb 4, 2010 at 2:10 PM

Hi, thanks for the reply. I've read your post before, but that didn't work for me.

This is the code I have on the SetupGraph method on VideoCapturePlayer:

 

if (EnableSampleGrabbing)
{
    m_sampleGrabber = (ISampleGrabber)new SampleGrabber();
    SetupSampleGrabber(m_sampleGrabber);
    hr = m_graph.AddFilter(m_sampleGrabber as IBaseFilter, "SampleGrabber");
    DsError.ThrowExceptionForHR(hr);
}

There's no "videoOutPin" variable on the version of the code taht I have.

Feb 4, 2010 at 3:42 PM
Edited Feb 4, 2010 at 3:45 PM

The code I modified is from changeset 31944. Download the source code from changeset 31944 (you find that under the "Source Code" tab), replace the original code block with the modified one, and see if it works. BTW, try the newest changeset (currently 38556) as well.

Feb 4, 2010 at 4:09 PM

Nevermind... Tried updating the driver for the camera and now it works (I was using the default windows driver for USB cameras).

Only problem now seems to be that the playback is not so smooth...

 

Thanks again for your time!!

Gonzalo