Beispiel #1
0
        private async void BtStart_Click(object sender, EventArgs e)
        {
            VideoEdit1.Debug_Mode      = cbDebugMode.Checked;
            VideoEdit1.Debug_Telemetry = cbTelemetry.Checked;

            mmLog.Clear();

            VideoEdit1.Mode = VideoEditMode.Convert;

            VideoEdit1.Video_Effects_Clear();
            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, CultureInfo.InvariantCulture);

            VideoEdit1.Output_Filename = edOutput.Text;

            switch (cbOutputVideoFormat.SelectedIndex)
            {
            case 0:
            {
                var aviOutput = new AVIOutput();
                SetAVIOutput(ref aviOutput);
                VideoEdit1.Output_Format = aviOutput;
                break;
            }

            case 1:
            {
                var mkvOutput = new MKVv1Output();
                SetMKVOutput(ref mkvOutput);
                VideoEdit1.Output_Format = mkvOutput;
                break;
            }

            case 2:
            {
                var wmvOutput = new WMVOutput();
                SetWMVOutput(ref wmvOutput);
                VideoEdit1.Output_Format = wmvOutput;
                break;
            }

            case 3:
            {
                var dvOutput = new DVOutput();
                SetDVOutput(ref dvOutput);
                VideoEdit1.Output_Format = dvOutput;
                break;
            }

            case 4:
            {
                var acmOutput = new ACMOutput();
                SetACMOutput(ref acmOutput);
                VideoEdit1.Output_Format = acmOutput;
                break;
            }

            case 5:
            {
                var mp3Output = new MP3Output();
                SetMP3Output(ref mp3Output);
                VideoEdit1.Output_Format = mp3Output;
                break;
            }

            case 6:
            {
                var m4aOutput = new M4AOutput();
                SetM4AOutput(ref m4aOutput);
                VideoEdit1.Output_Format = m4aOutput;
                break;
            }

            case 7:
            {
                var wmaOutput = new WMAOutput();
                SetWMAOutput(ref wmaOutput);
                VideoEdit1.Output_Format = wmaOutput;
                break;
            }

            case 8:
            {
                var oggVorbisOutput = new OGGVorbisOutput();
                SetOGGOutput(ref oggVorbisOutput);
                VideoEdit1.Output_Format = oggVorbisOutput;
                break;
            }

            case 9:
            {
                var flacOutput = new FLACOutput();
                SetFLACOutput(ref flacOutput);
                VideoEdit1.Output_Format = flacOutput;
                break;
            }

            case 10:
            {
                var speexOutput = new SpeexOutput();
                SetSpeexOutput(ref speexOutput);
                VideoEdit1.Output_Format = speexOutput;
                break;
            }

            case 11:
            {
                var customOutput = new CustomOutput();
                SetCustomOutput(ref customOutput);
                VideoEdit1.Output_Format = customOutput;
                break;
            }

            case 12:
            {
                var webmOutput = new WebMOutput();
                SetWebMOutput(ref webmOutput);
                VideoEdit1.Output_Format = webmOutput;
                break;
            }

            case 13:
            {
                var ffmpegOutput = new FFMPEGOutput();
                SetFFMPEGOutput(ref ffmpegOutput);
                VideoEdit1.Output_Format = ffmpegOutput;
                break;
            }

            case 14:
            {
                var ffmpegOutput = new FFMPEGEXEOutput();
                SetFFMPEGEXEOutput(ref ffmpegOutput);
                VideoEdit1.Output_Format = ffmpegOutput;
                break;
            }

            case 15:
            {
                var mp4Output = new MP4Output();
                SetMP4Output(ref mp4Output);
                VideoEdit1.Output_Format = mp4Output;
                break;
            }

            case 16:
            {
                var mp4Output = new MP4HWOutput();
                SetMP4HWOutput(ref mp4Output);
                VideoEdit1.Output_Format = mp4Output;
                break;
            }

            case 17:
            {
                var gifOutput = new AnimatedGIFOutput();
                SetGIFOutput(ref gifOutput);
                VideoEdit1.Output_Format = gifOutput;
                break;
            }

            case 18:
                MessageBox.Show("Please use Main Demo to create encrypted files.");
                return;
            }

            VideoEdit1.Audio_Preview_Enabled = true;

            await VideoEdit1.StartAsync();
        }
