Click here to Skip to main content
15,943,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)

I am trying to find an example of a virtual directshow source filter where it shows how to incorporate Video and audio in one filter. I have seen a set of excelent sample filters in a project contributed by Maxim Kartavenkov where he show how to create DS filters with pure C#. Can anyone point me to the right direction in how to go about it?

Many thanks,



Thanks for reading my articles.

You need add the additional pin for audio. But not many appliations handle 2 outputs with different types in Video Capture category (This way you can try in Adobe Live Encoder app). You can register one filter in 2 categories with 2 output pins and in each category will be used separate instance of the filter - this equal to creating 2 filters one for audio and one for video, but if you have one source for audio and video - this will not works proper that way. So you need the way to proper share you data within those 2 filters (audio and video). This can be done in couple of ways example: creating service which will do sharing data or app or other way. Sharing you can make via GMFBridge, named pipes, sockets, shared memory and so on. Another issue here is if user have multiple instances of your video filter. So you should handle all those aspects.

Share this answer
Serpo 15-Oct-12 21:54pm    

Thanks for your response. It makes a lot of sense.
Regarding your Network Sync and Source Filters, how do I go about adding Audio to the filters? I would like to transmit audio as well. Do you have a sample project that demonstrate this?

Thanks for your help,

Maxim Kartavenkov 16-Oct-12 1:26am    
Audio works same way, but you should takes care about output format - notify the source filter with format you sending. For testing you can hardcode output format, or if you planing to transfer PCM data you can do resampling on input and send fixed format so all sources will knows it. Along with that you need to make buffering of received data, and delivery without drops.

Serpo 26-Oct-12 22:20pm    
Hi Maxim,

How do I go about implementing an output Close captionng pin? I am using one of your virtula source filter as the foundation. I just don't know how to creat a pin and assinged it to be an output pin that support CC. My goal is to feed 708 close captioning in RAW format.


Maxim Kartavenkov 27-Oct-12 0:32am    
Create your class for pin inherit it from SourceStream implement GetMediaType DecideBufferSize and FillBuffer.
My classes are much similar to native:

i have find code who can play or webcam display video using directshow.dll i want to gove address of networkIP Camera which display video..can anybody tell me code in c#
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900