サンプルコード

DirectShowLibのサンプルコード

Capture

プロジェクト 説明
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.
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.

Players

プロジェクト 説明
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.
PlayVB A simple player in VB.
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.

DMO (DirectX Media Objects)

プロジェクト 説明
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.

Editing

プロジェクト 説明
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.
DxScan A sample application scanning a media file looking for black frames.

SBE (Stream Buffer Engine)

プロジェクト 説明
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.

VMR9 (Video Mixing Renderer)

プロジェクト 説明
VMR9Allocator A translation of the DirectShow VMR9Allocator program to show how this would appear in c#.
VMR9Allocator2  
BitmapMixer BitmapMixer is an example of how to draw things over a video using VMR9.
VMR9Compositor This sample shows how to use the VMR9 custom compositor feature.
VMR9Snapper This sample shows how to capture bitmaps from VMR9.

BDA (Broadcast Driver Architecture )

プロジェクト 説明
DTVViewer Use BDA to display Digital TV into a Windows Form.

Misc

プロジェクト 説明
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 through 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 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.
MediaDetector  
Toolkit A collection of useful utilities.