Click here to Skip to main content
13,736,491 members
Rate this:
Please Sign up or sign in to vote.
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()
Posted 17-May-16 19:37pm

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180920.1 | Last Updated 18 May 2016
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100