/// <summary> /// Inits video capture. /// </summary> protected void CaptureStart() { // System.Diagnostics.Debugger.Launch(); // configure cam1 VideoCapture1.Mode = VFVideoCaptureMode.ScreenCapture; VideoCapture1.Screen_Capture_Source = new ScreenCaptureSourceSettings(); VideoCapture1.Screen_Capture_Source.FullScreen = true; VideoCapture1.Screen_Capture_Source.FrameRate = 5; VideoCapture1.Output_Filename = "d:\\screen.wmv"; AddLog("Output file: " + VideoCapture1.Output_Filename); var wmvOutput = new VFWMVOutput(); wmvOutput.Mode = VFWMVMode.InternalProfile; wmvOutput.Internal_Profile_Name = VideoCapture1.WMV_Internal_Profiles()[5]; VideoCapture1.Output_Format = wmvOutput; VideoCapture1.OnError -= VideoCapture1_OnError; VideoCapture1.OnError += VideoCapture1_OnError; VideoCapture1.Start(); }
private void Form1_Load(object sender, RoutedEventArgs e) { Title += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")"; foreach (var codec in VideoCapture1.Video_Codecs) { cbVideoCodecs.Items.Add(codec); } if (cbVideoCodecs.Items.Count > 0) { cbVideoCodecs.SelectedIndex = 0; cbVideoCodecs_SelectedIndexChanged(null, null); } foreach (var codec in VideoCapture1.Audio_Codecs) { cbAudioCodecs.Items.Add(codec); } if (cbAudioCodecs.Items.Count > 0) { cbAudioCodecs.SelectedIndex = 0; cbAudioCodecs_SelectedIndexChanged(null, null); } if (cbVideoCodecs.Items.IndexOf("MJPEG Compressor") != -1) { cbVideoCodecs.SelectedIndex = cbVideoCodecs.Items.IndexOf("MJPEG Compressor"); } if (cbAudioCodecs.Items.IndexOf("PCM") != -1) { cbAudioCodecs.SelectedIndex = cbAudioCodecs.Items.IndexOf("PCM"); } foreach (var device in VideoCapture1.Audio_CaptureDevicesInfo) { cbAudioInputDevice.Items.Add(device.Name); } if (cbAudioInputDevice.Items.Count > 0) { cbAudioInputDevice.SelectedIndex = 0; cbAudioInputDevice_SelectedIndexChanged(null, null); } foreach (var profile in VideoCapture1.WMV_Internal_Profiles()) { cbWMVInternalProfile9.Items.Add(profile); } if (cbWMVInternalProfile9.Items.Count > 0) { cbWMVInternalProfile9.SelectedIndex = 0; } cbChannels.SelectedIndex = 1; cbBPS.SelectedIndex = 1; cbSampleRate.SelectedIndex = 0; cbImageType.SelectedIndex = 1; cbH264Profile.SelectedIndex = 2; cbH264Level.SelectedIndex = 0; cbH264RateControl.SelectedIndex = 1; cbAACOutput.SelectedIndex = 0; cbAACMPEGVersion.SelectedIndex = 0; cbAACObject.SelectedIndex = 1; cbAACBitrate.SelectedIndex = 12; cbH264TargetUsage.SelectedIndex = 3; cbMode.SelectedIndex = 0; foreach (var screen in Screen.AllScreens) { cbScreenCaptureDisplayIndex.Items.Add(screen.DeviceName.Replace(@"\\.\DISPLAY", string.Empty)); } cbScreenCaptureDisplayIndex.SelectedIndex = 0; edScreenshotsFolder.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.avi"; }
private void Window_Loaded(object sender, RoutedEventArgs e) { Title += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")"; foreach (var codec in VideoCapture1.Video_Codecs) { cbVideoCodecs.Items.Add(codec); } if (cbVideoCodecs.Items.Count > 0) { cbVideoCodecs.SelectedIndex = 0; cbVideoCodecs_SelectedIndexChanged(null, null); } foreach (var codec in VideoCapture1.Audio_Codecs) { cbAudioCodecs.Items.Add(codec); } if (cbAudioCodecs.Items.Count > 0) { cbAudioCodecs.SelectedIndex = 0; cbAudioCodecs_SelectedIndexChanged(null, null); } if (cbVideoCodecs.Items.IndexOf("MJPEG Compressor") != -1) { cbVideoCodecs.SelectedIndex = cbVideoCodecs.Items.IndexOf("MJPEG Compressor"); } if (cbAudioCodecs.Items.IndexOf("PCM") != -1) { cbAudioCodecs.SelectedIndex = cbAudioCodecs.Items.IndexOf("PCM"); } foreach (var profile in VideoCapture1.WMV_Internal_Profiles()) { cbWMVInternalProfile9.Items.Add(profile); } if (cbWMVInternalProfile9.Items.Count > 0) { cbWMVInternalProfile9.SelectedIndex = 0; } foreach (var device in VideoCapture1.Video_CaptureDevicesInfo) { cbVideoInputDevice.Items.Add(device.Name); } if (cbVideoInputDevice.Items.Count > 0) { cbVideoInputDevice.SelectedIndex = 0; } cbVideoInputDevice_SelectionChanged(null, null); foreach (var device in VideoCapture1.Audio_CaptureDevicesInfo) { cbAudioInputDevice.Items.Add(device.Name); } if (cbAudioInputDevice.Items.Count > 0) { cbAudioInputDevice.SelectedIndex = 0; cbAudioInputDevice_SelectionChanged(null, null); } cbAudioInputLine.Items.Clear(); if (!string.IsNullOrEmpty(cbAudioInputDevice.Text)) { var deviceItem = VideoCapture1.Audio_CaptureDevicesInfo.First(device => device.Name == cbAudioInputDevice.Text); if (deviceItem != null) { foreach (var line in deviceItem.Lines) { cbAudioInputLine.Items.Add(line); } if (cbAudioInputLine.Items.Count > 0) { cbAudioInputLine.SelectedIndex = 0; cbAudioInputLine_SelectionChanged(null, null); cbAudioInputFormat_SelectionChanged(null, null); } } } foreach (var audioOutputDevice in VideoCapture1.Audio_OutputDevices) { cbAudioOutputDevice.Items.Add(audioOutputDevice); } if (cbAudioOutputDevice.Items.Count > 0) { cbAudioOutputDevice.SelectedIndex = 0; } cbChannels.SelectedIndex = 1; cbBPS.SelectedIndex = 1; cbSampleRate.SelectedIndex = 0; cbImageType.SelectedIndex = 1; cbMode.SelectedIndex = 0; edScreenshotsFolder.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.avi"; }
private void Form1_Load(object sender, EventArgs e) { Text += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")"; foreach (string codec in VideoCapture1.Video_Codecs) { cbVideoCodecs.Items.Add(codec); } if (cbVideoCodecs.Items.Count > 0) { cbVideoCodecs.SelectedIndex = 0; cbVideoCodecs_SelectedIndexChanged(null, null); } foreach (string codec in VideoCapture1.Audio_Codecs) { cbAudioCodecs.Items.Add(codec); } if (cbAudioCodecs.Items.Count > 0) { cbAudioCodecs.SelectedIndex = 0; cbAudioCodecs_SelectedIndexChanged(null, null); } if (cbVideoCodecs.Items.IndexOf("MJPEG Compressor") != -1) { cbVideoCodecs.SelectedIndex = cbVideoCodecs.Items.IndexOf("MJPEG Compressor"); } if (cbAudioCodecs.Items.IndexOf("PCM") != -1) { cbAudioCodecs.SelectedIndex = cbAudioCodecs.Items.IndexOf("PCM"); } foreach (var device in VideoCapture1.Audio_CaptureDevicesInfo) { cbAudioInputDevice.Items.Add(device.Name); } if (cbAudioInputDevice.Items.Count > 0) { cbAudioInputDevice.SelectedIndex = 0; cbAudioInputDevice_SelectedIndexChanged(null, null); } foreach (string profile in VideoCapture1.WMV_Internal_Profiles()) { cbWMVInternalProfile9.Items.Add(profile); } if (cbWMVInternalProfile9.Items.Count > 0) { cbWMVInternalProfile9.SelectedIndex = 0; } foreach (var screen in Screen.AllScreens) { cbScreenCaptureDisplayIndex.Items.Add(screen.DeviceName.Replace(@"\\.\DISPLAY", string.Empty)); } cbScreenCaptureDisplayIndex.SelectedIndex = 0; cbChannels.SelectedIndex = 1; cbBPS.SelectedIndex = 1; cbSampleRate.SelectedIndex = 0; cbImageType.SelectedIndex = 1; cbMode.SelectedIndex = 0; edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.avi"; edScreenshotsFolder.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; if (VideoCapture.Filter_Supported_EVR()) { VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR; } else if (VideoCapture.Filter_Supported_VMR9()) { VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9; } else { VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer; } }
private void Form1_Load(object sender, EventArgs e) { Text += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")"; foreach (string codec in VideoCapture1.Video_Codecs) { cbVideoCodecs.Items.Add(codec); } if (cbVideoCodecs.Items.Count > 0) { cbVideoCodecs.SelectedIndex = 0; cbVideoCodecs_SelectedIndexChanged(null, null); } foreach (string codec in VideoCapture1.Audio_Codecs) { cbAudioCodecs.Items.Add(codec); } if (cbAudioCodecs.Items.Count > 0) { cbAudioCodecs.SelectedIndex = 0; cbAudioCodecs_SelectedIndexChanged(null, null); } if (cbVideoCodecs.Items.IndexOf("MJPEG Compressor") != -1) { cbVideoCodecs.SelectedIndex = cbVideoCodecs.Items.IndexOf("MJPEG Compressor"); } if (cbAudioCodecs.Items.IndexOf("PCM") != -1) { cbAudioCodecs.SelectedIndex = cbAudioCodecs.Items.IndexOf("PCM"); } foreach (string profile in VideoCapture1.WMV_Internal_Profiles()) { cbWMVInternalProfile9.Items.Add(profile); } if (cbWMVInternalProfile9.Items.Count > 0) { cbWMVInternalProfile9.SelectedIndex = 0; } foreach (var device in VideoCapture1.Video_CaptureDevicesInfo) { cbVideoInputDevice.Items.Add(device.Name); } if (cbVideoInputDevice.Items.Count > 0) { cbVideoInputDevice.SelectedIndex = 0; } cbVideoInputDevice_SelectedIndexChanged(null, null); foreach (var device in VideoCapture1.Audio_CaptureDevicesInfo) { cbAudioInputDevice.Items.Add(device.Name); } if (cbAudioInputDevice.Items.Count > 0) { cbAudioInputDevice.SelectedIndex = 0; cbAudioInputDevice_SelectedIndexChanged(null, null); } cbAudioInputLine.Items.Clear(); if (!string.IsNullOrEmpty(cbAudioInputDevice.Text)) { var deviceItem = VideoCapture1.Audio_CaptureDevicesInfo.First(device => device.Name == cbAudioInputDevice.Text); if (deviceItem != null) { foreach (string line in deviceItem.Lines) { cbAudioInputLine.Items.Add(line); } if (cbAudioInputLine.Items.Count > 0) { cbAudioInputLine.SelectedIndex = 0; cbAudioInputLine_SelectedIndexChanged(null, null); cbAudioInputFormat_SelectedIndexChanged(null, null); } } } foreach (string audioOutputDevice in VideoCapture1.Audio_OutputDevices) { cbAudioOutputDevice.Items.Add(audioOutputDevice); } if (cbAudioOutputDevice.Items.Count > 0) { cbAudioOutputDevice.SelectedIndex = 0; } foreach (string preset in VideoCapture1.Audio_Effects_Equalizer_Presets()) { cbAudEqualizerPreset.Items.Add(preset); } cbChannels.SelectedIndex = 1; cbBPS.SelectedIndex = 1; cbSampleRate.SelectedIndex = 0; cbImageType.SelectedIndex = 1; cbMode.SelectedIndex = 0; edScreenshotsFolder.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VisioForge\"; edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.avi"; if (VideoCapture.Filter_Supported_EVR()) { VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR; } else if (VideoCapture.Filter_Supported_VMR9()) { VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9; } else { VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer; } }
private void Form1_Load(object sender, RoutedEventArgs e) { Title += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")"; foreach (var codec in VideoCapture1.Video_Codecs) { cbVideoCodecs.Items.Add(codec); } if (cbVideoCodecs.Items.Count > 0) { cbVideoCodecs.SelectedIndex = 0; cbVideoCodecs_SelectedIndexChanged(null, null); } foreach (var codec in VideoCapture1.Audio_Codecs) { cbAudioCodecs.Items.Add(codec); } if (cbAudioCodecs.Items.Count > 0) { cbAudioCodecs.SelectedIndex = 0; cbAudioCodecs_SelectedIndexChanged(null, null); } if (cbVideoCodecs.Items.IndexOf("MJPEG Compressor") != -1) { cbVideoCodecs.SelectedIndex = cbVideoCodecs.Items.IndexOf("MJPEG Compressor"); } if (cbAudioCodecs.Items.IndexOf("PCM") != -1) { cbAudioCodecs.SelectedIndex = cbAudioCodecs.Items.IndexOf("PCM"); } foreach (var profile in VideoCapture1.WMV_Internal_Profiles()) { cbWMVInternalProfile9.Items.Add(profile); } if (cbWMVInternalProfile9.Items.Count > 0) { cbWMVInternalProfile9.SelectedIndex = 0; } foreach (var device in VideoCapture1.Video_CaptureDevicesInfo) { cbVideoInputDevice.Items.Add(device.Name); } if (cbVideoInputDevice.Items.Count > 0) { cbVideoInputDevice.SelectedIndex = 0; } cbVideoInputDevice_SelectedIndexChanged(null, null); foreach (var audioOutputDevice in VideoCapture1.Audio_OutputDevices) { cbAudioOutputDevice.Items.Add(audioOutputDevice); } if (cbAudioOutputDevice.Items.Count > 0) { cbAudioOutputDevice.SelectedIndex = 0; } cbChannels.SelectedIndex = 1; cbBPS.SelectedIndex = 1; cbSampleRate.SelectedIndex = 0; cbDVChannels.SelectedIndex = 1; cbDVSampleRate.SelectedIndex = 0; cbImageType.SelectedIndex = 1; edScreenshotsFolder.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.avi"; }