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 ~360 interfaces defined in the source code, only some of them have been tested to ensure that they are working
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.
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.
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.
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.
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.
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.
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.
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.
DTViewer - use BDA to display Digital TV into a Windows Form.
Interfaces
Tested interfaces ready to use:
| IAMAnalogVideoDecoder |
IDMOVideoOutputOptimizations |
IRegisterServiceProvider |
| IAMAudioInputMixer |
IDMOWrapperFilter |
IRenderEngine |
| IAMAudioRendererStats |
IDVBCLocator |
IRenderEngine2 |
| IAMBufferNegotiation |
IDVBSLocator |
ISampleGrabber |
| IAMClockAdjust |
IDVBSTuningSpace |
ISampleGrabberCB |
| IAMClockSlave |
IDVBTLocator |
ISectionList |
| IAMCopyCaptureFileProgress |
IDVBTuneRequest |
ISeekingPassThru |
| IAMCrossbar |
IDVBTuningSpace |
IServiceProvider |
| IAMDecoderCaps |
IDVBTuningSpace2 |
ISmartRenderEngine |
| IAMDirectSound |
IDvdCmd |
ISpecifyPropertyPages |
| IAMDroppedFrames |
IDvdControl2 |
IStreamBufferConfigure |
| IAMErrorLog |
IDvdGraphBuilder |
IStreamBufferConfigure2 |
| IAMExtDevice |
IDvdInfo2 |
IStreamBufferDataCounters |
| IAMExtendedSeeking |
IDvdState |
IStreamBufferInitialize |
| IAMExtTransport |
IDVEnc |
IStreamBufferMediaSeeking |
| IAMFilterMiscFlags |
IDVRGB219 |
IStreamBufferMediaSeeking2 |
| IAMGraphBuilderCallback |
IDVSplitter |
IStreamBufferRecComp |
| IAMGraphStreams |
IEnumComponents |
IStreamBufferRecordControl |
| IAMLine21Decoder |
IEnumComponentTypes |
IStreamBufferRecordingAttribute |
| IAMMediaContent |
IEnumDMO |
IStreamBufferSink |
| IAMMediaContent2 |
IEnumFilters |
IStreamBufferSink2 |
| IAMMediaStream |
IEnumMediaTypes |
IStreamBufferSink3 |
| IAMMediaTypeSample |
IEnumPins |
IStreamBufferSource |
| IAMMediaTypeStream |
IEnumStreamBufferRecordingAttrib |
IStreamSample |
| IAMMultiMediaStream |
IEnumTuningSpaces |
ITuner |
| IAMOpenProgress |
IErrorLog |
ITuneRequest |
| IAMOverlayFX |
IFileSinkFilter |
ITuningSpace |
| IAMResourceControl |
IFileSinkFilter2 |
ITuningSpaceContainer |
| IAMSetErrorLog |
IFileSourceFilter |
ITuningSpaces |
| IAMStats |
IFilterChain |
IVideoFrameStep |
| IAMStreamConfig |
IFilterGraph |
IVideoWindow |
| IAMStreamControl |
IFilterGraph2 |
IVMRAspectRatioControl |
| IAMStreamSelect |
IFilterMapper2 |
IVMRAspectRatioControl9 |
| IAMTimeline |
IFilterMapper3 |
IVMRDeinterlaceControl |
| IAMTimelineComp |
IFrequencyMap |
IVMRDeinterlaceControl9 |
| IAMTimelineEffect |
IGraphBuilder |
IVMRFilterConfig |
| IAMTimelineEffectable |
IGraphConfig |
IVMRFilterConfig9 |
| IAMTimelineGroup |
IGraphConfigCallback |
IVMRImageCompositor |
| IAMTimelineObj |
IGraphVersion |
IVMRImageCompositor9 |
| IAMTimelineSplittable |
IIPDVDec |
IVMRImagePresenter9 |
| IAMTimelineSrc |
IKsPin |
IVMRImagePresenterConfig |
| IAMTimelineTrack |
IKsPropertySet |
IVMRImagePresenterConfig9 |
| IAMTimelineTrans |
ILanguageComponentType |
IVMRMixerBitmap |
| IAMTimelineTransable |
ILocator |
IVMRMixerBitmap9 |
| IAMTimelineVirtualTrack |
IMediaBuffer |
IVMRMixerControl |
| IAMTuner |
IMediaControl |
IVMRMixerControl9 |
| IAMTunerNotification |
IMediaDet |
IVMRMonitorConfig |
| IAMTVAudio |
IMediaEvent |
IVMRMonitorConfig9 |
| IAMTVTuner |
IMediaEventEx |
IVMRSurfaceAllocator9 |
| IAMVfwCompressDialogs |
IMediaEventSink |
IVMRSurfaceAllocatorEx9 |
| IAMVideoCompression |
IMediaFilter |
IVMRSurfaceAllocatorNotify9 |
| IAMVideoControl |
IMediaLocator |
IVMRVideoStreamControl |
| IAMVideoDecimationProperties |
IMediaObject |
IVMRVideoStreamControl9 |
| IAMVideoProcAmp |
IMediaObjectInPlace |
IVMRWindowlessControl |
| IAMWstDecoder |
IMediaParamInfo |
IVMRWindowlessControl9 |
| IAnalogTVTuningSpace |
IMediaParams |
IVPBaseNotify |
| IAsyncReader |
IMediaPosition |
IVPManager |
| IATSCChannelTuneRequest |
IMediaPropertyBag |
IVPNotify |
| IATSCComponentType |
IMediaSample |
IVPNotify2 |
| IATSCLocator |
IMediaSample2 |
IXml2Dex |
| IATSCTuningSpace |
IMediaSeeking |
IAMCameraControl |
| IAudioMediaStream |
IMediaStream |
IConfigAsfWriter2 |
| IAuxInTuningSpace |
IMediaStreamFilter |
IDTFilter |
| IBaseFilter |
IMemAllocator |
IDTFilterConfig |
| IBasicAudio |
IMemAllocatorCallbackTemp |
IETFilterConfig |
| IBasicVideo |
IMemAllocatorNotifyCallbackTemp |
IEvalRat |
| IBasicVideo2 |
IMixerOCX |
IATSCLocator2 |
| IBDA_AutoDemodulate |
IMixerOCXNotify |
IBroadcastEventEx |
| IBDA_DeviceControl |
IMixerPinConfig |
ICAT |
| IBDA_DigitalDemodulator |
IMixerPinConfig2 |
ICCSubStreamFiltering |
| IBDA_EthernetFilter |
IMPEG2Component |
IDigitalLocator |
| IBDA_FrequencyFilter |
IMPEG2ComponentType |
IDTFilter2 |
| IBDA_IPSinkControl |
IMpeg2Data |
IDTFilter3 |
| IBDA_IPSinkInfo |
IMpeg2Demultiplexer |
IDVB_BAT |
| IBDA_IPV4Filter |
IMPEG2PIDMap |
IDVB_EIT |
| IBDA_IPV6Filter |
IMpeg2Stream |
IDVB_NIT |
| IBDA_LNBInfo |
IMPEG2StreamIdMap |
IDVB_SDT |
| IBDA_SignalProperties |
IMPEG2TuneRequest |
IDVB_TOT |
| IBDA_SignalStatistics |
IMPEG2TuneRequestFactory |
IDvbLogicalChannelDescriptor |
| IBDA_Topology |
IMPEG2TuneRequestSupport |
IDvbSatelliteDeliverySystemDescriptor |
| IBDAComparable |
IMpegAudioDecoder |
IDvbTerrestrialDeliverySystemDescriptor |
| IBroadcastEvent |
IMultiMediaStream |
IFilterGraph3 |
| ICaptureGraphBuilder2 |
IObjectWithSite |
IGenericDescriptor |
| IChannelTuneRequest |
IPersist |
IPAT |
| IComponent |
IPersistMediaPropertyBag |
IPMT |
| IComponents |
IPersistStream |
IReferenceClockTimerControl |
| IComponentsNew |
IPin |
IStreamBufferConfigure3 |
| IComponentType |
IPinConnection |
ITunerCap |
| IComponentTypes |
IPinFlowControl |
IXDSCodecConfig |
| IConfigAsfWriter |
IPropertyBag |
IAnalogRadioTuningSpace |
| IConfigAviMux |
IPropertySetter |
IAnalogRadioTuningSpace2 |
| IConfigInterleaving |
IQualityControl |
IAuxInTuningSpace2 |
| ICreateDevEnum |
IQualProp |
IKsTopologyInfo |
| ICreatePropBagOnRegKey |
IQueueCommand |
|
| IDeferredCommand |
IReferenceClock |
|
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_TIF_REGISTRATION |
IFullScreenVideo |
| IAMCertifiedOutputProtection |
IBDA_TransportStreamInfo |
IFullScreenVideoEx |
| IAMChannelInfo |
IBDA_VoidTransform |
IGetCapabilitiesKey |
| IAMCollection |
IBPCSatelliteTuner |
IGrfCache |
| IAMDeviceRemoval |
ICameraControl |
IGuideData |
| IAMDevMemoryAllocator |
ICaptionServiceDescriptor |
IGuideDataEvent |
| IAMDevMemoryControl |
ICaptureGraphBuilder |
IGuideDataLoader |
| IAMExtendedErrorInfo |
ICodecAPI |
IGuideDataProperty |
| IAMFilterGraphCallback |
IDDrawExclModeVideo |
IKsNodeControl |
| IAMLatency |
IDDrawExclModeVideoCallback |
IMediaSample2Config |
| IAMNetShowConfig |
IDecimateVideoImage |
IMediaTypeInfo |
| IAMNetShowExProps |
IDigitalCableLocator |
IMemInputPin |
| IAMNetShowPreroll |
IDigitalCableTuneRequest |
IMemoryData |
| IAMNetworkStatus |
IDigitalCableTuningSpace |
IMPEG2_TIF_CONTROL |
| IAMovieSetup |
IDirectDrawMediaSample |
IMpeg2TableFilter |
| IAMParse |
IDirectDrawMediaSampleAllocator |
IOverlay |
| IAMPhysicalPinInfo |
IDirectDrawVideo |
IOverlayNotify |
| IAMPlayList |
IDistributorNotify |
IOverlayNotify2 |
| IAMPlayListItem |
IDMOQualityControl |
IPinInfo |
| IAMPushSource |
IDrawVideoImage |
IPSITables |
| IAMRebuild |
IDShowPlugin |
IReferenceClock2 |
| IAMTimecodeDisplay |
IDTFilterBlockedOverlay |
IRegFilterInfo |
| IAMTimecodeGenerator |
IDTFilterEvents |
IRegisterTuner |
| IAMTimecodeReader |
IDVB_DIT |
IResize |
| IAMTVAudioNotification |
IDVB_RST |
IResourceConsumer |
| IAMVfwCaptureDialogs |
IDVB_SIT |
IResourceManager |
| IAMVideoAccelerator |
IDVB_ST |
IScanningTuner |
| IAMVideoAcceleratorNotify |
IDVB_TDT |
IScanningTunerEx |
| IAnalogAudioComponentType |
IDvbCableDeliverySystemDescriptor |
ISCTE_EAS |
| IAnalogLocator |
IDvbFrequencyListDescriptor |
ISelector |
| IATSC_EIT |
IDvbServiceDescriptor |
ISpecifyParticularPages |
| IATSC_ETT |
IDvbSiParser |
IStreamBuilder |
| IATSC_MGT |
IDvdControl |
ITSDT |
| IATSC_STT |
IDvdInfo |
ITuneRequestInfo |
| IATSC_VCT |
IDXEffect |
IVideoEncoder |
| IAtscContentAdvisoryDescriptor |
IDxtAlphaSetter |
IVideoProcAmp |
| IAtscPsipParser |
IDxtCompositor |
IVMRImagePresenter |
| IAttributeGet |
IDxtJpeg |
IVMRImagePresenterExclModeConfig |
| IAttributeSet |
IDxtKey |
IVMRSurface |
| IAudioData |
IEncoderAPI |
IVMRSurface9 |
| IAudioStreamSample |
IEnumGuideDataProperties |
IVMRSurfaceAllocator |
| IBaseVideoMixer |
IEnumPIDMap |
IVMRSurfaceAllocatorNotify |
| IBDA_AutoDemodulateEx |
IEnumRegFilters |
IVPBaseConfig |
| IBDA_ConditionalAccess |
IEnumStreamIdMap |
IVPConfig |
| IBDA_DiagnosticProperties |
IEnumTuneRequests |
IVPVBIConfig |
| IBDA_DRM |
IETFilter |
IVPVBINotify |
| IBDA_EasMessage |
IETFilterEvents |
IXDSCodec |
| IBDA_NetworkProvider |
IFilterInfo |
IXDSCodecEvents |
| IBDA_NullTransform |
IFilterMapper |
IXDSToRat |
| IBDA_PinControl |
IFindCompressorCB |
|