Select video and audio capture devices in Video Capture SDK .Net

Related products
Video Capture SDK .Net

You can download the sample project from GitHub.

Sample code

Select video source

1. Get a list of available video capture devices, fill combo-box

foreach (var device in VideoCapture1.Video_CaptureDevices)

2. Create video source device settings

VideoCapture1.Video_CaptureDevice = new VideoCaptureSource(cbVideoInputDevice.Text);

3. Get a list of available video formats and frame rates, fill combo-box

var deviceItem = VideoCapture1.Video_CaptureDevices.First(device => device.Name == cbVideoInputDevice.Text);
if (deviceItem == null)

foreach (string format in deviceItem.VideoFormats)

foreach (string frameRate in deviceItem.VideoFrameRates) 

4. Select video format

VideoCapture1.Video_CaptureDevice.Format = cbVideoInputFormat.Text;

or automatically choose the best video format.

VideoCapture1.Video_CaptureDevice.Format_UseBest = true;

5. Select frame rate

VideoCapture1.Video_CaptureDevice.FrameRate = Convert.ToDouble(cbVideoFrameRate.Text);

6. Select needed video input (configure crossbar) if needed

Select audio source

1. Get a list of available audio capture devices, fill combo-box

foreach (var device in VideoCapture1.Audio_CaptureDevices)

2. Create audio source device settings

VideoCapture1.Audio_CaptureDevice = new AudioCaptureSource(cbAudioInputDevice.Text);

3. Get a list of available audio formats, fill combo-box

var deviceItem = VideoCapture1.Audio_CaptureDevices.FirstOrDefault(device => device.Name == cbAudioInputDevice.Text);

if (deviceItem != null)
  foreach (string format in deviceItem.Formats)

2. Select format

VideoCapture1.Audio_CaptureDevice.Format = cbAudioInputFormat.Text;

or automatically choose the best audio format

VideoCapture1.Audio_CaptureDevice.Format_UseBest = true;

3. Select input (line)

VideoCapture1.Audio_CaptureDevice.Line = cbAudioInputLine.Text;
Please contact support to get help with this tutorial. Visit our GitHub page to get more code samples.
abstract 2abstract 1abstract 3
VisioForge © 2006 - 2022