logo
Home About Downloads Documentation FAQ Links Forums

DirectShowNET Library

The purpose of this library is to allow access to Microsoft's DirectShow functionality from within .NET applications. This library supports both Visual Basic .NET and C#, and theoretically, should work with any .NET language.

Microsoft's managed solution to allowing access to DirectShow from .NET isn’t nearly as complete as the DirectShow interfaces for C++. For developers who want the complete range of functionality of DirectShow in .NET, this library provides the enums, structs, and interface definitions to access them.

Reviewing the source code will show that there is very little executable code in this library. There are a few helper functions (mostly in DsUtils.cs), but everything else in the library is just definitions.

Although there are ~541 interfaces defined in the source code, only some of them have been tested to ensure that they are working.  See ReadMe.rtf for a discussion about the difference between tested and untested.

DirectShowNET Samples

There are a number of samples included to show how to perform various common tasks. Note that these samples should not be considered commercial quality, but can form the basis of your own code.

DTViewer – Use BDA to display Digital TV into a Windows Form.

CapWMV – Capture from video capture devices to WMV files.

DxLogo – A sample application showing how to superimpose a logo on a data stream. It uses a capture device for the video source, and outputs the result to a file.

DxLogoVB – This is precisely the same sample as DxLogo, except that it's written in Visual Basic. Other than the tediousness of converting C# to VB, this was a trivial exercise.

DxPropPages – Show how to add compression filters to video capture, and show how to invoke the property pages for capture devices, and video compressors.

DxSnap – Use DirectShow to take snapshots from the Still pin of a capture device. Note the MS encourages you to use WIA for this, but if you want to do in with DirectShow and C#, here's how.

DxTuner – Shows how to capture from TV Tuners, including how to change channels.

PlayCap – A translation of the DirectShow PlayCap program to show how this would appear in c#.
This application creates a preview window for the first video capture device that it locates on the user's system (if any). It demonstrates a simple example of using the ICaptureGraphBuilder2 and ICreateDevEnum interfaces to build a capture graph.

DMOFlip – A DMO that can be used in a Directshow FilterGraph. This DMO allows video to be flipped on the X or Y axis (or both). There is a help file (IMediaObjectImpl.chm) showing how to write a DMO of your own.

DMOSplit – A DMO that splits a stereo audio signal into two mono streams.

DESCombine – A class library that uses DirectShow Editing Services to combine video and audio files (or pieces of files) into a single output file. A help file (DESCombine.chm) is provided for using the class.

DESCombineVB – A class library that uses DirectShow Editing Services to combine video and audio files (or pieces of files) into a single output file. A help file (DESCombine.chm) is provided for using the class.

DxScan – A sample application scanning a media file looking for black frames.

BlackList – This sample illustrate how to use the IAMGraphBuilderCallback interface to reject some filters during the graph creation. You can adapt this sample for your uses if some filters are known to break your application.

DxWebCam – A poor man's web cam program. This application runs as a Win32 Service. It takes the output of a capture graph, turns it into a stream of JPEG files, and sends it thru TCP/IP to a client application.

GMFPreview – A sample showing how to use Geraint's indispensible GMFBridge tool to allow part of a graph to be stopped while another part keeps running. This is useful to allow preview windows to keep running while you start/stop capturing to disk.

GSSF – The Generic Sample Source Filter – A way to implement a source filter in c#. If you have samples (for example video frames from bitmap files) that you want to use as a source in a graph, this filter will show you how.

Toolkit– A collection of useful utilities.

DvdPlay – A bare-bones sample showing how to play DVDs with DirectShow.

DxPlay – A sample application showing how to play media files (AVI, WMV, etc) and capture snapshots.

DxText – A sample application showing how to superimpose text strings on a datastream. The stream is read from an avi file.

EVRPlayer – This project is a c# translation of the c++ EVRPlayer sample that ships with the Windows SDK. It shows how to use the EVR renderer from DirectShow.

