How do i render a web cam filter instead of video file in directshow?

Posted by Mr Bell on Stack Overflow See other posts from Stack Overflow or by Mr Bell
Published on 2010-05-16T19:40:59Z Indexed on 2010/05/16 19:50 UTC
Read the original article Hit count: 287

How do i render a web cam filter instead of video file? I am looking at the vmr9compositor example included in the directshow sdk. It renders a video file. I would like to stream in the feed from the webcam. It SEEMS like this should be possible, but I dont have much of a grasp on directshow.

It uses this method call currently:

hr = g_graph->RenderFile( pFileName, NULL );

Looking at the playcap example in the sdk which can display the web cam feed in a window, I see that it uses

hr = g_pCapture->RenderStream (&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, pSrcFilter, NULL, NULL));

to display the web cam stream. pSrcFilter is an IBaseFilter.

How can I can swap the video file in the vmr app with the web cam feed?

Windows XP, Visual Studio 2008 C++

© Stack Overflow or respective owner

Related posts about c++

Related posts about visual-studio-2008