Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>With DirectShow you typically create a pipeline, that is a graph and you add filters to it, like this:</p> <p>Camera -> [possibly some extra stuff] -> Sample Grabber -> Null Renderer</p> <p>Camera, <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd377544%28v=vs.85%29.aspx" rel="nofollow noreferrer">Sample Grabber</a>, <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd377544%28v=vs.85%29.aspx" rel="nofollow noreferrer">Null Renderer</a> are all standard components shipped with clean Windows. Sample Grabber can be set to call you back via <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd376987%28v=vs.85%29.aspx" rel="nofollow noreferrer"><code>ISampleGrabberCB::SampleCB</code></a> and give you data for every video frame captured. Null Renderer is the termination of pipeline without displaying video on monitor (just video capture).</p> <p><code>SampleCB</code> is the keyword to bring you sample code you need. Having data received with this call, you can convert/wrap it into IPL/OpenCV class as suggested by @praks411.</p> <p>Having it done as simple as this, you don't need DirectShow BaseClasses, and the code will be merely regular ATL/MFC code and project. Make sure to use <code>CComPtr</code> wrapper class to deal with COM interfaces to not lose references and leak objects. Some declarations might be missing in very latest Windows SDK, so you need to either use Windows SDK 6.x or just copy missing parts from there.</p> <p>See also:</p> <ul> <li><a href="https://stackoverflow.com/questions/12680600/how-to-capture-frames-using-delphi-dspack-without-displaying-it-on-tvideowindow/12680676#12680676">How to capture frames using Delphi/DSPack without displaying it on TVideoWindow?</a> (Delphi code, but good description and figures)</li> <li><a href="http://www.codeproject.com/Articles/34663/DirectShow-Examples-for-Using-SampleGrabber-for-Gr" rel="nofollow noreferrer">DirectShow: Examples for Using SampleGrabber for Grabbing a Frame and Building a VU Meter</a></li> <li><a href="http://alax.info/trac/public/browser/trunk/Utilities/SetLifeCamStudioResolutionSample" rel="nofollow noreferrer">SetLifeCamStudioResolutionSample</a> - A small DirectShow project showing how to set capture up, including resolution on camera, and Sample Grabber, and also missing SDK declarations; related Q is <a href="https://stackoverflow.com/questions/7383372/cant-make-iamstreamconfig-setformat-to-work-with-lifecam-studio">Can&#39;t make IAMStreamConfig.SetFormat() to work with LifeCam Studio</a></li> <li><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd407288(v=vs.85).aspx#build_the_filter_graph" rel="nofollow noreferrer">Building the Filter Graph</a> on Sample Grabber and Null Renderer</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload