private void btImageLogoAdd_Click(object sender, EventArgs e) { var dlg = new ImageLogoSettingsDialog(); var name = dlg.GenerateNewEffectName(VideoCapture1.Core); var effect = new VFVideoEffectImageLogo(true, name); VideoCapture1.Video_Effects_Add(effect); lbLogos.Items.Add(effect.Name); dlg.Fill(effect); dlg.ShowDialog(this); dlg.Dispose(); }
private void tbLightness_Scroll(object sender, EventArgs e) { IVFVideoEffectLightness lightness; var effect = VideoCapture1.Video_Effects_Get("Lightness"); if (effect == null) { lightness = new VFVideoEffectLightness(true, tbLightness.Value); VideoCapture1.Video_Effects_Add(lightness); } else { lightness = effect as IVFVideoEffectLightness; if (lightness != null) { lightness.Value = tbLightness.Value; } } }
private void cbGreyscale_CheckedChanged(object sender, EventArgs e) { IVFVideoEffectGrayscale grayscale; var effect = VideoCapture1.Video_Effects_Get("Grayscale"); if (effect == null) { grayscale = new VFVideoEffectGrayscale(cbGreyscale.Checked); VideoCapture1.Video_Effects_Add(grayscale); } else { grayscale = effect as IVFVideoEffectGrayscale; if (grayscale != null) { grayscale.Enabled = cbGreyscale.Checked; } } }
private void cbInvert_CheckedChanged(object sender, EventArgs e) { IVFVideoEffectInvert invert; var effect = VideoCapture1.Video_Effects_Get("Invert"); if (effect == null) { invert = new VFVideoEffectInvert(cbInvert.Checked); VideoCapture1.Video_Effects_Add(invert); } else { invert = effect as IVFVideoEffectInvert; if (invert != null) { invert.Enabled = cbInvert.Checked; } } }
private void cbFlipX_CheckedChanged(object sender, EventArgs e) { IVFVideoEffectFlipDown flip; var effect = VideoCapture1.Video_Effects_Get("FlipDown"); if (effect == null) { flip = new VFVideoEffectFlipHorizontal(cbFlipX.Checked); VideoCapture1.Video_Effects_Add(flip); } else { flip = effect as IVFVideoEffectFlipDown; if (flip != null) { flip.Enabled = cbFlipX.Checked; } } }
private void cbFlipY_CheckedChanged(object sender, EventArgs e) { IVFVideoEffectFlipRight flip; var effect = VideoCapture1.Video_Effects_Get("FlipRight"); if (effect == null) { flip = new VFVideoEffectFlipVertical(cbFlipY.Checked); VideoCapture1.Video_Effects_Add(flip); } else { flip = effect as IVFVideoEffectFlipRight; if (flip != null) { flip.Enabled = cbFlipY.Checked; } } }
private void tbSaturation_Scroll(object sender, EventArgs e) { IVFVideoEffectSaturation saturation; var effect = VideoCapture1.Video_Effects_Get("Saturation"); if (effect == null) { saturation = new VFVideoEffectSaturation(tbSaturation.Value); VideoCapture1.Video_Effects_Add(saturation); } else { saturation = effect as IVFVideoEffectSaturation; if (saturation != null) { saturation.Value = tbSaturation.Value; } } }
private void tbContrast_Scroll(object sender, EventArgs e) { IVFVideoEffectContrast contrast; var effect = VideoCapture1.Video_Effects_Get("Contrast"); if (effect == null) { contrast = new VFVideoEffectContrast(true, tbContrast.Value); VideoCapture1.Video_Effects_Add(contrast); } else { contrast = effect as IVFVideoEffectContrast; if (contrast != null) { contrast.Value = tbContrast.Value; } } }
private void tbLightness_Scroll(object sender, RoutedPropertyChangedEventArgs <double> e) { IVFVideoEffectLightness lightness; var effect = VideoCapture1.Video_Effects_Get("Lightness"); if (effect == null) { lightness = new VFVideoEffectLightness(true, (int)tbLightness.Value); VideoCapture1.Video_Effects_Add(lightness); } else { lightness = effect as IVFVideoEffectLightness; if (lightness != null) { lightness.Value = (int)tbLightness.Value; } } }
private void tbContrast_Scroll(object sender, RoutedPropertyChangedEventArgs <double> e) { IVFVideoEffectContrast contrast; var effect = VideoCapture1.Video_Effects_Get("Contrast"); if (effect == null) { contrast = new VFVideoEffectContrast(true, (int)tbContrast.Value); VideoCapture1.Video_Effects_Add(contrast); } else { contrast = effect as IVFVideoEffectContrast; if (contrast != null) { contrast.Value = (int)tbContrast.Value; } } }
private void CbFlipY_Checked(object sender, RoutedEventArgs e) { IVFVideoEffectFlipRight flip; var effect = VideoCapture1.Video_Effects_Get("FlipRight"); if (effect == null) { flip = new VFVideoEffectFlipRight(cbFlipY.IsChecked == true); VideoCapture1.Video_Effects_Add(flip); } else { flip = effect as IVFVideoEffectFlipRight; if (flip != null) { flip.Enabled = cbFlipY.IsChecked == true; } } }
private void cbDeinterlaceCAVT_CheckedChanged(object sender, EventArgs e) { IVFVideoEffectDeinterlaceCAVT cavt; var effect = VideoCapture1.Video_Effects_Get("DeinterlaceCAVT"); if (effect == null) { cavt = new VFVideoEffectDeinterlaceCAVT(cbDeinterlaceCAVT.Checked, 20); VideoCapture1.Video_Effects_Add(cavt); } else { cavt = effect as IVFVideoEffectDeinterlaceCAVT; if (cavt != null) { cavt.Enabled = cbDeinterlaceCAVT.Checked; } } }
private void tbSaturation_Scroll(object sender, RoutedPropertyChangedEventArgs <double> e) { if (VideoCapture1 != null) { IVFVideoEffectSaturation saturation; var effect = VideoCapture1.Video_Effects_Get("Saturation"); if (effect == null) { saturation = new VFVideoEffectSaturation((int)tbSaturation.Value); VideoCapture1.Video_Effects_Add(saturation); } else { saturation = effect as IVFVideoEffectSaturation; if (saturation != null) { saturation.Value = (int)tbSaturation.Value; } } } }
private void cbTextLogo_CheckedChanged(object sender, RoutedEventArgs e) { if (VideoCapture1 == null) { return; } IVFVideoEffectTextLogo textLogo; var effect = VideoCapture1.Video_Effects_Get("TextLogo"); if (effect == null) { textLogo = new VFVideoEffectTextLogo(cbTextLogo.IsChecked == true); VideoCapture1.Video_Effects_Add(textLogo); } else { textLogo = effect as IVFVideoEffectTextLogo; } if (textLogo == null) { MessageBox.Show("Unable to configure text logo effect."); return; } textLogo.Enabled = cbTextLogo.IsChecked == true; textLogo.Text = edTextLogo.Text; textLogo.Left = Convert.ToInt32(edTextLogoLeft.Text); textLogo.Top = Convert.ToInt32(edTextLogoTop.Text); textLogo.Font = fontDialog.Font; textLogo.FontColor = fontDialog.Color; textLogo.TransparencyLevel = (int)tbTextLogoTransp.Value; textLogo.Update(); }
private void CbDeinterlaceCAVT_Checked(object sender, RoutedEventArgs e) { if (VideoCapture1 == null) { return; } IVFVideoEffectDeinterlaceCAVT cavt; var effect = VideoCapture1.Video_Effects_Get("DeinterlaceCAVT"); if (effect == null) { cavt = new VFVideoEffectDeinterlaceCAVT(cbDeinterlaceCAVT.IsChecked == true, 20); VideoCapture1.Video_Effects_Add(cavt); } else { cavt = effect as IVFVideoEffectDeinterlaceCAVT; if (cavt != null) { cavt.Enabled = cbDeinterlaceCAVT.IsChecked == true; } } }
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, 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 { 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.VideoCapture; 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.VideoCapture; 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.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\\"; 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(); }