Click here to Skip to main content
Click here to Skip to main content

DirectX.Capture Class Library (Refresh)

, 3 Apr 2007 MIT
Rate this:
Please Sign up or sign in to vote.
An update to the DirectX.Capture project


This project is a small update to the excellent DirectX.Capture library by Brian Low (see his article here).

I have made two changes:

  • The original was based on a managed DirectShow library here on CodeProject (DirectShow.NET). While that project is still a good learning aid, it has not been updated for several years (the graphics on the project page still refer to DirectX 8.1!). I therefore changed this capture library to use the DirectShow.NET project at (SourceForge), which is still being updated (last release was in August '06).
  • I changed the solution from a VS 2003 project to a VS 2005 one.
All functionality, method signatures, class names, etc. are unchanged.

Using the code

Please see the original article by Brian Low (DirectX.Capture Class Library) for info on using this library

Points of Interest

For the most part, upgrading this library was very straightforward. I just removed the reference to the old DirectShow library, added a reference to the new one, updated the "using" directives, and started fixing what was broken until the project would build successfully. Fortunately, since both the old and new DirectShow libraries are just managed wrappers for the same DirectShow classes, the vast majority of class names, properties, and method signatures were identical between the two libraries.

The difficulties were places where the newer DirectShow library has introduced cleaner code (such as replacing integer constants with enumerations and pointer references with class references). Most of the fixes were repetitive patterns of replacing blocks of code with "prettier", more managed versions. There were, however, one or two instances where I actually had to regress the code in the opposite direction.

While the new DirectShow library is more complete (in the sense that it has abstracted away a larger percentage of the underlying C++ details), it is by no means 100% complete, and there still exist some ugly bits in it. As the folks at the SourceForge project hack away at the remaining pieces, I will update this project to incorporate their changes.

A warning: while I have tested the code and everything seems to work great, I have not gone over it in thorough detail. It is certainly possible that due to slight differences in how the two DirectShow libraries wrap the C++ classes, I broke something when translating the code. I kept my changes to a minimum, but I would not be surprised to find errors. Let me know if you find anything, and in the meantime, caveat emptor.


Mar 2007 - refresh based on DirectShow.NET 1.5/VS 2005


This article, along with any associated source code and files, is licensed under The MIT License


About the Author

Jacob Klint
Software Developer
United States United States
No Biography provided

Comments and Discussions

GeneralFix for hack in Filter.cs PinmemberFelix Collins8-Oct-09 16:42 
Generalpixels capture PinmemberMichał Janic5-Oct-09 10:41 
GeneralRe: pixels capture PinmemberJacob Klint5-Oct-09 12:33 
QuestionNew Release? PinmemberS,J.M.6-May-09 10:21 
GeneralHelp Required PinmemberSaquib Kamran6-Apr-09 4:33 
GeneralIVideoProcAmp Interface in DirectShowLib Pinmemberanki12328-Mar-09 4:21 
GeneralManage colors during Capturing Pinmemberanki12310-Mar-09 1:45 
Questioncan i use Color Space Converter Filter to change bit depth? PinmemberPedro Zamuner13-Feb-09 10:06 
Generalpreview Pinmemberdbbtvlzfpz22-Sep-08 3:13 
GeneralRe: preview PinmemberJacob Klint30-Sep-08 14:36 
GeneralCaptureTest code is still old Pinmemberhungtdao29-Jul-08 11:50 
GeneralCaptur HD Video PinmemberMaryam.R9-Jun-08 1:49 
GeneralBrian Low posted newer code at wiki site... PinmemberRobert Lathan4-Jun-08 12:29 
QuestionAudio and video are out of sync (with compression) PinmemberWebrat4-Dec-07 15:40 
GeneralRe: Audio and video are out of sync (with compression) PinmemberFelix Collins25-Feb-08 13:31 
QuestionCapturing snapshots Pinmemberlalopepe8-Aug-07 6:52 
QuestionCapture video with audio from a DV Firewire Cam Pinmembereshy200730-Jul-07 2:52 
QuestionProblem with FormatType DVInfo Pinmemberdaa2425-Jul-07 0:27 
Questionwhat is the exception ? Pinmemberpastime_wang18-Jul-07 1:31 
QuestionI want to ask about the class u offered to capture the frame Pinmemberaishar27-Jun-07 8:43 
AnswerRe: I want to ask about the class u offered to capture the frame Pinmemberalmere1093-Jul-07 9:47 
GeneralRe: I want to ask about the class u offered to capture the frame Pinmemberthwaites27-Jul-07 0:10 
GeneralRe: I want to ask about the class u offered to capture the frame Pinmemberalmere10927-Jul-07 9:21 
GeneralRe: I want to ask about the class u offered to capture the frame Pinmemberalmere10928-Jul-07 11:22 
GeneralRe: I want to ask about the class u offered to capture the frame Pinmemberalmere1092-Aug-07 1:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150224.1 | Last Updated 3 Apr 2007
Article Copyright 2007 by Jacob Klint
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid