Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DirectShow camera question

Status
Not open for further replies.

nextgengamer

Programmer
Apr 20, 2003
7
US
Hello All,

I've been doing some research on a project I've just started.

I'm trying to get access to the data from a USB webcam and modify the screen data.

Right now I'm looking over the PlayCap demo that comes with the Directx 8.1 SDK. The demo opens a window and shows the data from the camera. However, I really need something along the line of an array that contains the RGB info for the picture.

If anyone can help me with this I would appreciate it.
I can be reached at :

AIM : nextggamer
ICQ : 262891564
MSN : nextgengamer@hotmail.com

Please if you can help contact me.

Thanks,

Nextgengamer
 
you could capture each frame of image to bitmap and then access the bitmap pixels
 
A coworker of mine did exactly what you are trying to do. The way he did it was he wrote a class that implements ISampleGrabberCB. Then he used DirectShow to construct a filter graph consisting of:

video capture source --> SampleGrabber --> null renderer

Then he used the ISampleGrabber interface of the SampleGrabber filter to set the desired video format, using SetMediaFormat (e.g. RGB 24-bit) and then SetCallback to connect the grabber to his ISampleGrabberCB implementation.

With the captured bitmaps, I wrote a program which manipulates them and then paints them on the screen using an ordinary BitBlt call in the Windows GDI.

You can find more information by looking up "ISampleGrabber Interface" in the DirectX 9.0 SDK online help.

Another thing you could do is make your own DirectShow filter and insert it between the source and renderer filters. Then as the video frames arrive, you can manipulate them however you want before forwarding them downstream.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top