GMFPlay – A sample showing how to use Geraint's indispensible GMFBridge filter to play a collection of media files one after another.

PlayVB – A simple player in VB.

PlayWnd – A translation of the DirectShow PlayWnd program to show how this would appear in C#.
PlayWnd is a simple media player application with a minimal user interface.

DvrMsCutter – This sample extracts a segment of a dvr-ms file into another dvr-ms file.

DvrMsCutter2 – This sample extracts multiple segments of a dvr-ms file into another dvr-ms file.

BitMapMixer – BitmapMixer is an example of how to draw things over a video using VMR9.

VMR9Allocator – A translation of the DirectShow VMR9Allocator program to show how this would appear in c#.

VMR9Allocator2 – an alternative to the DirectShow VMR9Allocator program.

VMR9Compositor – This sample shows how to use the VMR9 custom compositor feature.

VMR9Snapper – This sample shows how to capture bitmaps from VMR9.


Interfaces

Tested interfaces ready to use:

IAMAnalogVideoDecoder IComponentTypes IMpeg2Demultiplexer
IAMAsyncReaderTimestampScaling IConfigAsfWriter IMPEG2PIDMap
IAMAudioInputMixer IConfigAsfWriter2 IMpeg2Stream
IAMAudioRendererStats IConfigAviMux IMPEG2StreamIdMap
IAMBufferNegotiation IConfigInterleaving IMPEG2TuneRequest
IAMCameraControl ICreateDevEnum IMPEG2TuneRequestFactory
IAMClockAdjust ICreatePropBagOnRegKey IMPEG2TuneRequestSupport
IAMClockSlave IDeferredCommand IMpegAudioDecoder
IAMCopyCaptureFileProgress IDigitalCableLocator IMultiMediaStream
IAMCrossbar IDigitalCableTuningSpace IObjectWithSite
IAMDecoderCaps IDigitalLocator IPAT
IAMDirectSound IDMOVideoOutputOptimizations IPersist
IAMDroppedFrames IDMOWrapperFilter IPersistMediaPropertyBag
IAMErrorLog IDTFilter IPersistStream
IAMExtDevice IDTFilter2 IPersistTuneXml
IAMExtendedSeeking IDTFilter3 IPersistTuneXmlUtility
IAMExtTransport IDTFilterConfig IPersistTuneXmlUtility2
IAMFilterMiscFlags IDVB_BAT IPin
IAMGraphBuilderCallback IDVB_EIT IPinConnection
IAMGraphStreams IDVB_NIT IPinFlowControl
IAMLine21Decoder IDVB_SDT IPMT
IAMMediaContent IDVB_TOT IPropertyBag
IAMMediaContent2 IDVBCLocator IPropertySetter
IAMMediaStream IDvbLogicalChannelDescriptor IQualityControl
IAMMediaTypeSample IDvbSatelliteDeliverySystemDescriptor IQualProp
IAMMediaTypeStream IDVBSLocator IQueueCommand
IAMMultiMediaStream IDVBSTuningSpace IReferenceClock
IAMOpenProgress IDvbTerrestrialDeliverySystemDescriptor IReferenceClockTimerControl
IAMOverlayFX IDVBTLocator IRegisterServiceProvider
IAMPluginControl IDVBTuneRequest IRenderEngine
IAMResourceControl IDVBTuningSpace IRenderEngine2
IAMSetErrorLog IDVBTuningSpace2 IResize
IAMStats IDvdCmd ISampleGrabber
IAMStreamConfig IDvdControl2 ISampleGrabberCB
IAMStreamControl IDvdGraphBuilder ISBE2Crossbar
IAMStreamSelect IDvdInfo2 ISBE2EnumStream
IAMTimeline IDvdState ISBE2FileScan
IAMTimelineComp IDVEnc ISBE2GlobalEvent
IAMTimelineEffect IDVRGB219 ISBE2GlobalEvent2
IAMTimelineEffectable IDVSplitter ISBE2MediaTypeProfile
IAMTimelineGroup IEnumComponents ISBE2SpanningEvent
IAMTimelineObj IEnumComponentTypes ISBE2StreamMap
IAMTimelineSplittable IEnumDMO ISectionList
IAMTimelineSrc IEnumFilters ISeekingPassThru
IAMTimelineTrack IEnumMediaTypes IServiceProvider
IAMTimelineTrans IEnumPins ISmartRenderEngine
IAMTimelineTransable IEnumStreamBufferRecordingAttrib ISpecifyPropertyPages
IAMTimelineVirtualTrack IEnumTuningSpaces IStreamBufferConfigure
IAMTuner IErrorLog IStreamBufferConfigure2
IAMTunerNotification IETFilterConfig IStreamBufferConfigure3
IAMTVAudio IEvalRat IStreamBufferDataCounters
IAMTVTuner IFileSinkFilter IStreamBufferInitialize
IAMVfwCompressDialogs IFileSinkFilter2 IStreamBufferMediaSeeking
IAMVideoCompression IFileSourceFilter IStreamBufferMediaSeeking2
IAMVideoControl IFilterChain IStreamBufferRecComp
IAMVideoDecimationProperties IFilterGraph IStreamBufferRecordControl
IAMVideoProcAmp IFilterGraph2 IStreamBufferRecordingAttribute
IAMWstDecoder IFilterGraph3 IStreamBufferSink
IAnalogAudioComponentType IFilterMapper2 IStreamBufferSink2
IAnalogLocator IFilterMapper3 IStreamBufferSink3
IAnalogRadioTuningSpace IFrequencyMap IStreamBufferSource
IAnalogRadioTuningSpace2 IGenericDescriptor IStreamSample
IAnalogTVTuningSpace IGetCapabilitiesKey ITuner
IAsyncReader IGraphBuilder ITunerCap
IATSCChannelTuneRequest IGraphConfig ITuneRequest
IATSCComponentType IGraphConfigCallback ITuningSpace
IATSCLocator IGraphVersion ITuningSpaceContainer
IATSCLocator2 IIPDVDec ITuningSpaces
IATSCTuningSpace IKsPin IVideoFrameStep
IAudioMediaStream IKsPropertySet IVideoWindow
IAuxInTuningSpace IKsTopologyInfo IVMRAspectRatioControl
IAuxInTuningSpace2 ILanguageComponentType IVMRAspectRatioControl9
IBaseFilter ILocator IVMRDeinterlaceControl
IBasicAudio IMediaBuffer IVMRDeinterlaceControl9
IBasicVideo IMediaControl IVMRFilterConfig
IBasicVideo2 IMediaDet IVMRFilterConfig9
IBDA_AutoDemodulate IMediaEvent IVMRImageCompositor
IBDA_DeviceControl IMediaEventEx IVMRImageCompositor9
IBDA_DigitalDemodulator IMediaEventSink IVMRImagePresenter9
IBDA_EthernetFilter IMediaFilter IVMRImagePresenterConfig
IBDA_FrequencyFilter IMediaLocator IVMRImagePresenterConfig9
IBDA_IPSinkControl IMediaObject IVMRMixerBitmap
IBDA_IPSinkInfo IMediaObjectInPlace IVMRMixerBitmap9
IBDA_IPV4Filter IMediaParamInfo IVMRMixerControl
IBDA_IPV6Filter IMediaParams IVMRMixerControl9
IBDA_LNBInfo IMediaPosition IVMRMonitorConfig
IBDA_SignalProperties IMediaPropertyBag IVMRMonitorConfig9
IBDA_SignalStatistics IMediaSample IVMRSurfaceAllocator9
IBDA_Topology IMediaSample2 IVMRSurfaceAllocatorEx9
IBDAComparable IMediaSeeking IVMRSurfaceAllocatorNotify9
IBDACreateTuneRequestEx IMediaStream IVMRVideoStreamControl
IBroadcastEvent IMediaStreamFilter IVMRVideoStreamControl9
IBroadcastEventEx IMemAllocator IVMRWindowlessControl
ICaptureGraphBuilder2 IMemAllocatorCallbackTemp IVMRWindowlessControl9
ICAT IMemAllocatorNotifyCallbackTemp IVPBaseNotify
ICCSubStreamFiltering IMixerOCX IVPManager
IChannelIDTuneRequest IMixerOCXNotify IVPNotify
IChannelTuneRequest IMixerPinConfig IVPNotify2
IComponent IMixerPinConfig2 IXDSCodecConfig
IComponents IMPEG2Component IXml2Dex
IComponentsNew IMPEG2ComponentType  
IComponentType IMpeg2Data  