Beispiel #2
0
        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 (FilterHelpers.Filter_Supported_EVR())
            {
                VideoEdit1.Video_Renderer.VideoRenderer = VideoRendererMode.EVR;
            }
            else if (FilterHelpers.Filter_Supported_VMR9())
            {
                VideoEdit1.Video_Renderer.VideoRenderer = VideoRendererMode.VMR9;
            }
            else
            {
                VideoEdit1.Video_Renderer.VideoRenderer = VideoRendererMode.VideoRenderer;
            }

            if (rbPreview.Checked)
            {
                VideoEdit1.Mode = VideoEditMode.Preview;
            }
            else
            {
                VideoEdit1.Mode = VideoEditMode.Convert;

                VideoEdit1.Output_Filename = edOutput.Text;

                switch (cbOutputFormat.SelectedIndex)
                {
                case 0:
                {
                    var aviOutput = new AVIOutput();
                    SetAVIOutput(ref aviOutput);
                    VideoEdit1.Output_Format = aviOutput;

                    break;
                }

                case 1:
                {
                    var mkvOutput = new MKVv1Output();
                    SetMKVOutput(ref mkvOutput);
                    VideoEdit1.Output_Format = mkvOutput;

                    break;
                }

                case 2:
                {
                    var wmvOutput = new WMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoEdit1.Output_Format = wmvOutput;

                    break;
                }

                case 3:
                {
                    var dvOutput = new DVOutput();
                    SetDVOutput(ref dvOutput);
                    VideoEdit1.Output_Format = dvOutput;

                    break;
                }

                case 4:
                {
                    var webmOutput = new WebMOutput();
                    SetWebMOutput(ref webmOutput);
                    VideoEdit1.Output_Format = webmOutput;

                    break;
                }

                case 5:
                {
                    var ffmpegOutput = new FFMPEGOutput();
                    SetFFMPEGOutput(ref ffmpegOutput);
                    VideoEdit1.Output_Format = ffmpegOutput;

                    break;
                }

                case 6:
                {
                    var ffmpegOutput = new FFMPEGEXEOutput();
                    SetFFMPEGEXEOutput(ref ffmpegOutput);
                    VideoEdit1.Output_Format = ffmpegOutput;

                    break;
                }

                case 7:
                {
                    var mp4Output = new MP4Output();
                    SetMP4Output(ref mp4Output);
                    VideoEdit1.Output_Format = mp4Output;

                    break;
                }

                case 8:
                {
                    var mp4Output = new MP4HWOutput();
                    SetMP4HWOutput(ref mp4Output);
                    VideoEdit1.Output_Format = mp4Output;

                    break;
                }

                case 9:
                {
                    var gifOutput = new AnimatedGIFOutput();
                    SetGIFOutput(ref gifOutput);

                    VideoEdit1.Output_Format = gifOutput;

                    break;
                }

                case 10:
                {
                    var encOutput = new MP4Output();
                    SetMP4Output(ref encOutput);
                    encOutput.Encryption        = true;
                    encOutput.Encryption_Format = EncryptionFormat.MP4_H264_SW_AAC;

                    VideoEdit1.Output_Format = encOutput;

                    break;
                }
                }
            }

            VideoEdit1.Video_Effects_Enabled = true;
            VideoEdit1.Video_Effects_Clear();
            lbLogos.Items.Clear();
            ConfigureVideoEffects();

            await VideoEdit1.StartAsync();
        }
Beispiel #3
0
        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 (FilterHelpers.Filter_Supported_EVR())
            {
                VideoEdit1.Video_Renderer.VideoRenderer = VideoRendererMode.EVR;
            }
            else if (FilterHelpers.Filter_Supported_VMR9())
            {
                VideoEdit1.Video_Renderer.VideoRenderer = VideoRendererMode.VMR9;
            }
            else
            {
                VideoEdit1.Video_Renderer.VideoRenderer = VideoRendererMode.VideoRenderer;
            }

            if (!rbConvert.Checked)
            {
                VideoEdit1.Mode = VideoEditMode.Preview;
            }
            else
            {
                VideoEdit1.Mode            = VideoEditMode.Convert;
                VideoEdit1.Output_Filename = edOutput.Text;

                switch (cbOutputFormat.SelectedIndex)
                {
                case 0:
                {
                    var aviOutput = new AVIOutput();
                    SetAVIOutput(ref aviOutput);
                    VideoEdit1.Output_Format = aviOutput;

                    break;
                }

                case 1:
                {
                    var mkvOutput = new MKVv1Output();
                    SetMKVOutput(ref mkvOutput);
                    VideoEdit1.Output_Format = mkvOutput;

                    break;
                }

                case 2:
                {
                    var wmvOutput = new WMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoEdit1.Output_Format = wmvOutput;

                    break;
                }

                case 3:
                {
                    var dvOutput = new DVOutput();
                    SetDVOutput(ref dvOutput);
                    VideoEdit1.Output_Format = dvOutput;

                    break;
                }

                case 4:
                {
                    var webmOutput = new WebMOutput();
                    SetWebMOutput(ref webmOutput);
                    VideoEdit1.Output_Format = webmOutput;

                    break;
                }

                case 5:
                {
                    var ffmpegOutput = new FFMPEGOutput();
                    SetFFMPEGOutput(ref ffmpegOutput);
                    VideoEdit1.Output_Format = ffmpegOutput;

                    break;
                }

                case 6:
                {
                    var ffmpegOutput = new FFMPEGEXEOutput();
                    SetFFMPEGEXEOutput(ref ffmpegOutput);
                    VideoEdit1.Output_Format = ffmpegOutput;

                    break;
                }

                case 7:
                {
                    var mp4Output = new MP4Output();
                    SetMP4Output(ref mp4Output);
                    VideoEdit1.Output_Format = mp4Output;

                    break;
                }

                case 8:
                {
                    var mp4Output = new MP4HWOutput();
                    SetMP4HWOutput(ref mp4Output);
                    VideoEdit1.Output_Format = mp4Output;

                    break;
                }

                case 9:
                {
                    var gifOutput = new AnimatedGIFOutput();
                    SetGIFOutput(ref gifOutput);

                    VideoEdit1.Output_Format = gifOutput;

                    break;
                }

                case 10:
                {
                    var encOutput = new MP4Output();
                    SetMP4Output(ref encOutput);
                    encOutput.Encryption        = true;
                    encOutput.Encryption_Format = EncryptionFormat.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();
        }