Click here to Skip to main content
15,887,464 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have DirectX C# dll. I need to capture video while video running. when i capture video while running, it just slow in the windows form(get slow moving). how to stop picture box video slow moving. however video save without any problem.

here is the sample code i used.

What I have tried:

Filters _Filters ;
Capture capture;
SaveFileDialog saveAvi = null;

private void startcammera()
{
capture = null;
capture = new Capture(_Filters.VideoInputDevices[comboBox1.SelectedIndex], _Filters.AudioInputDevices[comboBox2.SelectedIndex]);

capture.VideoCompressor = _Filters.VideoCompressors[comboBox1.SelectedIndex];
capture.AudioCompressor = _Filters.AudioCompressors[comboBox2.SelectedIndex];

capture.FrameRate = 29.997;
capture.FrameSize = new Size(640, 480);
capture.AudioSamplingRate = 44100;
capture.AudioSampleSize = 16;
capture.AudioChannels = 2;

capture.Filename = saveAvi.FileName;
capture.PreviewWindow = this.pictureBox1;
}

private void CaptureStart()
{
capture.Start();
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900