Video capture (webcam) problem when window is not in focus

Video capture (webcam) problem when window is not in focus

Post by JohnJ » Wed, 14 Aug 2002 14:45:30



Hello,

I'm writing a simple video capture application using VB (and
avicap32.dll) for my college project. The application captures the
video (from the * device) and writes it to a BMP file (using
capFileSaveDIB) every minute (using a Timer control). The only problem
I'm facing is that the application doesn't capture the live frame(s)
when the application window is minimized or loses focus. In such a
case the application captures the last frame in buffer before the
window was minimized or it lost the focus. I'm not sure why this
happens. Can you please guide me on how to fix this problem.

I've come to notice that it's not a driver or hardware specific issue.
It's a coding thing since another application called iSpy
(www.ispy.nl) captures the images just fine when it's capture window
is minimized or loses focus.

Any help is appreciated. Thanks!

 
 
 

Video capture (webcam) problem when window is not in focus

Post by Ray Merce » Tue, 20 Aug 2002 10:21:05


[ comp.lang.visual.basic, alt.comp.periphs.* and
microsoft.public.vb.general.discussion snipped from gratuitous cross-post...]

John,

Quote:> capFileSaveDIB) every minute (using a Timer control). The only problem
> I'm facing is that the application doesn't capture the live frame(s)
> when the application window is minimized or loses focus. In such a
> case the application captures the last frame in buffer before the
> window was minimized or it lost the focus. I'm not sure why this
> happens. Can you please guide me on how to fix this problem.

Before calling capFileSaveDIB call capGrabFrame or capGrabFrameNoStop.  This
will update the buffer even when the window is hidden.  I believe this will work
on all VFW devices.

Hope this helps,
Ray Mercer