Click here to Skip to main content
15,891,372 members
Articles / Multimedia / DirectX
Article

Programming DirectShow applications in C#: A set of tutorials

Rate me:
Please Sign up or sign in to vote.
4.79/5 (46 votes)
6 Oct 20052 min read 406K   22.7K   128   88
A collection of tutorials for programming DirectShow in C#.

Sample Image

Introduction

Besides the Microsoft SDK documentation, the information needed to program DirectShow applications is limited. This web site supplies many of the most useful references for programming these applications in C#. In order to continue this tradition, I have created a help file (.chm) that contains ten tutorials that illustrate how DirectShow applications can be written in C#.

Background

In general, the resources for programming DirectShow applications are scarce. In the past few months, I have written many tutorials that illustrate how to perform many common tasks in DirectShow with C#. I have put all these tutorials in one .chm file and provided access to all the source code samples from it. Moreover, the CodeProject web site has a nice messaging system to support the users of the code provided on this site, which should make these tutorials even more useful.

Using the code

I have provided a Visual Studio project file for each tutorial, and I have also included a .cmd file to compile it from the command line. Sometimes, these .cmd files contain references that need to be changed to reflect your local settings. I have mentioned these in the tutorial "readme.txt" file. Some tutorials will only run on 32-bit machines.

Points of Interest

The tutorials show how a simple multimedia player, a simple capture, a jukebox, and an append utility application can be written. Moreover, we have implemented versions of the Picture-In-a-Picture, custom allocator/presenter, custom image compositor samples from the DirectShow SDK in C#. And we have implemented the functionality of the EzRbg24 filter in C#.

Limitations and known issues

As mentioned previously, some samples will only work correctly on 32-bit machines. Moreover, I don't claim that these are optimal solutions. Many years ago, when I was teaching a VC++/MFC class, one student asked me where I was taking the code that I was using during the lectures. I replied that I had two directories with more than eighty samples in each of them, that I had written over a while. I was just picking some of these and brushed them up a little before presenting them and asking the students to modify or extend them (during the lectures or for assignments). I give these samples in the same spirit; but I'm still a long way from having more than hundred and sixty samples to chose from ;-)

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
You can read my blog entries at:
http://wwww.informikon.com/blog/

Comments and Discussions

 
QuestionBuilding a DirectShow application Pin
Maynka27-Mar-07 1:59
Maynka27-Mar-07 1:59 
AnswerRe: Building a DirectShow application Pin
daniel04929-Mar-07 3:37
daniel04929-Mar-07 3:37 
QuestionCan't find the resource file Pin
xpertsolutions18-Jan-07 13:15
xpertsolutions18-Jan-07 13:15 
AnswerRe: Can't find the resource file Pin
daniel04921-Jan-07 4:59
daniel04921-Jan-07 4:59 
GeneralThrow the pointer to unmanaged Pin
chernobyl24-Nov-06 20:37
chernobyl24-Nov-06 20:37 
GeneralRe: Throw the pointer to unmanaged Pin
daniel04925-Nov-06 7:24
daniel04925-Nov-06 7:24 
GeneralThank you and question Pin
John Whiteman22-Sep-06 3:35
John Whiteman22-Sep-06 3:35 
GeneralRe: Thank you and question Pin
daniel04924-Sep-06 5:50
daniel04924-Sep-06 5:50 
I don't use MSN Messenger so I'm not entirely clear on what you're trying to do. But from your description, it seems that you'll need to implement a DirectShow fitler.

These tutorials doesn't cover this field. I have another article here that shows how to prototype DS filters in C#. But the best way to go is the base classes and C++.

The two interfaces that you'd need to add to the Ball filter (a sample in the DS sdk) are small and it might not be too difficult to do. But if you're new to DirectShow filter programming, you'll have some studying to do and the only real doc is the section in the DS documentation. No book on the subject but a few articles (Google "DirectShow filter programming").

Hope this will get you started,

-daniel
GeneralRe: Thank you and question Pin
John Whiteman24-Sep-06 9:48
John Whiteman24-Sep-06 9:48 
GeneralCan't read help file. Pin
Michael Fogle21-Sep-06 5:58
Michael Fogle21-Sep-06 5:58 
GeneralRe: Can't read help file. Pin
daniel04921-Sep-06 6:07
daniel04921-Sep-06 6:07 
GeneralRe: Can't read help file. Pin
Michael Fogle21-Sep-06 6:12
Michael Fogle21-Sep-06 6:12 
GeneralRe: Can't read help file. Pin
Member 73093922-Mar-08 11:52
Member 73093922-Mar-08 11:52 
GeneralThanks for excellent work Pin
Tunca Bergmen14-Apr-06 2:35
Tunca Bergmen14-Apr-06 2:35 
GeneralRe: Thanks for excellent work Pin
daniel04914-Apr-06 8:10
daniel04914-Apr-06 8:10 
GeneralNetwork Streaming Pin
duzinga17-Mar-06 21:23
duzinga17-Mar-06 21:23 
GeneralRe: Network Streaming Pin
daniel04918-Mar-06 7:27
daniel04918-Mar-06 7:27 
GeneralRe: Network Streaming Pin
duzinga21-Mar-06 14:41
duzinga21-Mar-06 14:41 
GeneralRe: Network Streaming Pin
daniel04923-Mar-06 2:27
daniel04923-Mar-06 2:27 
GeneralRe: Network Streaming Pin
bignev7225-Jan-07 1:16
bignev7225-Jan-07 1:16 
GeneralRe: Network Streaming Pin
salmanMEng14-Apr-07 9:37
salmanMEng14-Apr-07 9:37 
GeneralPlayCap Sample Pin
Freddy#18-Dec-05 22:28
Freddy#18-Dec-05 22:28 
GeneralRe: PlayCap Sample Pin
daniel04919-Dec-05 3:04
daniel04919-Dec-05 3:04 
GeneralRe: PlayCap Sample Pin
Freddy#19-Dec-05 6:02
Freddy#19-Dec-05 6:02 
GeneralRe: PlayCap Sample Pin
daniel04919-Dec-05 13:03
daniel04919-Dec-05 13:03 

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.