These interfaces are in the source code, but have not been tested. See ReadMe.rtf for a discussion of untested interfaces.

IBDA_AUX IDvbMultilingualServiceNameDescriptor IISDB_NBIT
IBDA_ConditionalAccessEx IDvbNetworkNameDescriptor IISDB_SDT
IBDA_DigitalDemodulator2 IDvbParentalRatingDescriptor IISDB_SDTT
IBDA_DigitalDemodulator3 IDvbPrivateDataSpecifierDescriptor IIsdbAudioComponentDescriptor
IBDA_DiseqCommand IDvbServiceAttributeDescriptor IIsdbCAContractInformationDescriptor
IBDA_DRIDRMService IDvbServiceDescriptor2 IIsdbCADescriptor
IBDA_DRIWMDRMSession IDvbServiceListDescriptor IIsdbCAServiceDescriptor
IBDA_DRMService IDvbShortEventDescriptor IIsdbComponentGroupDescriptor
IBDA_Encoder IDvbSiParser2 IIsdbDataContentDescriptor
IBDA_EventingService IDVBSLocator2 IIsdbDigitalCopyControlDescriptor
IBDA_FDC IDvbSubtitlingDescriptor IIsdbDownloadContentDescriptor
IBDA_GuideDataDeliveryService IDvbTeletextDescriptor IIsdbEmergencyInformationDescriptor
IBDA_ISDBConditionalAccess IDvbTerrestrial2DeliverySystemDescriptor IIsdbEventGroupDescriptor
IBDA_MUX IDVBTLocator2 IIsdbHierarchicalTransmissionDescriptor
IBDA_NameValueService IESCloseMmiEvent IIsdbLogoTransmissionDescriptor
IBDA_TransportStreamSelector IESEvent IIsdbSeriesDescriptor
IBDA_UserActivityService IESEventFactory IIsdbSIParameterDescriptor
IBDA_WMDRMSession IESEvents IIsdbSiParser2
IBDA_WMDRMTuner IESEventService IISDBSLocator
IDigitalCableTuneRequest IESEventServiceConfiguration IIsdbTerrestrialDeliverySystemDescriptor
IDVB_EIT2 IESFileExpiryDateEvent IIsdbTSInformationDescriptor
IDvbComponentDescriptor IESIsdbCasResponseEvent IPBDA_EIT
IDvbContentDescriptor IESLicenseRenewalResultEvent IPBDA_Services
IDvbContentIdentifierDescriptor IESOpenMmiEvent IPBDAAttributesDescriptor
IDvbDataBroadcastDescriptor IESRequestTunerEvent IPBDAEntitlementDescriptor
IDvbDataBroadcastIDDescriptor IESValueUpdatedEvent IPBDASiParser
IDvbDefaultAuthorityDescriptor IGenericDescriptor2 IServiceLocationDescriptor
IDvbExtendedEventDescriptor IGpnvsCommonBase ISIInbandEPG
IDvbHDSimulcastLogicalChannelDescriptor IISDB_BIT ISIInbandEPGEvent
IDvbLinkageDescriptor IISDB_CDT ITunerCapEx
IDvbLogicalChannel2Descriptor IISDB_EMM ITuneRequestInfoEx
IDvbLogicalChannelDescriptor2 IISDB_LDT  

