Video capture to AVI file using Video Capture SDK .Net

Related products
Video Capture SDK .Net

To capture video in AVI format using Video Capture SDK, you need to configure video output format using AVIOutput class. You can set video and audio codecs and their various settings.

You can use dialog to set settings in UI or set settings in code.

Sample code

Create AVIOutput object

AVIOutput aviOutput = new AVIOutput();

Set AVI settings using the settings dialog

AVISettingsDialog aviSettingsDialog = new AVISettingsDialog(


aviSettingsDialog.SaveSettings(ref aviOutput);

Set AVI settings without using the settings dialog

Get lists of audio and video codecs, fill comboboxes

We using two comboboxes in WinForms application – cbVideoCodecs and cbAudioCodecs.
foreach (string codec in VideoCapture1.Video_Codecs)

foreach (string codec in VideoCapture1.Audio_Codecs)

Set video settings

aviOutput.Video_Codec = cbVideoCodecs.Text;

Set audio settings

aviOutput.ACM.Name = cbAudioCodecs.Text;
aviOutput.ACM.Channels = 2;
aviOutput.ACM.BPS = 16;
aviOutput.ACM.SampleRate = 44100;
aviOutput.ACM.UseCompression = true;

Apply settings

Set AVI format settings for output

VideoCapture1.Output_Format = aviOutput;

Set video capture mode

VideoCapture1.Mode = VideoCaptureMode.VideoCapture;

Set file name (be sure that you have write access rights)

VideoCapture1.Output_Filename = "output.avi";

Start capture (sync or async)

await VideoCapture1.StartAsync();

Required redists

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