Click here to Skip to main content
14,272,438 members

DirectX.Capture Class Library (Refresh)

Rate this:
4.83 (8 votes)
Please Sign up or sign in to vote.
4.83 (8 votes)
3 Apr 2007MIT
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 Pin
Felix Collins8-Oct-09 15:42
memberFelix Collins8-Oct-09 15:42 
Generalpixels capture Pin
Michał Janic5-Oct-09 9:41
memberMichał Janic5-Oct-09 9:41 
GeneralRe: pixels capture Pin
Jacob Klint5-Oct-09 11:33
memberJacob Klint5-Oct-09 11:33 
QuestionNew Release? Pin
S,J.M.6-May-09 9:21
memberS,J.M.6-May-09 9:21 
GeneralHelp Required Pin
Saquib Kamran6-Apr-09 3:33
memberSaquib Kamran6-Apr-09 3:33 
GeneralIVideoProcAmp Interface in DirectShowLib Pin
anki12328-Mar-09 3:21
memberanki12328-Mar-09 3:21 
GeneralManage colors during Capturing Pin
anki12310-Mar-09 0:45
memberanki12310-Mar-09 0:45 
Questioncan i use Color Space Converter Filter to change bit depth? Pin
Pedro Zamuner13-Feb-09 9:06
memberPedro Zamuner13-Feb-09 9:06 
Generalpreview Pin
Pravinc198422-Sep-08 2:13
memberPravinc198422-Sep-08 2:13 
GeneralRe: preview Pin
Jacob Klint30-Sep-08 13:36
memberJacob Klint30-Sep-08 13:36 
GeneralCaptureTest code is still old Pin
hungtdao29-Jul-08 10:50
memberhungtdao29-Jul-08 10:50 
GeneralCaptur HD Video Pin
Maryam.R9-Jun-08 0:49
memberMaryam.R9-Jun-08 0:49 
GeneralBrian Low posted newer code at wiki site... Pin
Robert Lathan4-Jun-08 11:29
memberRobert Lathan4-Jun-08 11:29 
QuestionAudio and video are out of sync (with compression) Pin
Webrat4-Dec-07 14:40
memberWebrat4-Dec-07 14:40 
GeneralRe: Audio and video are out of sync (with compression) Pin
Felix Collins25-Feb-08 12:31
memberFelix Collins25-Feb-08 12:31 
QuestionCapturing snapshots Pin
lalopepe8-Aug-07 5:52
memberlalopepe8-Aug-07 5:52 
QuestionCapture video with audio from a DV Firewire Cam Pin
eshy200730-Jul-07 1:52
membereshy200730-Jul-07 1:52 
QuestionProblem with FormatType DVInfo Pin
daa2424-Jul-07 23:27
memberdaa2424-Jul-07 23:27 
Questionwhat is the exception ? Pin
pastime_wang18-Jul-07 0:31
memberpastime_wang18-Jul-07 0:31 
QuestionI want to ask about the class u offered to capture the frame Pin
aishar27-Jun-07 7:43
memberaishar27-Jun-07 7:43 
AnswerRe: I want to ask about the class u offered to capture the frame Pin
almere1093-Jul-07 8:47
memberalmere1093-Jul-07 8:47 
GeneralRe: I want to ask about the class u offered to capture the frame Pin
thwaites26-Jul-07 23:10
memberthwaites26-Jul-07 23:10 
GeneralRe: I want to ask about the class u offered to capture the frame Pin
almere10927-Jul-07 8:21
memberalmere10927-Jul-07 8:21 
GeneralRe: I want to ask about the class u offered to capture the frame Pin
almere10928-Jul-07 10:22
memberalmere10928-Jul-07 10:22 
GeneralRe: I want to ask about the class u offered to capture the frame Pin
almere1092-Aug-07 0:28
memberalmere1092-Aug-07 0:28 

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

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

Posted 3 Apr 2007


44 bookmarked