These interfaces are in the source code, but are deprecated, undocumented, intended for Ole Automation or otherwise untestable which means they are not, and will not be tested:

IAMAnalogVideoEncoder IBDA_PinControl IFullScreenVideo
IAMCertifiedOutputProtection IBDA_TIF_REGISTRATION IFullScreenVideoEx
IAMChannelInfo IBDA_TransportStreamInfo IGrfCache
IAMCollection IBDA_VoidTransform IGuideData
IAMDeviceRemoval IBPCSatelliteTuner IGuideDataEvent
IAMDevMemoryAllocator ICameraControl IGuideDataLoader
IAMDevMemoryControl ICaptionServiceDescriptor IGuideDataProperty
IAMExtendedErrorInfo ICaptureGraphBuilder IKsNodeControl
IAMFilterGraphCallback ICodecAPI IMediaSample2Config
IAMLatency IDDrawExclModeVideo IMediaTypeInfo
IAMNetShowConfig IDDrawExclModeVideoCallback IMemInputPin
IAMNetShowExProps IDecimateVideoImage IMemoryData
IAMNetShowPreroll IDirectDrawMediaSample IMPEG2_TIF_CONTROL
IAMNetworkStatus IDirectDrawMediaSampleAllocator IMpeg2TableFilter
IAMovieSetup IDirectDrawVideo IOverlay
IAMParse IDistributorNotify IOverlayNotify
IAMPhysicalPinInfo IDMOQualityControl IOverlayNotify2
IAMPlayList IDrawVideoImage IPinInfo
IAMPlayListItem IDShowPlugin IPSITables
IAMPushSource IDTFilterBlockedOverlay IReferenceClock2
IAMRebuild IDTFilterEvents IRegFilterInfo
IAMTimecodeDisplay IDVB_DIT IRegisterTuner
IAMTimecodeGenerator IDVB_RST IResourceConsumer
IAMTimecodeReader IDVB_SIT IResourceManager
IAMTVAudioNotification IDVB_ST IScanningTuner
IAMVfwCaptureDialogs IDVB_TDT IScanningTunerEx
IAMVideoAccelerator IDvbCableDeliverySystemDescriptor ISCTE_EAS
IAMVideoAcceleratorNotify IDvbFrequencyListDescriptor ISelector
IAnalogLocator IDvbServiceDescriptor ISpecifyParticularPages
IATSC_EIT IDvbSiParser IStreamBuilder
IATSC_ETT IDvdControl ITSDT
IATSC_MGT IDvdInfo ITuneRequestInfo
IATSC_STT IDXEffect IVideoEncoder
IATSC_VCT IDxtAlphaSetter IVideoProcAmp
IAtscContentAdvisoryDescriptor IDxtCompositor IVMRImagePresenter
IAtscPsipParser IDxtJpeg IVMRImagePresenterExclModeConfig
IAttributeGet IDxtKey IVMRSurface
IAttributeSet IEncoderAPI IVMRSurface9
IAudioData IEnumGuideDataProperties IVMRSurfaceAllocator
IAudioStreamSample IEnumPIDMap IVMRSurfaceAllocatorNotify
IBaseVideoMixer IEnumRegFilters IVPBaseConfig
IBDA_AutoDemodulateEx IEnumStreamIdMap IVPConfig
IBDA_ConditionalAccess IEnumTuneRequests IVPVBIConfig
IBDA_DiagnosticProperties IETFilter IVPVBINotify
IBDA_DRM IETFilterEvents IXDSCodec
IBDA_EasMessage IFilterInfo IXDSCodecEvents
IBDA_NetworkProvider IFilterMapper IXDSToRat
IBDA_NullTransform IFindCompressorCB  

Get DirectShow .NET at SourceForge.net. Fast, secure and Free Open Source software downloads