private void btStart_Click(object sender, EventArgs e) { mmLog.Clear(); VideoCapture1.Video_Renderer.Zoom_Ratio = 0; VideoCapture1.Video_Renderer.Zoom_ShiftX = 0; VideoCapture1.Video_Renderer.Zoom_ShiftY = 0; VideoCapture1.Debug_Mode = cbDebugMode.Checked; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; VideoCapture1.Video_Sample_Grabber_Enabled = true; VideoCapture1.Screen_Capture_Source = CreateScreenCaptureSource(); // audio source VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Audio_PlayAudio = false; // apply capture params VideoCapture1.Video_Effects_Enabled = false; VideoCapture1.Video_Effects_Clear(); VideoCapture1.Mode = VFVideoCaptureMode.ScreenCapture; VideoCapture1.Output_Filename = edOutput.Text; switch (cbOutputFormat.SelectedIndex) { case 0: { var aviOutput = new VFAVIOutput(); SetAVIOutput(ref aviOutput); VideoCapture1.Output_Format = aviOutput; break; } case 1: { var mkvOutput = new VFMKVv1Output(); SetMKVOutput(ref mkvOutput); VideoCapture1.Output_Format = mkvOutput; break; } case 2: { var wmvOutput = new VFWMVOutput(); SetWMVOutput(ref wmvOutput); VideoCapture1.Output_Format = wmvOutput; break; } case 3: { var dvOutput = new VFDVOutput(); SetDVOutput(ref dvOutput); VideoCapture1.Output_Format = dvOutput; break; } case 4: { var webmOutput = new VFWebMOutput(); SetWebMOutput(ref webmOutput); VideoCapture1.Output_Format = webmOutput; break; } case 5: { var ffmpegDLLOutput = new VFFFMPEGDLLOutput(); SetFFMPEGDLLOutput(ref ffmpegDLLOutput); VideoCapture1.Output_Format = ffmpegDLLOutput; break; } case 6: { var ffmpegOutput = new VFFFMPEGEXEOutput(); SetFFMPEGEXEOutput(ref ffmpegOutput); VideoCapture1.Output_Format = ffmpegOutput; break; } case 7: { var mp4Output = new VFMP4v8v10Output(); SetMP4Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 8: { var mp4Output = new VFMP4v11Output(); SetMP4v11Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 9: { var gifOutput = new VFAnimatedGIFOutput(); SetGIFOutput(ref gifOutput); VideoCapture1.Output_Format = gifOutput; break; } case 10: { var encOutput = new VFMP4v8v10Output(); SetMP4Output(ref encOutput); encOutput.Encryption = true; encOutput.Encryption_Format = VFEncryptionFormat.MP4_H264_SW_AAC; VideoCapture1.Output_Format = encOutput; break; } case 11: { var tsOutput = new VFMPEGTSOutput(); SetMPEGTSOutput(ref tsOutput); VideoCapture1.Output_Format = tsOutput; break; } case 12: { var movOutput = new VFMOVOutput(); SetMOVOutput(ref movOutput); VideoCapture1.Output_Format = movOutput; break; } } VideoCapture1.Start(); tcMain.SelectedIndex = 2; }
public void kinect_OnKinectReadyToStart(object sender, EventArgs e) { VideoCapture1.Start(); }
private void btStart_Click(object sender, EventArgs e) { mmLog.Clear(); VideoCapture1.Debug_Mode = cbDebugMode.Checked; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; VideoCapture1.Mode = VFVideoCaptureMode.VideoPreview; VideoCapture1.Audio_CaptureDevice = cbAudioInputDevice.Text; VideoCapture1.Audio_CaptureDevice_Format = cbAudioInputFormat.Text; VideoCapture1.Audio_CaptureDevice_Line = cbAudioInputLine.Text; VideoCapture1.Audio_CaptureDevice_Format_UseBest = cbUseBestAudioInputFormat.Checked; VideoCapture1.Video_CaptureDevice = cbVideoInputDevice.Text; VideoCapture1.Video_CaptureDevice_IsAudioSource = cbUseAudioInputFromVideoCaptureDevice.Checked; VideoCapture1.Video_CaptureDevice_Format_UseBest = cbUseBestVideoInputFormat.Checked; VideoCapture1.Video_CaptureDevice_Format = cbVideoInputFormat.Text; if (cbFramerate.SelectedIndex != -1) { VideoCapture1.Video_CaptureDevice_FrameRate = Convert.ToDouble(cbFramerate.Text, CultureInfo.CurrentCulture); } VideoCapture1.Audio_RecordAudio = true; VideoCapture1.Audio_PlayAudio = false; VideoCapture1.Timeshift_Settings = new TimeshiftSettings { Player_Screen = MediaPlayer1, TempFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\SBE\\", Player_AudioOutput_Enabled = cbPlayerPlayAudio.Checked }; var mp4Settings = new VFMP4Output(); mp4Settings.Video_v10.IDR_Period = 5; VideoCapture1.Timeshift_Settings.EncodingSettings = mp4Settings; switch (cbOutputFormat.SelectedIndex) { case 0: break; case 1: { VideoCapture1.Output_Filename = edOutput.Text; VideoCapture1.Mode = VFVideoCaptureMode.VideoCapture; var output = new VFAVIOutput(); VideoCapture1.Output_Format = output; } break; case 2: { VideoCapture1.Output_Filename = edOutput.Text; VideoCapture1.Mode = VFVideoCaptureMode.VideoCapture; var output = new VFMP4Output(); VideoCapture1.Output_Format = output; } break; case 3: { VideoCapture1.Output_Filename = edOutput.Text; VideoCapture1.Mode = VFVideoCaptureMode.VideoCapture; var output = new VFWebMOutput(); VideoCapture1.Output_Format = output; } break; } VideoCapture1.Start(); timer1.Interval = 1000; timer1.Enabled = true; }
private void btStart_Click(object sender, RoutedEventArgs e) { mmLog.Clear(); VideoCapture1.Video_Sample_Grabber_Enabled = true; VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; // from screen bool allScreens = cbScreenCaptureDisplayIndex.SelectedIndex == cbScreenCaptureDisplayIndex.Items.Count - 1; if (allScreens) { int n = cbScreenCaptureDisplayIndex.Items.Count - 1; VideoCapture1.Screen_Capture_Source = CreateScreenCaptureSource( Convert.ToInt32(cbScreenCaptureDisplayIndex.Items[0]), true); if (n > 1) { for (int i = 1; i < n; i++) { var source = CreateScreenCaptureSource( Convert.ToInt32(cbScreenCaptureDisplayIndex.Items[i]), true); VideoCapture1.PIP_Mode = VFPIPMode.Horizontal; VideoCapture1.PIP_Sources_Add_ScreenSource(source, 0, 0, 0, 0); } } } else { VideoCapture1.Screen_Capture_Source = CreateScreenCaptureSource( Convert.ToInt32(cbScreenCaptureDisplayIndex.Text), false); } if (cbRecordAudio.IsChecked == true) { VideoCapture1.Audio_RecordAudio = true; VideoCapture1.Audio_PlayAudio = false; VideoCapture1.Audio_CaptureDevice = cbAudioInputDevice.Text; VideoCapture1.Audio_CaptureDevice_Format = cbAudioInputFormat.Text; VideoCapture1.Audio_CaptureDevice_Line = cbAudioInputLine.Text; } else { VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Audio_PlayAudio = false; } // apply capture parameters VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF; VideoCapture1.Video_Effects_Enabled = true; VideoCapture1.Video_Effects_Clear(); if (rbPreview.IsChecked == true) { VideoCapture1.Mode = VFVideoCaptureMode.ScreenPreview; } else { VideoCapture1.Mode = VFVideoCaptureMode.ScreenCapture; VideoCapture1.Output_Filename = edOutput.Text; switch (cbOutputFormat.SelectedIndex) { case 0: { var aviOutput = new VFAVIOutput(); SetAVIOutput(ref aviOutput); VideoCapture1.Output_Format = aviOutput; break; } case 1: { var mkvOutput = new VFMKVv1Output(); SetMKVOutput(ref mkvOutput); VideoCapture1.Output_Format = mkvOutput; break; } case 2: { var wmvOutput = new VFWMVOutput(); SetWMVOutput(ref wmvOutput); VideoCapture1.Output_Format = wmvOutput; break; } case 3: { var dvOutput = new VFDVOutput(); SetDVOutput(ref dvOutput); VideoCapture1.Output_Format = dvOutput; break; } case 4: { var webmOutput = new VFWebMOutput(); SetWebMOutput(ref webmOutput); VideoCapture1.Output_Format = webmOutput; break; } case 5: { var ffmpegDLLOutput = new VFFFMPEGDLLOutput(); SetFFMPEGDLLOutput(ref ffmpegDLLOutput); VideoCapture1.Output_Format = ffmpegDLLOutput; break; } case 6: { var ffmpegOutput = new VFFFMPEGEXEOutput(); SetFFMPEGEXEOutput(ref ffmpegOutput); VideoCapture1.Output_Format = ffmpegOutput; break; } case 7: { var mp4Output = new VFMP4v8v10Output(); SetMP4Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 8: { var mp4Output = new VFMP4v11Output(); SetMP4v11Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 9: { var gifOutput = new VFAnimatedGIFOutput(); SetGIFOutput(ref gifOutput); VideoCapture1.Output_Format = gifOutput; break; } case 10: { var encOutput = new VFMP4v8v10Output(); SetMP4Output(ref encOutput); encOutput.Encryption = true; encOutput.Encryption_Format = VFEncryptionFormat.MP4_H264_SW_AAC; VideoCapture1.Output_Format = encOutput; break; } case 11: { var tsOutput = new VFMPEGTSOutput(); SetMPEGTSOutput(ref tsOutput); VideoCapture1.Output_Format = tsOutput; break; } case 12: { var movOutput = new VFMOVOutput(); SetMOVOutput(ref movOutput); VideoCapture1.Output_Format = movOutput; break; } } } VideoCapture1.Video_Effects_Enabled = true; VideoCapture1.Video_Effects_Clear(); lbLogos.Items.Clear(); ConfigureVideoEffects(); VideoCapture1.Start(); tcMain.SelectedIndex = 3; tmRecording.Start(); }
private void btStart_Click(object sender, RoutedEventArgs e) { VideoCapture1.Video_Sample_Grabber_Enabled = true; mmLog.Clear(); VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; if (cbRecordAudio.IsChecked == true) { VideoCapture1.Audio_RecordAudio = true; VideoCapture1.Audio_PlayAudio = false; } else { VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Audio_PlayAudio = false; } VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF; VideoCapture1.Video_CaptureDevice = cbVideoInputDevice.Text; VideoCapture1.Video_CaptureDevice_IsAudioSource = true; VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text; VideoCapture1.Audio_CaptureDevice_Format_UseBest = true; VideoCapture1.Video_CaptureFormat = cbVideoInputFormat.Text; VideoCapture1.Video_CaptureFormat_UseBest = cbUseBestVideoInputFormat.IsChecked == true; if (cbFramerate.SelectedIndex != -1) { VideoCapture1.Video_FrameRate = (float)Convert.ToDouble(cbFramerate.Text); } if (rbPreview.IsChecked == true) { VideoCapture1.Mode = VFVideoCaptureMode.VideoPreview; } else { VideoCapture1.Mode = VFVideoCaptureMode.VideoCapture; VideoCapture1.Output_Filename = edOutput.Text; switch (cbOutputFormat.SelectedIndex) { case 0: { var aviOutput = new VFAVIOutput(); SetAVIOutput(ref aviOutput); VideoCapture1.Output_Format = aviOutput; break; } case 1: { var mkvOutput = new VFMKVv1Output(); SetMKVOutput(ref mkvOutput); VideoCapture1.Output_Format = mkvOutput; break; } case 2: { var wmvOutput = new VFWMVOutput(); SetWMVOutput(ref wmvOutput); VideoCapture1.Output_Format = wmvOutput; break; } case 3: { var dvOutput = new VFDVOutput(); SetDVOutput(ref dvOutput); VideoCapture1.Output_Format = dvOutput; break; } case 4: { VideoCapture1.Output_Format = new VFDirectCaptureDVOutput(); break; } case 5: { var webmOutput = new VFWebMOutput(); SetWebMOutput(ref webmOutput); VideoCapture1.Output_Format = webmOutput; break; } case 6: { var ffmpegDLLOutput = new VFFFMPEGDLLOutput(); SetFFMPEGDLLOutput(ref ffmpegDLLOutput); VideoCapture1.Output_Format = ffmpegDLLOutput; break; } case 7: { var ffmpegOutput = new VFFFMPEGEXEOutput(); SetFFMPEGEXEOutput(ref ffmpegOutput); VideoCapture1.Output_Format = ffmpegOutput; break; } case 8: { var mp4Output = new VFMP4v8v10Output(); SetMP4Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 9: { var mp4Output = new VFMP4v11Output(); SetMP4v11Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 10: { var gifOutput = new VFAnimatedGIFOutput(); SetGIFOutput(ref gifOutput); VideoCapture1.Output_Format = gifOutput; break; } case 11: { var encOutput = new VFMP4v8v10Output(); SetMP4Output(ref encOutput); encOutput.Encryption = true; encOutput.Encryption_Format = VFEncryptionFormat.MP4_H264_SW_AAC; VideoCapture1.Output_Format = encOutput; break; } case 12: { var tsOutput = new VFMPEGTSOutput(); SetMPEGTSOutput(ref tsOutput); VideoCapture1.Output_Format = tsOutput; break; } case 13: { var movOutput = new VFMOVOutput(); SetMOVOutput(ref movOutput); VideoCapture1.Output_Format = movOutput; break; } } } VideoCapture1.Video_Effects_Enabled = true; VideoCapture1.Video_Effects_Clear(); lbLogos.Items.Clear(); ConfigureVideoEffects(); VideoCapture1.Start(); tcMain.SelectedIndex = 3; tmRecording.Start(); }
private void btStart_Click(object sender, RoutedEventArgs e) { VideoCapture1.Video_Sample_Grabber_Enabled = true; mmLog.Clear(); VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; if (cbRecordAudio.IsChecked == true) { VideoCapture1.Audio_RecordAudio = true; VideoCapture1.Audio_PlayAudio = false; } else { VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Audio_PlayAudio = false; } VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF; VideoCapture1.Video_CaptureDevice = cbVideoInputDevice.Text; VideoCapture1.Video_CaptureDevice_IsAudioSource = true; VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text; VideoCapture1.Audio_CaptureDevice_Format_UseBest = true; VideoCapture1.Video_CaptureFormat = cbVideoInputFormat.Text; VideoCapture1.Video_CaptureFormat_UseBest = cbUseBestVideoInputFormat.IsChecked == true; if (cbFramerate.SelectedIndex != -1) { VideoCapture1.Video_FrameRate = (float)Convert.ToDouble(cbFramerate.Text); } if (rbPreview.IsChecked == true) { VideoCapture1.Mode = VFVideoCaptureMode.VideoPreview; } else { VideoCapture1.Mode = VFVideoCaptureMode.VideoCapture; VideoCapture1.Output_Filename = edOutput.Text; if (rbAVI.IsChecked == true) { var aviOutput = new VFAVIOutput(); aviOutput.ACM.Name = cbAudioCodecs.Text; aviOutput.ACM.Channels = Convert.ToInt32(cbChannels.Text); aviOutput.ACM.BPS = Convert.ToInt32(cbBPS.Text); aviOutput.ACM.SampleRate = Convert.ToInt32(cbSampleRate.Text); aviOutput.Video_Codec = cbVideoCodecs.Text; VideoCapture1.Output_Format = aviOutput; } else if (rbWMV.IsChecked == true) { var wmvOutput = new VFWMVOutput(); wmvOutput.Mode = VFWMVMode.InternalProfile; if (cbWMVInternalProfile9.SelectedIndex != -1) { wmvOutput.Internal_Profile_Name = cbWMVInternalProfile9.Text; } VideoCapture1.Output_Format = wmvOutput; } else if (rbDVDirectstream.IsChecked == true) { var dvDirectcaptureOutput = new VFDirectCaptureDVOutput(); VideoCapture1.Output_Format = dvDirectcaptureOutput; } else { var dvOutput = new VFDVOutput(); dvOutput.Audio_Channels = Convert.ToInt32(cbDVChannels.Text); dvOutput.Audio_SampleRate = Convert.ToInt32(cbDVSampleRate.Text); if (rbDVPAL.IsChecked == true) { dvOutput.Video_Format = VFDVVideoFormat.PAL; } else { dvOutput.Video_Format = VFDVVideoFormat.NTSC; } dvOutput.Type2 = rbDVType2.IsChecked == true; VideoCapture1.Output_Format = dvOutput; } } VideoCapture1.Video_Effects_Enabled = true; VideoCapture1.Video_Effects_Clear(); IVFVideoEffectDeinterlaceCAVT cavt = new VFVideoEffectDeinterlaceCAVT(true, 20); VideoCapture1.Video_Effects_Add(cavt); VideoCapture1.Start(); }
private void btStart_Click(object sender, EventArgs e) { mmLog.Clear(); VideoCapture1.Video_Renderer.Zoom_Ratio = 0; VideoCapture1.Video_Renderer.Zoom_ShiftX = 0; VideoCapture1.Video_Renderer.Zoom_ShiftY = 0; VideoCapture1.Debug_Mode = cbDebugMode.Checked; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; VideoCapture1.Video_Sample_Grabber_Enabled = true; // from screen VideoCapture1.Screen_Capture_Source = new ScreenCaptureSourceSettings(); if (rbScreenCaptureWindow.Checked) { VideoCapture1.Screen_Capture_Source.Mode = VFScreenCaptureMode.Window; VideoCapture1.Screen_Capture_Source.WindowHandle = IntPtr.Zero; try { VideoCapture1.Screen_Capture_Source.WindowHandle = FindWindow(edScreenCaptureWindowName.Text, null); } // ReSharper disable once EmptyGeneralCatchClause catch { } if (VideoCapture1.Screen_Capture_Source.WindowHandle == IntPtr.Zero) { MessageBox.Show("Incorrect window title for screen capture."); return; } } else { VideoCapture1.Screen_Capture_Source.Mode = VFScreenCaptureMode.Screen; } VideoCapture1.Screen_Capture_Source.FrameRate = (float)Convert.ToDouble(edScreenFrameRate.Text); VideoCapture1.Screen_Capture_Source.FullScreen = rbScreenFullScreen.Checked; VideoCapture1.Screen_Capture_Source.Top = Convert.ToInt32(edScreenTop.Text); VideoCapture1.Screen_Capture_Source.Bottom = Convert.ToInt32(edScreenBottom.Text); VideoCapture1.Screen_Capture_Source.Left = Convert.ToInt32(edScreenLeft.Text); VideoCapture1.Screen_Capture_Source.Right = Convert.ToInt32(edScreenRight.Text); VideoCapture1.Screen_Capture_Source.GrabMouseCursor = cbScreenCapture_GrabMouseCursor.Checked; VideoCapture1.Screen_Capture_Source.DisplayIndex = Convert.ToInt32(cbScreenCaptureDisplayIndex.Text); VideoCapture1.Screen_Capture_Source.AllowDesktopDuplicationEngine = cbScreenCapture_DesktopDuplication.Checked; if (cbRecordAudio.Checked) { VideoCapture1.Audio_RecordAudio = true; VideoCapture1.Audio_PlayAudio = false; VideoCapture1.Audio_CaptureDevice = cbAudioInputDevice.Text; VideoCapture1.Audio_CaptureDevice_Format = cbAudioInputFormat.Text; VideoCapture1.Audio_CaptureDevice_Line = cbAudioInputLine.Text; } else { VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Audio_PlayAudio = false; } // apply capture params VideoCapture1.Video_Effects_Enabled = true; VideoCapture1.Video_Effects_Clear(); lbLogos.Items.Clear(); ConfigureVideoEffects(); if (rbPreview.Checked) { VideoCapture1.Mode = VFVideoCaptureMode.ScreenPreview; } else { VideoCapture1.Mode = VFVideoCaptureMode.ScreenCapture; VideoCapture1.Output_Filename = edOutput.Text; switch (cbOutputFormat.SelectedIndex) { case 0: { var aviOutput = new VFAVIOutput(); SetAVIOutput(ref aviOutput); VideoCapture1.Output_Format = aviOutput; break; } case 1: { var mkvOutput = new VFMKVv1Output(); SetMKVOutput(ref mkvOutput); VideoCapture1.Output_Format = mkvOutput; break; } case 2: { var wmvOutput = new VFWMVOutput(); SetWMVOutput(ref wmvOutput); VideoCapture1.Output_Format = wmvOutput; break; } case 3: { var dvOutput = new VFDVOutput(); SetDVOutput(ref dvOutput); VideoCapture1.Output_Format = dvOutput; break; } case 4: { var webmOutput = new VFWebMOutput(); SetWebMOutput(ref webmOutput); VideoCapture1.Output_Format = webmOutput; break; } case 5: { var ffmpegDLLOutput = new VFFFMPEGDLLOutput(); SetFFMPEGDLLOutput(ref ffmpegDLLOutput); VideoCapture1.Output_Format = ffmpegDLLOutput; break; } case 6: { var ffmpegOutput = new VFFFMPEGEXEOutput(); SetFFMPEGEXEOutput(ref ffmpegOutput); VideoCapture1.Output_Format = ffmpegOutput; break; } case 7: { var mp4Output = new VFMP4v8v10Output(); SetMP4Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 8: { var mp4Output = new VFMP4v11Output(); SetMP4v11Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 9: { var gifOutput = new VFAnimatedGIFOutput(); SetGIFOutput(ref gifOutput); VideoCapture1.Output_Format = gifOutput; break; } case 10: { var encOutput = new VFMP4v8v10Output(); SetMP4Output(ref encOutput); encOutput.Encryption = true; encOutput.Encryption_Format = VFEncryptionFormat.MP4_H264_SW_AAC; VideoCapture1.Output_Format = encOutput; break; } case 11: { var tsOutput = new VFMPEGTSOutput(); SetMPEGTSOutput(ref tsOutput); VideoCapture1.Output_Format = tsOutput; break; } case 12: { var movOutput = new VFMOVOutput(); SetMOVOutput(ref movOutput); VideoCapture1.Output_Format = movOutput; break; } } } VideoCapture1.Start(); tcMain.SelectedIndex = 3; tmRecording.Start(); }
private void btStart_Click(object sender, RoutedEventArgs e) { if ((string)btStart.Content == "Stop") { VideoCapture1.Stop(); btStart.Content = "Start"; lbStatus.Content = string.Empty; } else { btStart.IsEnabled = false; lbStatus.Content = "Step 1: Searching video files"; fragmentDuration = Convert.ToInt32(edFragmentDuration.Text) * 60 * 1000; VFMediaPlayerSource engine = VFMediaPlayerSource.File_VLC; switch (cbEngine.SelectedIndex) { case 0: engine = VFMediaPlayerSource.File_DS; break; case 1: engine = VFMediaPlayerSource.File_FFMPEG; break; case 2: engine = VFMediaPlayerSource.File_VLC; break; case 3: engine = VFMediaPlayerSource.LAV; break; } List <string> adList = new List <string>(); adVFPList = new List <VFPFingerPrint>(); foreach (string item in lbAdFolders.Items) { adList.AddRange(FileScanner.SearchVideoInFolder(item)); } lbStatus.Content = "Step 2: Getting fingerprints for ads files"; int progress = 0; foreach (string filename in adList) { pbProgress.Value = progress; string error; var source = new VFPFingerprintSource(filename, engine); var fp = VFPAnalyzer.GetSearchFingerprintForVideoFile(source, out error); if (fp == null) { MessageBox.Show("Unable to get fingerpring for video file: " + filename + ". Error: " + error); } else { adVFPList.Add(fp); } progress += 100 / adList.Count; } pbProgress.Value = 100; searchLiveData = new VFPSearchData(Convert.ToInt32(edFragmentDuration.Text) * 60); if (tempBuffer != IntPtr.Zero) { Marshal.FreeCoTaskMem(tempBuffer); tempBuffer = IntPtr.Zero; } lbStatus.Content = "Step 3: Starting video preview"; VideoCapture1.Video_CaptureDevice = cbVideoSource.Text; VideoCapture1.Video_CaptureFormat = cbVideoFormat.Text; VideoCapture1.Video_CaptureFormat_UseBest = false; VideoCapture1.Video_FrameRate = Convert.ToDouble(cbVideoFrameRate.Text); VideoCapture1.Audio_PlayAudio = false; VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Mode = VFVideoCaptureMode.VideoPreview; VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF; VideoCapture1.Start(); lbStatus.Content = "Step 4: Getting data"; pbProgress.Value = 0; lvResults.Items.Refresh(); btStart.IsEnabled = true; btStart.Content = "Stop"; } }
private void btStart_Click(object sender, EventArgs e) { mmLog.Clear(); VideoCapture1.Video_Sample_Grabber_Enabled = true; VideoCapture1.Video_Renderer.Zoom_Ratio = 0; VideoCapture1.Video_Renderer.Zoom_ShiftX = 0; VideoCapture1.Video_Renderer.Zoom_ShiftY = 0; VideoCapture1.Debug_Mode = cbDebugMode.Checked; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; VideoCapture1.Audio_OutputDevice = "Default DirectSound Device"; if (cbRecordAudio.Checked) { VideoCapture1.Audio_RecordAudio = true; VideoCapture1.Audio_PlayAudio = true; } else { VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Audio_PlayAudio = false; } // apply capture parameters VideoCapture1.Video_CaptureDevice = cbVideoInputDevice.Text; VideoCapture1.Video_CaptureDevice_IsAudioSource = cbUseAudioInputFromVideoCaptureDevice.Checked; VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text; VideoCapture1.Audio_CaptureDevice_Format_UseBest = cbUseBestAudioInputFormat.Checked; VideoCapture1.Video_CaptureDevice_Format_UseBest = cbUseBestVideoInputFormat.Checked; VideoCapture1.Video_CaptureDevice_Format = cbVideoInputFormat.Text; VideoCapture1.Audio_CaptureDevice = cbAudioInputDevice.Text; VideoCapture1.Audio_CaptureDevice_Format = cbAudioInputFormat.Text; if (cbFramerate.SelectedIndex != -1) { VideoCapture1.Video_CaptureDevice_FrameRate = (float)Convert.ToDouble(cbFramerate.Text); } if (rbPreview.Checked) { VideoCapture1.Mode = VFVideoCaptureMode.VideoPreview; } else { VideoCapture1.Mode = VFVideoCaptureMode.VideoCapture; VideoCapture1.Output_Filename = edOutput.Text; switch (cbOutputFormat.SelectedIndex) { case 0: { var aviOutput = new VFAVIOutput(); SetAVIOutput(ref aviOutput); VideoCapture1.Output_Format = aviOutput; break; } case 1: { var mkvOutput = new VFMKVv1Output(); SetMKVOutput(ref mkvOutput); VideoCapture1.Output_Format = mkvOutput; break; } case 2: { var wmvOutput = new VFWMVOutput(); SetWMVOutput(ref wmvOutput); VideoCapture1.Output_Format = wmvOutput; break; } case 3: { var dvOutput = new VFDVOutput(); SetDVOutput(ref dvOutput); VideoCapture1.Output_Format = dvOutput; break; } case 4: { var webmOutput = new VFWebMOutput(); SetWebMOutput(ref webmOutput); VideoCapture1.Output_Format = webmOutput; break; } case 5: { var ffmpegDLLOutput = new VFFFMPEGDLLOutput(); SetFFMPEGDLLOutput(ref ffmpegDLLOutput); VideoCapture1.Output_Format = ffmpegDLLOutput; break; } case 6: { var ffmpegOutput = new VFFFMPEGEXEOutput(); SetFFMPEGEXEOutput(ref ffmpegOutput); VideoCapture1.Output_Format = ffmpegOutput; break; } case 7: { var mp4Output = new VFMP4v8v10Output(); SetMP4Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 8: { var mp4Output = new VFMP4v11Output(); SetMP4v11Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 9: { var gifOutput = new VFAnimatedGIFOutput(); SetGIFOutput(ref gifOutput); VideoCapture1.Output_Format = gifOutput; break; } case 10: { var encOutput = new VFMP4v8v10Output(); SetMP4Output(ref encOutput); encOutput.Encryption = true; encOutput.Encryption_Format = VFEncryptionFormat.MP4_H264_SW_AAC; VideoCapture1.Output_Format = encOutput; break; } case 11: { var tsOutput = new VFMPEGTSOutput(); SetMPEGTSOutput(ref tsOutput); VideoCapture1.Output_Format = tsOutput; break; } case 12: { var movOutput = new VFMOVOutput(); SetMOVOutput(ref movOutput); VideoCapture1.Output_Format = movOutput; break; } } } VideoCapture1.Video_Effects_Enabled = true; VideoCapture1.Video_Effects_Clear(); lbLogos.Items.Clear(); ConfigureVideoEffects(); // Audio processing VideoCapture1.Audio_Effects_Clear(-1); VideoCapture1.Audio_Effects_Enabled = true; VideoCapture1.Audio_Effects_Add(-1, VFAudioEffectType.Amplify, cbAudAmplifyEnabled.Checked, -1, -1); VideoCapture1.Audio_Effects_Add(-1, VFAudioEffectType.Equalizer, cbAudEqualizerEnabled.Checked, -1, -1); VideoCapture1.Audio_Effects_Add(-1, VFAudioEffectType.TrueBass, cbAudTrueBassEnabled.Checked, -1, -1); VideoCapture1.Start(); tcMain.SelectedIndex = 4; tmRecording.Start(); }
private void btStart_Click(object sender, RoutedEventArgs e) { mmLog.Clear(); VideoCapture1.Video_Sample_Grabber_Enabled = true; VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; VideoCapture1.Audio_OutputDevice = "Default DirectSound Device"; if (cbRecordAudio.IsChecked == true) { VideoCapture1.Audio_RecordAudio = true; VideoCapture1.Audio_PlayAudio = true; } else { VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Audio_PlayAudio = false; } // apply capture params VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF; VideoCapture1.Video_CaptureDevice = cbVideoInputDevice.Text; VideoCapture1.Video_CaptureDevice_IsAudioSource = cbUseAudioInputFromVideoCaptureDevice.IsChecked == true; VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text; VideoCapture1.Audio_CaptureDevice_Format_UseBest = cbUseBestAudioInputFormat.IsChecked == true; VideoCapture1.Video_CaptureFormat = cbVideoInputFormat.Text; VideoCapture1.Video_CaptureFormat_UseBest = cbUseBestVideoInputFormat.IsChecked == true; VideoCapture1.Audio_CaptureDevice = cbAudioInputDevice.Text; VideoCapture1.Audio_CaptureDevice_Format = cbAudioInputFormat.Text; if (cbFramerate.SelectedIndex != -1) { VideoCapture1.Video_FrameRate = (float)Convert.ToDouble(cbFramerate.Text); } if (cbMode.SelectedIndex == 0) { VideoCapture1.Mode = VFVideoCaptureMode.VideoPreview; } else if (cbMode.SelectedIndex == 1) { VideoCapture1.Mode = VFVideoCaptureMode.VideoCapture; VideoCapture1.Output_Filename = edOutput.Text; var aviOutput = new VFAVIOutput(); aviOutput.ACM.Name = cbAudioCodecs.Text; aviOutput.ACM.Channels = Convert.ToInt32(cbChannels.Text); aviOutput.ACM.BPS = Convert.ToInt32(cbBPS.Text); aviOutput.ACM.SampleRate = Convert.ToInt32(cbSampleRate.Text); aviOutput.Video_Codec = cbVideoCodecs.Text; VideoCapture1.Output_Format = aviOutput; } else if (cbMode.SelectedIndex == 2) { VideoCapture1.Mode = VFVideoCaptureMode.VideoCapture; VideoCapture1.Output_Filename = edOutput.Text; var wmvOutput = new VFWMVOutput(); wmvOutput.Mode = VFWMVMode.InternalProfile; if (cbWMVInternalProfile9.SelectedIndex != -1) { wmvOutput.Internal_Profile_Name = cbWMVInternalProfile9.Text; } VideoCapture1.Output_Format = wmvOutput; } else { VideoCapture1.Mode = VFVideoCaptureMode.VideoCapture; VideoCapture1.Output_Filename = edOutput.Text; var mp4Output = new VFMP4Output(); int tmp; // Main settings mp4Output.MP4Mode = VFMP4Mode.v10; // Video H264 settings switch (cbH264Profile.SelectedIndex) { case 0: mp4Output.Video_H264.Profile = VFH264Profile.ProfileAuto; break; case 1: mp4Output.Video_H264.Profile = VFH264Profile.ProfileBaseline; break; case 2: mp4Output.Video_H264.Profile = VFH264Profile.ProfileMain; break; case 3: mp4Output.Video_H264.Profile = VFH264Profile.ProfileHigh; break; case 4: mp4Output.Video_H264.Profile = VFH264Profile.ProfileHigh10; break; case 5: mp4Output.Video_H264.Profile = VFH264Profile.ProfileHigh422; break; } switch (cbH264Level.SelectedIndex) { case 0: mp4Output.Video_H264.Level = VFH264Level.LevelAuto; break; case 1: mp4Output.Video_H264.Level = VFH264Level.Level1; break; case 2: mp4Output.Video_H264.Level = VFH264Level.Level11; break; case 3: mp4Output.Video_H264.Level = VFH264Level.Level12; break; case 4: mp4Output.Video_H264.Level = VFH264Level.Level13; break; case 5: mp4Output.Video_H264.Level = VFH264Level.Level2; break; case 6: mp4Output.Video_H264.Level = VFH264Level.Level21; break; case 7: mp4Output.Video_H264.Level = VFH264Level.Level22; break; case 8: mp4Output.Video_H264.Level = VFH264Level.Level3; break; case 9: mp4Output.Video_H264.Level = VFH264Level.Level31; break; case 10: mp4Output.Video_H264.Level = VFH264Level.Level32; break; case 11: mp4Output.Video_H264.Level = VFH264Level.Level4; break; case 12: mp4Output.Video_H264.Level = VFH264Level.Level41; break; case 13: mp4Output.Video_H264.Level = VFH264Level.Level42; break; case 14: mp4Output.Video_H264.Level = VFH264Level.Level5; break; case 15: mp4Output.Video_H264.Level = VFH264Level.Level51; break; } switch (cbH264TargetUsage.SelectedIndex) { case 0: mp4Output.Video_H264.TargetUsage = VFH264TargetUsage.Auto; break; case 1: mp4Output.Video_H264.TargetUsage = VFH264TargetUsage.BestQuality; break; case 2: mp4Output.Video_H264.TargetUsage = VFH264TargetUsage.Balanced; break; case 3: mp4Output.Video_H264.TargetUsage = VFH264TargetUsage.BestSpeed; break; } mp4Output.Video_H264.PictureType = VFH264PictureType.Auto; mp4Output.Video_H264.RateControl = (VFH264RateControl)cbH264RateControl.SelectedIndex; mp4Output.Video_H264.GOP = cbH264GOP.IsChecked == true; mp4Output.Video_H264.BitrateAuto = cbH264AutoBitrate.IsChecked == true; int.TryParse(edH264Bitrate.Text, out tmp); mp4Output.Video_H264.Bitrate = tmp; // Audio AAC settings int.TryParse(cbAACBitrate.Text, out tmp); mp4Output.Audio_AAC.Bitrate = tmp; mp4Output.Audio_AAC.Version = (VFAACVersion)cbAACMPEGVersion.SelectedIndex; mp4Output.Audio_AAC.Output = (VFAACOutput)cbAACOutput.SelectedIndex; mp4Output.Audio_AAC.Object = (VFAACObject)(cbAACObject.SelectedIndex + 1); VideoCapture1.Output_Format = mp4Output; } VideoCapture1.Video_Effects_Enabled = true; VideoCapture1.Video_Effects_Clear(); IVFVideoEffectDeinterlaceCAVT cavt = new VFVideoEffectDeinterlaceCAVT(true, 20); VideoCapture1.Video_Effects_Add(cavt); VideoCapture1.Start(); }
private void btStart_Click(object sender, RoutedEventArgs e) { mmLog.Clear(); VideoCapture1.Video_Sample_Grabber_Enabled = true; VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; // from screen VideoCapture1.Screen_Capture_Source = new ScreenCaptureSourceSettings(); if (rbScreenCaptureWindow.IsChecked == true) { VideoCapture1.Screen_Capture_Source.Mode = VFScreenCaptureMode.Window; VideoCapture1.Screen_Capture_Source.WindowHandle = IntPtr.Zero; try { VideoCapture1.Screen_Capture_Source.WindowHandle = FindWindow(edScreenCaptureWindowName.Text, null); } catch (Exception ex) { MessageBox.Show("Unable to get window handle for screen capture. " + ex.Message); } if (VideoCapture1.Screen_Capture_Source.WindowHandle == IntPtr.Zero) { MessageBox.Show("Incorrect window title for screen capture."); return; } } else { VideoCapture1.Screen_Capture_Source.Mode = VFScreenCaptureMode.Screen; } VideoCapture1.Screen_Capture_Source.FrameRate = (float)Convert.ToDouble(edScreenFrameRate.Text); VideoCapture1.Screen_Capture_Source.FullScreen = rbScreenFullScreen.IsChecked == true; VideoCapture1.Screen_Capture_Source.Top = Convert.ToInt32(edScreenTop.Text); VideoCapture1.Screen_Capture_Source.Bottom = Convert.ToInt32(edScreenBottom.Text); VideoCapture1.Screen_Capture_Source.Left = Convert.ToInt32(edScreenLeft.Text); VideoCapture1.Screen_Capture_Source.Right = Convert.ToInt32(edScreenRight.Text); VideoCapture1.Screen_Capture_Source.GrabMouseCursor = cbScreenCapture_GrabMouseCursor.IsChecked == true; VideoCapture1.Screen_Capture_Source.DisplayIndex = Convert.ToInt32(cbScreenCaptureDisplayIndex.Text); VideoCapture1.Screen_Capture_Source.AllowDesktopDuplicationEngine = cbScreenCapture_DesktopDuplication.IsChecked == true; if (cbRecordAudio.IsChecked == true) { VideoCapture1.Audio_RecordAudio = true; VideoCapture1.Audio_PlayAudio = false; VideoCapture1.Audio_CaptureDevice = cbAudioInputDevice.Text; VideoCapture1.Audio_CaptureDevice_Format = cbAudioInputFormat.Text; VideoCapture1.Audio_CaptureDevice_Line = cbAudioInputLine.Text; } else { VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Audio_PlayAudio = false; } // apply capture parameters VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF; VideoCapture1.Video_Effects_Enabled = true; VideoCapture1.Video_Effects_Clear(); if (cbMode.SelectedIndex == 0) { VideoCapture1.Mode = VFVideoCaptureMode.ScreenPreview; } else if (cbMode.SelectedIndex == 1) { VideoCapture1.Mode = VFVideoCaptureMode.ScreenCapture; VideoCapture1.Output_Filename = edOutput.Text; var aviOutput = new VFAVIOutput { ACM = { Name = cbAudioCodecs.Text, Channels = Convert.ToInt32(cbChannels.Text), BPS = Convert.ToInt32(cbBPS.Text), SampleRate = Convert.ToInt32(cbSampleRate.Text) }, Video_Codec = cbVideoCodecs.Text }; VideoCapture1.Output_Format = aviOutput; } else if (cbMode.SelectedIndex == 2) { VideoCapture1.Mode = VFVideoCaptureMode.ScreenCapture; VideoCapture1.Output_Filename = edOutput.Text; var wmvOutput = new VFWMVOutput { Mode = VFWMVMode.InternalProfile }; if (cbWMVInternalProfile9.SelectedIndex != -1) { wmvOutput.Internal_Profile_Name = cbWMVInternalProfile9.Text; } VideoCapture1.Output_Format = wmvOutput; } else { VideoCapture1.Mode = VFVideoCaptureMode.ScreenCapture; VideoCapture1.Output_Filename = edOutput.Text; var mp4Output = new VFMP4Output(); if (IsWindows7OrNewer()) { mp4Output.MP4Mode = VFMP4Mode.v10; } else { mp4Output.MP4Mode = VFMP4Mode.v8; } VideoCapture1.Output_Format = mp4Output; } VideoCapture1.Start(); }
private void btStart_Click(object sender, RoutedEventArgs e) { if (onvifControl != null) { onvifControl.Disconnect(); onvifControl.Dispose(); onvifControl = null; btONVIFConnect.Content = "Connect"; } mmLog.Clear(); VideoCapture1.Video_Sample_Grabber_Enabled = true; VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Audio_PlayAudio = false; VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF; // source VideoCapture1.IP_Camera_Source = new IPCameraSourceSettings { URL = this.edIPUrl.Text }; switch (cbIPCameraType.SelectedIndex) { case 0: VideoCapture1.IP_Camera_Source.Type = VFIPSource.Auto_VLC; break; case 1: VideoCapture1.IP_Camera_Source.Type = VFIPSource.Auto_FFMPEG; break; case 2: VideoCapture1.IP_Camera_Source.Type = VFIPSource.Auto_LAV; break; case 3: VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_Live555; break; case 4: VideoCapture1.IP_Camera_Source.Type = VFIPSource.HTTP_FFMPEG; break; case 5: VideoCapture1.IP_Camera_Source.Type = VFIPSource.MMS_WMV; break; case 6: VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_UDP_FFMPEG; break; case 7: VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_TCP_FFMPEG; break; case 8: VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_HTTP_FFMPEG; break; } VideoCapture1.IP_Camera_Source.AudioCapture = cbIPAudioCapture.IsChecked == true; VideoCapture1.IP_Camera_Source.Login = edIPLogin.Text; VideoCapture1.IP_Camera_Source.Password = edIPPassword.Text; VideoCapture1.IP_Camera_Source.VLC_ZeroClockJitterEnabled = cbVLCZeroClockJitter.IsChecked == true; VideoCapture1.IP_Camera_Source.VLC_CustomLatency = Convert.ToInt32(edVLCCacheSize.Text); VideoCapture1.IP_Camera_Source.ForcedFramerate = Convert.ToDouble(edIPForcedFramerate.Text); VideoCapture1.IP_Camera_Source.ForcedFramerate_InstanceID = edIPForcedFramerateID.Text[0]; if (cbIPCameraONVIF.IsChecked == true) { VideoCapture1.IP_Camera_Source.ONVIF_Source = true; if (cbONVIFProfile.SelectedIndex != -1) { VideoCapture1.IP_Camera_Source.ONVIF_SourceProfile = cbONVIFProfile.Text; } } if (cbIPDisconnect.IsChecked == true) { VideoCapture1.IP_Camera_Source.DisconnectEventInterval = 5000; } if (rbPreview.IsChecked == true) { VideoCapture1.Mode = VFVideoCaptureMode.IPPreview; } else if (rbCaptureAVI.IsChecked == true) { VideoCapture1.Mode = VFVideoCaptureMode.IPCapture; VideoCapture1.Output_Filename = edOutputAVI.Text; var aviOutput = new VFAVIOutput { ACM = { Name = this.cbAudioCodecs.Text, Channels = Convert.ToInt32(this.cbChannels.Text), BPS = Convert.ToInt32(this.cbBPS.Text), SampleRate = Convert.ToInt32(this.cbSampleRate.Text) }, Video_Codec = this.cbVideoCodecs.Text }; VideoCapture1.Output_Format = aviOutput; } else { VideoCapture1.Mode = VFVideoCaptureMode.IPCapture; VideoCapture1.Output_Filename = edOutputMP4.Text; var mp4Output = new VFMP4Output(); int tmp; // Main settings mp4Output.MP4Mode = VFMP4Mode.v10; // Video H264 settings switch (cbH264Profile.SelectedIndex) { case 0: mp4Output.Video_H264.Profile = VFH264Profile.ProfileAuto; break; case 1: mp4Output.Video_H264.Profile = VFH264Profile.ProfileBaseline; break; case 2: mp4Output.Video_H264.Profile = VFH264Profile.ProfileMain; break; case 3: mp4Output.Video_H264.Profile = VFH264Profile.ProfileHigh; break; case 4: mp4Output.Video_H264.Profile = VFH264Profile.ProfileHigh10; break; case 5: mp4Output.Video_H264.Profile = VFH264Profile.ProfileHigh422; break; } switch (cbH264Level.SelectedIndex) { case 0: mp4Output.Video_H264.Level = VFH264Level.LevelAuto; break; case 1: mp4Output.Video_H264.Level = VFH264Level.Level1; break; case 2: mp4Output.Video_H264.Level = VFH264Level.Level11; break; case 3: mp4Output.Video_H264.Level = VFH264Level.Level12; break; case 4: mp4Output.Video_H264.Level = VFH264Level.Level13; break; case 5: mp4Output.Video_H264.Level = VFH264Level.Level2; break; case 6: mp4Output.Video_H264.Level = VFH264Level.Level21; break; case 7: mp4Output.Video_H264.Level = VFH264Level.Level22; break; case 8: mp4Output.Video_H264.Level = VFH264Level.Level3; break; case 9: mp4Output.Video_H264.Level = VFH264Level.Level31; break; case 10: mp4Output.Video_H264.Level = VFH264Level.Level32; break; case 11: mp4Output.Video_H264.Level = VFH264Level.Level4; break; case 12: mp4Output.Video_H264.Level = VFH264Level.Level41; break; case 13: mp4Output.Video_H264.Level = VFH264Level.Level42; break; case 14: mp4Output.Video_H264.Level = VFH264Level.Level5; break; case 15: mp4Output.Video_H264.Level = VFH264Level.Level51; break; } switch (cbH264TargetUsage.SelectedIndex) { case 0: mp4Output.Video_H264.TargetUsage = VFH264TargetUsage.Auto; break; case 1: mp4Output.Video_H264.TargetUsage = VFH264TargetUsage.BestQuality; break; case 2: mp4Output.Video_H264.TargetUsage = VFH264TargetUsage.Balanced; break; case 3: mp4Output.Video_H264.TargetUsage = VFH264TargetUsage.BestSpeed; break; } mp4Output.Video_H264.PictureType = VFH264PictureType.Auto; mp4Output.Video_H264.RateControl = (VFH264RateControl)cbH264RateControl.SelectedIndex; mp4Output.Video_H264.GOP = cbH264GOP.IsChecked == true; mp4Output.Video_H264.BitrateAuto = cbH264AutoBitrate.IsChecked == true; int.TryParse(edH264Bitrate.Text, out tmp); mp4Output.Video_H264.Bitrate = tmp; // Audio AAC settings int.TryParse(cbAACBitrate.Text, out tmp); mp4Output.Audio_AAC.Bitrate = tmp; mp4Output.Audio_AAC.Version = (VFAACVersion)cbAACMPEGVersion.SelectedIndex; mp4Output.Audio_AAC.Output = (VFAACOutput)cbAACOutput.SelectedIndex; mp4Output.Audio_AAC.Object = (VFAACObject)(cbAACObject.SelectedIndex + 1); VideoCapture1.Output_Format = mp4Output; } VideoCapture1.Start(); }
private void btStart_Click(object sender, RoutedEventArgs e) { if ((string)btStart.Content == "Stop") { VideoCapture1.Stop(); Thread.Sleep(500); ProcessVideoDelegateMethod(); btStart.Content = "Start"; lbStatus.Content = string.Empty; if (_tempBuffer != IntPtr.Zero) { Marshal.FreeCoTaskMem(_tempBuffer); _tempBuffer = IntPtr.Zero; } } else { btStart.IsEnabled = false; lbStatus.Content = "Step 1: Searching video files"; _fragmentCount = 0; _overlapFragmentCount = 0; var engine = VFMediaPlayerSource.File_VLC; switch (cbEngine.SelectedIndex) { case 0: engine = VFMediaPlayerSource.File_DS; break; case 1: engine = VFMediaPlayerSource.File_FFMPEG; break; case 2: engine = VFMediaPlayerSource.File_VLC; break; case 3: engine = VFMediaPlayerSource.LAV; break; } var adList = new List <string>(); _adVFPList = new List <VFPFingerPrint>(); foreach (string item in lbAdFolders.Items) { adList.AddRange(FileScanner.SearchVideoInFolder(item)); } lbStatus.Content = "Step 2: Getting fingerprints for ads files"; if (adList.Count == 0) { btStart.Content = "Start"; lbStatus.Content = string.Empty; MessageBox.Show("Ads list is empty!"); return; } int progress = 0; foreach (string filename in adList) { pbProgress.Value = progress; string error = ""; VFPFingerPrint fp; if (File.Exists(filename + ".vfsigx")) { fp = VFPFingerPrint.Load(filename + ".vfsigx"); } else { var source = new VFPFingerprintSource(filename, engine); foreach (var area in _ignoredAreas) { source.IgnoredAreas.Add(area); } fp = VFPAnalyzer.GetSearchFingerprintForVideoFile(source, out error); } if (fp == null) { MessageBox.Show("Unable to get fingerpring for video file: " + filename + ". Error: " + error); } else { fp.Save(filename + ".vfsigx", false); _adVFPList.Add(fp); } progress += 100 / adList.Count; } int fragmentDurationProperty = Convert.ToInt32(edFragmentDuration.Text); if (fragmentDurationProperty != 0) { _fragmentDuration = fragmentDurationProperty * 1000; } else { var maxDuration = _adVFPList.Max((print => print.Duration)); long minfragmentDuration = (((maxDuration + 1000) / 1000) + 1) * 1000; _fragmentDuration = minfragmentDuration * 2; } pbProgress.Value = 100; if (_tempBuffer != IntPtr.Zero) { Marshal.FreeCoTaskMem(_tempBuffer); _tempBuffer = IntPtr.Zero; } lbStatus.Content = "Step 3: Starting video preview"; if (cbSource.SelectedIndex == 0) { VideoCapture1.Video_CaptureDevice = cbVideoSource.Text; VideoCapture1.Video_CaptureFormat = cbVideoFormat.Text; VideoCapture1.Video_CaptureFormat_UseBest = false; VideoCapture1.Video_FrameRate = Convert.ToDouble(cbVideoFrameRate.Text); VideoCapture1.Mode = VFVideoCaptureMode.VideoPreview; } else { var ip = new IPCameraSourceSettings { URL = edNetworkSourceURL.Text, Login = edNetworkSourceLogin.Text, Password = edNetworkSourcePassword.Text }; switch (cbNetworkSourceEngine.SelectedIndex) { case 0: ip.Type = VFIPSource.Auto_LAV; break; case 1: ip.Type = VFIPSource.Auto_VLC; break; case 2: ip.Type = VFIPSource.Auto_FFMPEG; break; } VideoCapture1.IP_Camera_Source = ip; VideoCapture1.Mode = VFVideoCaptureMode.IPPreview; } VideoCapture1.Audio_PlayAudio = false; VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF; VideoCapture1.Start(); lbStatus.Content = "Step 4: Getting data"; pbProgress.Value = 0; lvResults.Items.Refresh(); btStart.IsEnabled = true; btStart.Content = "Stop"; } }
private void btStart_Click(object sender, EventArgs e) { mmLog.Clear(); VideoCapture1.Video_Sample_Grabber_Enabled = true; VideoCapture1.Video_Renderer.Zoom_Ratio = 0; VideoCapture1.Video_Renderer.Zoom_ShiftX = 0; VideoCapture1.Video_Renderer.Zoom_ShiftY = 0; VideoCapture1.Debug_Mode = cbDebugMode.Checked; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; VideoCapture1.Audio_OutputDevice = "Default DirectSound Device"; if (cbRecordAudio.Checked) { VideoCapture1.Audio_RecordAudio = true; VideoCapture1.Audio_PlayAudio = true; } else { VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Audio_PlayAudio = false; } // apply capture parameters VideoCapture1.Video_CaptureDevice = cbVideoInputDevice.Text; VideoCapture1.Video_CaptureDevice_IsAudioSource = cbUseAudioInputFromVideoCaptureDevice.Checked; VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text; VideoCapture1.Audio_CaptureDevice_Format_UseBest = cbUseBestAudioInputFormat.Checked; VideoCapture1.Video_CaptureDevice_Format_UseBest = cbUseBestVideoInputFormat.Checked; VideoCapture1.Video_CaptureDevice_Format = cbVideoInputFormat.Text; VideoCapture1.Audio_CaptureDevice = cbAudioInputDevice.Text; VideoCapture1.Audio_CaptureDevice_Format = cbAudioInputFormat.Text; if (cbFramerate.SelectedIndex != -1) { VideoCapture1.Video_CaptureDevice_FrameRate = (float)Convert.ToDouble(cbFramerate.Text); } if (cbMode.SelectedIndex == 0) { VideoCapture1.Mode = VFVideoCaptureMode.VideoPreview; } else { VideoCapture1.Mode = VFVideoCaptureMode.VideoCapture; VideoCapture1.Output_Filename = edOutput.Text; if (cbMode.SelectedIndex == 1) { var aviOutput = new VFAVIOutput(); aviOutput.ACM.Name = cbAudioCodecs.Text; aviOutput.ACM.Channels = Convert.ToInt32(cbChannels.Text); aviOutput.ACM.BPS = Convert.ToInt32(cbBPS.Text); aviOutput.ACM.SampleRate = Convert.ToInt32(cbSampleRate.Text); aviOutput.Video_Codec = cbVideoCodecs.Text; VideoCapture1.Output_Format = aviOutput; } else if (cbMode.SelectedIndex == 2) { var wmvOutput = new VFWMVOutput(); wmvOutput.Mode = VFWMVMode.InternalProfile; if (cbWMVInternalProfile9.SelectedIndex != -1) { wmvOutput.Internal_Profile_Name = cbWMVInternalProfile9.Text; } VideoCapture1.Output_Format = wmvOutput; } else if (cbMode.SelectedIndex == 3) { var mp4Output = new VFMP4Output(); if (IsWindows7OrNewer()) { mp4Output.MP4Mode = VFMP4Mode.v11; } else { mp4Output.MP4Mode = VFMP4Mode.v8; } VideoCapture1.Output_Format = mp4Output; } } VideoCapture1.Video_Effects_Enabled = true; VideoCapture1.Video_Effects_Clear(); // Audio processing VideoCapture1.Audio_Effects_Clear(-1); VideoCapture1.Audio_Effects_Enabled = true; VideoCapture1.Audio_Effects_Add(-1, VFAudioEffectType.Amplify, cbAudAmplifyEnabled.Checked, -1, -1); VideoCapture1.Audio_Effects_Add(-1, VFAudioEffectType.Equalizer, cbAudEqualizerEnabled.Checked, -1, -1); VideoCapture1.Audio_Effects_Add(-1, VFAudioEffectType.TrueBass, cbAudTrueBassEnabled.Checked, -1, -1); VideoCapture1.Start(); }
private void btStart_Click(object sender, EventArgs e) { if (onvifControl != null) { onvifControl.Disconnect(); onvifControl.Dispose(); onvifControl = null; btONVIFConnect.Text = "Connect"; } mmLog.Clear(); VideoCapture1.Video_Renderer.Zoom_Ratio = 0; VideoCapture1.Video_Renderer.Zoom_ShiftX = 0; VideoCapture1.Video_Renderer.Zoom_ShiftY = 0; VideoCapture1.Debug_Mode = cbDebugMode.Checked; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; VideoCapture1.Audio_RecordAudio = true; VideoCapture1.Audio_PlayAudio = true; 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; } VideoCapture1.Video_Sample_Grabber_Enabled = true; // source VideoCapture1.IP_Camera_Source = new IPCameraSourceSettings { URL = edIPUrl.Text }; switch (cbIPCameraType.SelectedIndex) { case 0: VideoCapture1.IP_Camera_Source.Type = VFIPSource.Auto_VLC; break; case 1: VideoCapture1.IP_Camera_Source.Type = VFIPSource.Auto_FFMPEG; break; case 2: VideoCapture1.IP_Camera_Source.Type = VFIPSource.Auto_LAV; break; case 3: VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_Live555; break; case 4: VideoCapture1.IP_Camera_Source.Type = VFIPSource.HTTP_FFMPEG; break; case 5: VideoCapture1.IP_Camera_Source.Type = VFIPSource.MMS_WMV; break; case 6: VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_UDP_FFMPEG; break; case 7: VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_TCP_FFMPEG; break; case 8: VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_HTTP_FFMPEG; break; } VideoCapture1.IP_Camera_Source.AudioCapture = cbIPAudioCapture.Checked; VideoCapture1.IP_Camera_Source.Login = edIPLogin.Text; VideoCapture1.IP_Camera_Source.Password = edIPPassword.Text; VideoCapture1.IP_Camera_Source.VLC_ZeroClockJitterEnabled = cbVLCZeroClockJitter.Checked; VideoCapture1.IP_Camera_Source.VLC_CustomLatency = Convert.ToInt32(edVLCCacheSize.Text); if (cbIPCameraONVIF.Checked) { VideoCapture1.IP_Camera_Source.ONVIF_Source = true; if (cbONVIFProfile.SelectedIndex != -1) { VideoCapture1.IP_Camera_Source.ONVIF_SourceProfile = cbONVIFProfile.Text; } } if (rbPreview.Checked) { VideoCapture1.Mode = VFVideoCaptureMode.IPPreview; } else if (rbCaptureAVI.Checked) { VideoCapture1.Mode = VFVideoCaptureMode.IPCapture; VideoCapture1.Output_Filename = edOutputAVI.Text; var aviOutput = new VFAVIOutput { ACM = { Name = this.cbAudioCodecs.Text, Channels = Convert.ToInt32(this.cbChannels.Text), BPS = Convert.ToInt32(this.cbBPS.Text), SampleRate = Convert.ToInt32(this.cbSampleRate.Text) }, Video_Codec = this.cbVideoCodecs.Text }; VideoCapture1.Output_Format = aviOutput; } else { VideoCapture1.Mode = VFVideoCaptureMode.IPCapture; VideoCapture1.Output_Filename = edOutputMP4.Text; var mp4Output = new VFMP4Output(); if (IsWindows7OrNewer()) { mp4Output.MP4Mode = VFMP4Mode.v11; } else { mp4Output.MP4Mode = VFMP4Mode.v8; } VideoCapture1.Output_Format = mp4Output; } VideoCapture1.Start(); }
private void btStart_Click(object sender, RoutedEventArgs e) { if (onvifControl != null) { onvifControl.Disconnect(); onvifControl.Dispose(); onvifControl = null; btONVIFConnect.Content = "Connect"; } mmLog.Clear(); VideoCapture1.Video_Sample_Grabber_Enabled = true; VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Audio_PlayAudio = false; VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF; // source VideoCapture1.IP_Camera_Source = new IPCameraSourceSettings { URL = edIPUrl.Text }; switch (cbIPCameraType.SelectedIndex) { case 0: VideoCapture1.IP_Camera_Source.Type = VFIPSource.Auto_VLC; break; case 1: VideoCapture1.IP_Camera_Source.Type = VFIPSource.Auto_FFMPEG; break; case 2: VideoCapture1.IP_Camera_Source.Type = VFIPSource.Auto_LAV; break; case 3: VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_Live555; break; case 4: VideoCapture1.IP_Camera_Source.Type = VFIPSource.HTTP_FFMPEG; break; case 5: VideoCapture1.IP_Camera_Source.Type = VFIPSource.MMS_WMV; break; case 6: VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_UDP_FFMPEG; break; case 7: VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_TCP_FFMPEG; break; case 8: VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_HTTP_FFMPEG; break; } VideoCapture1.IP_Camera_Source.AudioCapture = cbIPAudioCapture.IsChecked == true; VideoCapture1.IP_Camera_Source.Login = edIPLogin.Text; VideoCapture1.IP_Camera_Source.Password = edIPPassword.Text; VideoCapture1.IP_Camera_Source.VLC_ZeroClockJitterEnabled = cbVLCZeroClockJitter.IsChecked == true; VideoCapture1.IP_Camera_Source.VLC_CustomLatency = Convert.ToInt32(edVLCCacheSize.Text); VideoCapture1.IP_Camera_Source.ForcedFramerate = Convert.ToDouble(edIPForcedFramerate.Text); VideoCapture1.IP_Camera_Source.ForcedFramerate_InstanceID = edIPForcedFramerateID.Text[0]; if (cbIPCameraONVIF.IsChecked == true) { VideoCapture1.IP_Camera_Source.ONVIF_Source = true; if (cbONVIFProfile.SelectedIndex != -1) { VideoCapture1.IP_Camera_Source.ONVIF_SourceProfile = cbONVIFProfile.Text; } } if (cbIPDisconnect.IsChecked == true) { VideoCapture1.IP_Camera_Source.DisconnectEventInterval = 5000; } if (rbPreview.IsChecked == true) { VideoCapture1.Mode = VFVideoCaptureMode.IPPreview; } else if (rbCapture.IsChecked == true) { VideoCapture1.Mode = VFVideoCaptureMode.IPCapture; VideoCapture1.Output_Filename = edOutput.Text; switch (cbOutputFormat.SelectedIndex) { case 0: { var aviOutput = new VFAVIOutput(); SetAVIOutput(ref aviOutput); VideoCapture1.Output_Format = aviOutput; break; } case 1: { var mkvOutput = new VFMKVv1Output(); SetMKVOutput(ref mkvOutput); VideoCapture1.Output_Format = mkvOutput; break; } case 2: { var wmvOutput = new VFWMVOutput(); SetWMVOutput(ref wmvOutput); VideoCapture1.Output_Format = wmvOutput; break; } case 3: { var dvOutput = new VFDVOutput(); SetDVOutput(ref dvOutput); VideoCapture1.Output_Format = dvOutput; break; } case 4: { var webmOutput = new VFWebMOutput(); SetWebMOutput(ref webmOutput); VideoCapture1.Output_Format = webmOutput; break; } case 5: { var ffmpegDLLOutput = new VFFFMPEGDLLOutput(); SetFFMPEGDLLOutput(ref ffmpegDLLOutput); VideoCapture1.Output_Format = ffmpegDLLOutput; break; } case 6: { var ffmpegOutput = new VFFFMPEGEXEOutput(); SetFFMPEGEXEOutput(ref ffmpegOutput); VideoCapture1.Output_Format = ffmpegOutput; break; } case 7: { var mp4Output = new VFMP4v8v10Output(); SetMP4Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 8: { var mp4Output = new VFMP4v11Output(); SetMP4v11Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 9: { var gifOutput = new VFAnimatedGIFOutput(); SetGIFOutput(ref gifOutput); VideoCapture1.Output_Format = gifOutput; break; } case 10: { var encOutput = new VFMP4v8v10Output(); SetMP4Output(ref encOutput); encOutput.Encryption = true; encOutput.Encryption_Format = VFEncryptionFormat.MP4_H264_SW_AAC; VideoCapture1.Output_Format = encOutput; break; } case 11: { var tsOutput = new VFMPEGTSOutput(); SetMPEGTSOutput(ref tsOutput); VideoCapture1.Output_Format = tsOutput; break; } case 12: { var movOutput = new VFMOVOutput(); SetMOVOutput(ref movOutput); VideoCapture1.Output_Format = movOutput; break; } } } VideoCapture1.Video_Effects_Enabled = true; VideoCapture1.Video_Effects_Clear(); lbLogos.Items.Clear(); ConfigureVideoEffects(); VideoCapture1.Start(); tcMain.SelectedIndex = 2; tmRecording.Start(); }
private void btStart_Click(object sender, EventArgs e) { VideoCapture1.Video_Renderer.Zoom_Ratio = 0; VideoCapture1.Video_Renderer.Zoom_ShiftX = 0; VideoCapture1.Video_Renderer.Zoom_ShiftY = 0; VideoCapture1.Debug_Mode = cbDebugMode.Checked; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; VideoCapture1.Audio_RecordAudio = false; VideoCapture1.Audio_PlayAudio = false; var bmp = new Bitmap(Properties.Resources._1); VideoCapture1.Push_Source = new PushSourceSettings { VideoPresent = true, VideoWidth = bmp.Width, VideoHeight = bmp.Height, VideoFrameRate = 25.0f }; bmp.Dispose(); if (rbPreview.Checked) { VideoCapture1.Mode = VFVideoCaptureMode.PushSourcePreview; } else if (rbCapture.Checked) { VideoCapture1.Mode = VFVideoCaptureMode.PushSourceCapture; VideoCapture1.Output_Filename = edOutput.Text; switch (cbOutputFormat.SelectedIndex) { case 0: { var aviOutput = new VFAVIOutput(); SetAVIOutput(ref aviOutput); VideoCapture1.Output_Format = aviOutput; break; } case 1: { var mkvOutput = new VFMKVv1Output(); SetMKVOutput(ref mkvOutput); VideoCapture1.Output_Format = mkvOutput; break; } case 2: { var wmvOutput = new VFWMVOutput(); SetWMVOutput(ref wmvOutput); VideoCapture1.Output_Format = wmvOutput; break; } case 3: { var dvOutput = new VFDVOutput(); SetDVOutput(ref dvOutput); VideoCapture1.Output_Format = dvOutput; break; } case 4: { var webmOutput = new VFWebMOutput(); SetWebMOutput(ref webmOutput); VideoCapture1.Output_Format = webmOutput; break; } case 5: { var ffmpegDLLOutput = new VFFFMPEGDLLOutput(); SetFFMPEGDLLOutput(ref ffmpegDLLOutput); VideoCapture1.Output_Format = ffmpegDLLOutput; break; } case 6: { var ffmpegOutput = new VFFFMPEGEXEOutput(); SetFFMPEGEXEOutput(ref ffmpegOutput); VideoCapture1.Output_Format = ffmpegOutput; break; } case 7: { var mp4Output = new VFMP4v8v10Output(); SetMP4Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 8: { var mp4Output = new VFMP4v11Output(); SetMP4v11Output(ref mp4Output); VideoCapture1.Output_Format = mp4Output; break; } case 9: { var gifOutput = new VFAnimatedGIFOutput(); SetGIFOutput(ref gifOutput); VideoCapture1.Output_Format = gifOutput; break; } case 10: { var encOutput = new VFMP4v8v10Output(); SetMP4Output(ref encOutput); encOutput.Encryption = true; encOutput.Encryption_Format = VFEncryptionFormat.MP4_H264_SW_AAC; VideoCapture1.Output_Format = encOutput; break; } case 11: { var tsOutput = new VFMPEGTSOutput(); SetMPEGTSOutput(ref tsOutput); VideoCapture1.Output_Format = tsOutput; break; } case 12: { var movOutput = new VFMOVOutput(); SetMOVOutput(ref movOutput); VideoCapture1.Output_Format = movOutput; break; } } } VideoCapture1.Start(); tcMain.SelectedIndex = 2; tmRecording.Start(); PushImages(); }
private void btStart_Click(object sender, EventArgs e) { VideoCapture1.Video_Renderer.Zoom_Ratio = 0; VideoCapture1.Video_Renderer.Zoom_ShiftX = 0; VideoCapture1.Video_Renderer.Zoom_ShiftY = 0; VideoCapture1.Debug_Mode = cbDebugMode.Checked; VideoCapture1.Debug_Dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"; VideoCapture1.Audio_RecordAudio = true; VideoCapture1.Audio_PlayAudio = true; var bmp = new Bitmap(Properties.Resources._1); VideoCapture1.Push_Source = new PushSourceSettings { VideoPresent = true, VideoWidth = bmp.Width, VideoHeight = bmp.Height, VideoFrameRate = 25.0f }; bmp.Dispose(); if (rbPreview.Checked) { VideoCapture1.Mode = VFVideoCaptureMode.PushSourcePreview; } else if (rbCaptureAVI.Checked) { VideoCapture1.Mode = VFVideoCaptureMode.PushSourceCapture; VideoCapture1.Output_Filename = edOutputAVI.Text; var aviOutput = new VFAVIOutput { ACM = { Name = cbAudioCodecs.Text, Channels = Convert.ToInt32(cbChannels.Text), BPS = Convert.ToInt32(cbBPS.Text), SampleRate = Convert.ToInt32(cbSampleRate.Text) }, Video_Codec = cbVideoCodecs.Text }; VideoCapture1.Output_Format = aviOutput; } else { VideoCapture1.Mode = VFVideoCaptureMode.PushSourceCapture; VideoCapture1.Output_Filename = edOutputMP4.Text; var mp4Output = new VFMP4Output(); if (IsWindows7OrNewer()) { mp4Output.MP4Mode = VFMP4Mode.v10; } else { mp4Output.MP4Mode = VFMP4Mode.v8; } VideoCapture1.Output_Format = mp4Output; } VideoCapture1.Start(); PushImages(); }