|
How to write a DirectShow video capture application with VideoLab or VisionLab using C#, VB.NET, J# or C++/CLI
This is a step by step tutorial for writing a simple DirectShow video capture application in .NET by using VideoLab or VisionLab. The steps are exactly identical in C#, Visual Basic .NET, C++/CLI and J#.
Using the application created by following the tutorial, you will be able to capture from Webcam, Camcorder, Camera, TV Tuner, DVR, VCR, DVD Player, or any other video source.
WARNING: In order to run the application in this example you must have DirectX 9.0 or higher installed on your system!
There is no code writing necessary to complete this application.
There is no need to know C#, Visual Basic, J# or C++ in order to create this application.

The tutorial covers the following steps, which should take less than two minutes:
1. Add a DSCapture Component to Your Application's Form:

2. Add a DSImageDisplay Control to Your Application's Form:

3. Add a DSVideoLogger Component to Your Application's Form:

4. Set the DSImageDisplay Control's Properties:

4.2. Set the DSImageDisplay Control’s Anchor property to “Top, Bottom, Left, Right”:

5. Select video capture device for the DSCapture Component:
5.1. Click on the button on the dsCapture1 component, and then click “Select Video Device ...”:


5.3. Optionally select audio capture device. If you do not select the device the component will use the default device for your system.
6. Connect the DSCapture.OutputPin to DSImageDisplay.InputPin and DSVideoLogger.InputPin:

6.2. In the connection editor check the InputPin of the dsImageDisplay1 and the InputPin of the dsVideoLogger1, then click OK:

7. Connect the DSCapture.AudioOutputPin to DSVideoLogger.AudioInputPin:


8. Specify file to record in the DSVideoLogger Component:

8.2. In the dsVideoLogger1 Properties select the FileName property and enter the path and the name of the file where you want to record the captured video:

9. Run the Application:

Here is a diagram of the OpenWire connections in this application:

|