private void btStart_Click(object sender, EventArgs e) { mmLog.Clear(); VideoEdit1.Debug_Mode = cbDebugMode.Checked; VideoEdit1.Video_Resize = cbResize.Checked; if (VideoEdit1.Video_Resize) { VideoEdit1.Video_Resize_Width = Convert.ToInt32(edWidth.Text); VideoEdit1.Video_Resize_Height = Convert.ToInt32(edHeight.Text); } VideoEdit1.Video_FrameRate = Convert.ToDouble(cbFrameRate.Text); // apply capture parameters if (VideoEdit.Filter_Supported_EVR()) { VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR; } else if (VideoEdit.Filter_Supported_VMR9()) { VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9; } else { VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer; } if (!rbConvert.Checked) { VideoEdit1.Mode = VFVideoEditMode.Preview; } else { VideoEdit1.Mode = VFVideoEditMode.Convert; VideoEdit1.Output_Filename = edOutput.Text; switch (cbOutputFormat.SelectedIndex) { case 0: { var aviOutput = new VFAVIOutput(); SetAVIOutput(ref aviOutput); VideoEdit1.Output_Format = aviOutput; break; } case 1: { var mkvOutput = new VFMKVv1Output(); SetMKVOutput(ref mkvOutput); VideoEdit1.Output_Format = mkvOutput; break; } case 2: { var wmvOutput = new VFWMVOutput(); SetWMVOutput(ref wmvOutput); VideoEdit1.Output_Format = wmvOutput; break; } case 3: { var dvOutput = new VFDVOutput(); SetDVOutput(ref dvOutput); VideoEdit1.Output_Format = dvOutput; break; } case 4: { var webmOutput = new VFWebMOutput(); SetWebMOutput(ref webmOutput); VideoEdit1.Output_Format = webmOutput; break; } case 5: { var ffmpegDLLOutput = new VFFFMPEGDLLOutput(); SetFFMPEGDLLOutput(ref ffmpegDLLOutput); VideoEdit1.Output_Format = ffmpegDLLOutput; break; } case 6: { var ffmpegOutput = new VFFFMPEGEXEOutput(); SetFFMPEGEXEOutput(ref ffmpegOutput); VideoEdit1.Output_Format = ffmpegOutput; break; } case 7: { var mp4Output = new VFMP4v8v10Output(); SetMP4v10Output(ref mp4Output); VideoEdit1.Output_Format = mp4Output; break; } case 8: { var mp4Output = new VFMP4v11Output(); SetMP4v11Output(ref mp4Output); VideoEdit1.Output_Format = mp4Output; break; } case 9: { var gifOutput = new VFAnimatedGIFOutput(); SetGIFOutput(ref gifOutput); VideoEdit1.Output_Format = gifOutput; break; } case 10: { var encOutput = new VFMP4v8v10Output(); SetMP4v10Output(ref encOutput); encOutput.Encryption = true; encOutput.Encryption_Format = VFEncryptionFormat.MP4_H264_SW_AAC; VideoEdit1.Output_Format = encOutput; break; } } } VideoEdit1.Video_Effects_Enabled = true; VideoEdit1.Video_Effects_Clear(); lbLogos.Items.Clear(); ConfigureVideoEffects(); VideoEdit1.Input_Clear_List(); VideoEdit1.Input_AddVideoBlank(10000, 0, 640, 480, Color.Black); VideoEdit1.Start(); }
private async void btStart_Click(object sender, EventArgs e) { mmLog.Clear(); VideoEdit1.Debug_Mode = cbDebugMode.Checked; VideoEdit1.Video_Resize = cbResize.Checked; if (VideoEdit1.Video_Resize) { VideoEdit1.Video_Resize_Width = Convert.ToInt32(edWidth.Text); VideoEdit1.Video_Resize_Height = Convert.ToInt32(edHeight.Text); } VideoEdit1.Video_FrameRate = Convert.ToDouble(cbFrameRate.Text); // apply capture parameters if (VideoEdit.Filter_Supported_EVR()) { VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR; } else if (VideoEdit.Filter_Supported_VMR9()) { VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9; } else { VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer; } if (!rbConvert.Checked) { VideoEdit1.Mode = VFVideoEditMode.Preview; } else { VideoEdit1.Mode = VFVideoEditMode.Convert; VideoEdit1.Output_Filename = edOutput.Text; switch (cbOutputFormat.SelectedIndex) { case 0: { var aviOutput = new VFAVIOutput(); SetAVIOutput(ref aviOutput); VideoEdit1.Output_Format = aviOutput; break; } case 1: { var mkvOutput = new VFMKVv1Output(); SetMKVOutput(ref mkvOutput); VideoEdit1.Output_Format = mkvOutput; break; } case 2: { var wmvOutput = new VFWMVOutput(); SetWMVOutput(ref wmvOutput); VideoEdit1.Output_Format = wmvOutput; break; } case 3: { var dvOutput = new VFDVOutput(); SetDVOutput(ref dvOutput); VideoEdit1.Output_Format = dvOutput; break; } case 4: { var webmOutput = new VFWebMOutput(); SetWebMOutput(ref webmOutput); VideoEdit1.Output_Format = webmOutput; break; } case 5: { var ffmpegDLLOutput = new VFFFMPEGDLLOutput(); SetFFMPEGDLLOutput(ref ffmpegDLLOutput); VideoEdit1.Output_Format = ffmpegDLLOutput; break; } case 6: { var ffmpegOutput = new VFFFMPEGEXEOutput(); SetFFMPEGEXEOutput(ref ffmpegOutput); VideoEdit1.Output_Format = ffmpegOutput; break; } case 7: { var mp4Output = new VFMP4v8v10Output(); SetMP4v10Output(ref mp4Output); VideoEdit1.Output_Format = mp4Output; break; } case 8: { var mp4Output = new VFMP4v11Output(); SetMP4v11Output(ref mp4Output); VideoEdit1.Output_Format = mp4Output; break; } case 9: { var gifOutput = new VFAnimatedGIFOutput(); SetGIFOutput(ref gifOutput); VideoEdit1.Output_Format = gifOutput; break; } case 10: { var encOutput = new VFMP4v8v10Output(); SetMP4v10Output(ref encOutput); encOutput.Encryption = true; encOutput.Encryption_Format = VFEncryptionFormat.MP4_H264_SW_AAC; VideoEdit1.Output_Format = encOutput; break; } } } VideoEdit1.Video_Effects_Enabled = true; VideoEdit1.Video_Effects_Clear(); lbLogos.Items.Clear(); ConfigureVideoEffects(); VideoEdit1.Input_Clear_List(); if (rbImagesPredefined.Checked) { predefinedImagesUsed = true; await VideoEdit1.Input_AddVideoBlankAsync( TimeSpan.FromMilliseconds(10000), TimeSpan.FromMilliseconds(0), 1280, 720, Color.Black); } else { predefinedImagesUsed = false; if (!Directory.Exists(edImagesFolder.Text)) { MessageBox.Show(this, "Folder with images doesn't exists!"); return; } loadedFiles = EnumerateImageFiles(edImagesFolder.Text); int width = Convert.ToInt32(edWidth.Text); int height = Convert.ToInt32(edHeight.Text); loadedImageFilename = null; if (loadedImage != null) { loadedImage.Dispose(); loadedImage = null; } await VideoEdit1.Input_AddVideoBlankAsync( TimeSpan.FromSeconds(loadedFiles.Length * 2), TimeSpan.FromMilliseconds(0), width, height, Color.Black); } await VideoEdit1.StartAsync(); }
private void btStart_Click(object sender, EventArgs e) { mmLog.Clear(); VideoEdit1.Debug_Mode = cbDebugMode.Checked; VideoEdit1.Video_Effects_Clear(); if (rbConvert.Checked) { VideoEdit1.Mode = VFVideoEditMode.Convert; } else { VideoEdit1.Mode = VFVideoEditMode.Preview; } VideoEdit1.Video_Resize = cbResize.Checked; if (VideoEdit1.Video_Resize) { VideoEdit1.Video_Resize_Width = Convert.ToInt32(edWidth.Text); VideoEdit1.Video_Resize_Height = Convert.ToInt32(edHeight.Text); } VideoEdit1.Video_FrameRate = Convert.ToDouble(cbFrameRate.Text); // apply capture parameters if (VideoEdit.Filter_Supported_EVR()) { VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR; } else if (VideoEdit.Filter_Supported_VMR9()) { VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9; } else { VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer; } VideoEdit1.Output_Filename = edOutput.Text; if (rbAVI.Checked) { var aviOutput = new VFAVIOutput(); aviOutput.ACM.Name = cbAudioCodec.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 = cbVideoCodec.Text; aviOutput.Audio_UseMP3Encoder = false; VideoEdit1.Output_Format = aviOutput; } else { var wmvOutput = new VFWMVOutput(); wmvOutput.Mode = VFWMVMode.InternalProfile; if (cbWMVInternalProfile9.SelectedIndex != -1) { wmvOutput.Internal_Profile_Name = cbWMVInternalProfile9.Text; } VideoEdit1.Output_Format = wmvOutput; } VideoEdit1.Video_Effects_Enabled = true; VideoEdit1.Video_Effects_Clear(); if (this.cbImageLogo.Checked) { cbImageLogo_CheckedChanged(null, null); } if (cbTextLogo.Checked) { cbTextLogo_CheckedChanged(null, null); } VideoEdit1.Input_Clear_List(); VideoEdit1.Input_AddVideoBlank(10000, 0, 640, 480, Color.Black); VideoEdit1.Start(); }