Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Capturing frames from a webcam Posted by yov408 on 23 Sept 2003 at 3:30 AM
Hello,

I am trying to capture frames from a webcam. I am using the vfw library with the capture macros. However, for the moment I only managed to playback the webcam in a window. I want to intercept the frames *before* they are displayed, for further processing.

The macro capGrabFrameNoStop(hWnd) seems to be appropriate.
But the problem is that it only displays the actual frame on the capture window. I want to intercept this frame before it is displayed.
The point is not to actually see what the camera sees but process it.

Thanx for the help

fred

Report
Re: Capturing frames from a webcam Posted by yov408 on 23 Sept 2003 at 1:06 PM
After further searches the only way to access raw data of a captured frame seems to be via interupt functions set by the capvideostreamcallback() macro. Every time a new frame is available in the streaming buffer, the interrupt function is called and send a parameter VIDEOHDR, that should contain the actual frame raw data.

Any further explanation would be greatly appreciated,

cheers
Report
Re: Capturing frames from a webcam Posted by yov408 on 25 Sept 2003 at 10:38 AM
Okay, I'm talking to myself, but anyways it was indeed the VIDEOHDR structure which is passed to the callback fuunction which contains the frame data. The data is in the lpData member of the structure VIDEOHDR. The encoding of this raw data seems to depend on the webcam possibilities and model. I use a Philips TouchCam, and the raw data is encoded in YUV420 format. Mail me for further informations.
Report
Re: Capturing frames from a webcam Posted by Johnny13 on 27 Sept 2003 at 2:16 AM
hm,is VIDEOHDR a user-defined structure?
well I also have a little Genius webcam,but I believe the format is 160x120~640x480 RGB24
Report
Re: Capturing frames from a webcam Posted by yov408 on 27 Sept 2003 at 7:24 AM
No, in fact VIDEOHDR is a structure part of MSDN. It is passed to the frame callback function as a parameter.
It's contents is described here :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_videohdr_str.asp

The encoding of the frames depends on the webcam. My stupid philips, encodes the frames in a YUV420 format which is not as easy as RGB24 to decode :)




Frdric Patin
--------------------------
YOV408 Technologies
http://yov408.free.fr
yov408@free.fr
--------------------------




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.