Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: DirectShow Video Capture

46 views
Skip to first unread message

The March Hare (MVP)

unread,
May 4, 2004, 8:34:55 AM5/4/04
to
"Div" <anon...@discussions.microsoft.com> wrote in message
news:2C0C6397-1ED2-46A6...@microsoft.com...
> I want a sample displaying video from video source using
directshow like playcap and AmCap but in which the following functions must
be there.
>
> Preview - To set preview mode

If the source has a preview pin you can just render it using
ICaptureGraphBuilder::RenderStream. Not all video sources have a preview
pin. If they don't you can use a Smart Tee filter in your graph to
implement a preview. The DVapp sample shows use of the Smart Tee.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/htm/smartteefilter.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/htm/usingthesmartteefilter.asp


> Overlay - To set overlay mode

There is a sample filter called OvTool on http://www.gdcl.co.uk. As noted
in the docs for the Ovleray Mixer, the VMR9 is now the preferred except if
you need VPE:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/htm/overlaymixerfilter.asp

Peter

unread,
May 12, 2004, 3:06:01 PM5/12/04
to
The other option you can use is the "vide capture: the simple approach"

http://msdn.microsoft.com/library/en-us/multimed/htm/_win32_video_capture.3a_.a_minimal_approach.asp

Basically you accomplish task with few lines of code (the example provided
is not in C or any language, is just a pseudocode):

hwndC = capCreateCaptureWindow("Video Capture", _Or(WS_CHILD,WS_VISIBLE,
WS_DLGFRAME),0,0,640,480, WindowPTR,7777) // WindowPTR = owner or parent of
the capture window

SendMessage( hwndC, WM_CAP_DRIVER_CONNECT, wIndex, 0L ) // WIndex: Capture
Device 0->9

// check if device is able to use overlay
// use SendMessage( Self:pCap, WM_CAP_DRIVER_GET_CAPS, nSize, oCaps )
// where oCaps is a pointer to the structure CAPDRIVERCAPS and nsize is the
size of the pointer

// If oCaps.fHasOverlay
SendMessage( hwndC, WM_CAP_SET_OVERLAY, 1, 0L ) > 0

//Else
// if not overlay is possible then do normal preview using the next two
lines
SendMessage(hwndC,WM_CAP_SET_PREVIEWRATE,15,0L) //Frame display rate en
milisegundos
SendMessage (hwndC, WM_CAP_SET_PREVIEW, 0, 0L)
//Endif

Regards


HPeter

0 new messages