Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

DirectShow camera question

DirectShow camera question

DirectShow camera question

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.



RE: DirectShow camera question

you could capture each frame of image to bitmap and then access the bitmap pixels

RE: DirectShow camera question

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close