Q1: Where are the docs for this library?
Start with the Readme.txt in the root of the project. It will guide you to the docs.
Also, each of the samples includes a readme containing information specific to that
Q2: But these docs don't tell me how to use DirectShow. Where do I find the REAL docs?
This library is just a mapping to allow for the MS DirectShow interfaces to be called from c#. If you want to know how to use the MS DirectShow Interfaces, you should check out the MS DirectShow docs. Among other places, you can find a copy of them online at http://msdn2.microsoft.com/en-us/library/dd375454(VS.85).aspx.
The library has a (very) few helper classes beyond what DS provides. Those are documented
in the Readme.rtf.
Q3: I want to know how to do <...> with DirectShow. How can I figure this out?
Your first source of information should be the DirectShow docs. MS has a large amount of documentation, both general theory of DirectShow as well as reference. Start with that.
Secondly, you should try some of the DirectShow forums. MS has one here:
And probably several more elsewhere.
Lastly, if you question is specific to using DirectShow with c#, try the forum at
Q4: Why is the SourceForge forum listed last? Isn't that where this library is?
There are more people hanging out at the MSDN forums that answer questions than
there are at the SF forum. Also, the people at the MSDN forum have been writing
commercial apps with DS for many years. While they may not know much about c#, they
are wizards with DS. If you have a general "How Do I..." question, they
are a great resource. Once you know how to do it, if you can't figure out how to
do it in c#, THEN go to the SF forum.
Q5: Is there a book on this stuff?
"Programming Microsoft DirectShow for Digital Video and Television (Paperback)" by Mark D. Pesce might be a good place to start. Don't expect much about c#, however. Further, some reviewers have described the book as "MSDN with an index and on paperback.".
“Programming Microsoft DirectShow” by Michael Linetsky is also available.
Q6: How about other links/websites?
A fellow by the name of "The March Hare" has collected a great set of
resources for DirectShow. Check out his web site at
Q7: (How) can I work with multiple video devices at the same time?
<sigh> It is hard to answer this question without sounding sarcastic. Here is code from one of the samples (DxLogo):
const int VIDEODEVICE = 0; // zero based index of video capture device to use
Gee, now how could you POSSIBLY modify this to start a second video device? If you
want to know what effect changing this from a 0 to a 1 has, single step thru the
code and watch. It isn't that complex.
Q8: I'm too lazy to learn how to write all this myself. Would you please write me a commercial ready app for free and give me the source so I can sell it and make a lot of money?
The developers on this project write code for a living. We have aleady donated many
man-hours of labor to bring you this library, so don't be greedy. On the other hand,
if you want to HIRE one of us to write your code for you, that is different.
Q9: Where do I find the BaseClasses? How do I write a filter in c#?
The base classes have not been translated to be used from .NET. After two attempts to do so, well, let's just say they weren't designed with managed code in mind.
That said, however, you do still have choices. First of all, you can use the sample grabber to capture video frames. These frames can be edited however you like before letting them continue on to the next filter in the graph. See the DxLogo sample (among others) for how this is done.
Secondly, you can write a DirectX Media Object (DMO). There are two samples included with the lib that show how this is done. While there are limitations on DMOs that regular filters don't have, you may find those limitations aren't a problem for you. There are extensive docs (including a CHM file) that talk about how to do this.
Thirdly, there is a sample named GSSF. You can use this if you want to create a source filter (ie the filter in the graph that generates the stream).
Q10: My code is leaking. What is going wrong?
While there could be a number of things, there are a few key things to look at. First of all, COM uses a number of ways to allocate memory. Some of these ways are NOT automatically released the way most memory allocations in c# are. Check out the section on "Releasing memory to avoid leaks" in Readme.rtf.
Second, c# uses garbage collection to handle memory management. As a result, COM objects which can hold both memory and threads, may not get released in a timely fashion. Some of this can be dealt with by using Marshal.ReleaseComObject. See the "How and when to use Marshal.ReleaseComObject" section of Readme.rtf.
As a general statement, if dropping a few GC.Collect() statements into your code
clears up the "leak", then it isn't a leak. It is a normal side effect
of c# memory management.
Q11: I can see the interface (or struct) in the source, but when I try to use it, .NET says it isn't there.
You are probably using an interface we haven't tested yet. See "Using untested
interfaces" and "The plan for additional interfaces" in Readme.rtf
Q12: Licensing questions.
The licensing terms are described in the LGPL. If you want legal advice concerning the LGPL, you would probably do better speaking with a lawyer than a programmer. Also, it is not appropriate for us to make statements regarding the licensing beyond what is in the LGPL, since it could be argued that those statements are implicit additions to the licensing.