Exemplo n.º 1
0
        private void SetWebMOutput(ref WebMOutput webmOutput)
        {
            if (webmSettingsDialog == null)
            {
                webmSettingsDialog = new WebMSettingsDialog();
            }

            webmSettingsDialog.SaveSettings(ref webmOutput);
        }
Exemplo n.º 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();
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
0
        private async void btStart_Click(object sender, EventArgs e)
        {
            mmLog.Clear();

            VideoCapture1.Debug_Mode = cbDebugMode.Checked;
            VideoCapture1.Debug_Dir  = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "VisioForge");

            if (rbVideoCaptureDevice.Checked)
            {
                VideoCapture1.Mode = VideoCaptureMode.VideoPreview;

                VideoCapture1.Audio_CaptureDevice                = new AudioCaptureSource(cbAudioInputDevice.Text);
                VideoCapture1.Audio_CaptureDevice.Format         = cbAudioInputFormat.Text;
                VideoCapture1.Audio_CaptureDevice.Line           = cbAudioInputLine.Text;
                VideoCapture1.Audio_CaptureDevice.Format_UseBest = cbUseBestAudioInputFormat.Checked;

                VideoCapture1.Video_CaptureDevice = new VideoCaptureSource(cbVideoInputDevice.Text);
                VideoCapture1.Video_CaptureDevice.Format_UseBest = cbUseBestVideoInputFormat.Checked;
                VideoCapture1.Video_CaptureDevice.Format         = cbVideoInputFormat.Text;

                if (cbVideoInputFrameRate.SelectedIndex != -1)
                {
                    VideoCapture1.Video_CaptureDevice.FrameRate = Convert.ToDouble(cbVideoInputFrameRate.Text, CultureInfo.CurrentCulture);
                }
            }
            else
            {
                VideoCapture1.Mode             = VideoCaptureMode.IPPreview;
                VideoCapture1.IP_Camera_Source = new IPCameraSourceSettings
                {
                    URL = new Uri(cbIPURL.Text)
                };

                switch (cbIPCameraType.SelectedIndex)
                {
                case 0:
                    VideoCapture1.IP_Camera_Source.Type = IPSourceEngine.Auto_VLC;
                    break;

                case 1:
                    VideoCapture1.IP_Camera_Source.Type = IPSourceEngine.Auto_FFMPEG;
                    break;

                case 2:
                    VideoCapture1.IP_Camera_Source.Type = IPSourceEngine.Auto_LAV;
                    break;

                case 3:
                    VideoCapture1.IP_Camera_Source.Type = IPSourceEngine.MMS_WMV;
                    break;

                case 4:
                {
                    // audio not supported
                    VideoCapture1.IP_Camera_Source.Type = IPSourceEngine.HTTP_MJPEG_LowLatency;
                    VideoCapture1.Audio_RecordAudio     = false;
                    VideoCapture1.Audio_PlayAudio       = false;
                    cbIPAudioCapture.Checked            = false;
                }
                break;

                case 5:
                    VideoCapture1.IP_Camera_Source.Type = IPSourceEngine.RTSP_LowLatency;
                    VideoCapture1.IP_Camera_Source.RTSP_LowLatency_UseUDP = false;
                    break;

                case 6:
                    VideoCapture1.IP_Camera_Source.Type = IPSourceEngine.RTSP_LowLatency;
                    VideoCapture1.IP_Camera_Source.RTSP_LowLatency_UseUDP = true;
                    break;

                case 7:
                    VideoCapture1.IP_Camera_Source.Type = IPSourceEngine.NDI;
                    break;

                case 8:
                    VideoCapture1.IP_Camera_Source.Type = IPSourceEngine.NDI_Legacy;
                    break;
                }

                VideoCapture1.IP_Camera_Source.AudioCapture = cbIPAudioCapture.Checked;
                VideoCapture1.IP_Camera_Source.Login        = edIPLogin.Text;
                VideoCapture1.IP_Camera_Source.Password     = edIPPassword.Text;
            }

            VideoCapture1.Audio_RecordAudio = true;
            VideoCapture1.Audio_PlayAudio   = false;

            VideoCapture1.Timeshift_Settings = new TimeshiftSettings
            {
                Player_Screen = VideoViewPlayer,
                TempFolder    = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "VisioForge", "SBE"),
                Player_AudioOutput_Enabled = cbPlayerPlayAudio.Checked
            };

            var mp4Settings = new MP4Output
            {
                Video =
                {
                    IDR_Period = 5
                }
            };

            VideoCapture1.Timeshift_Settings.EncodingSettings = mp4Settings;

            switch (cbOutputFormat.SelectedIndex)
            {
            case 0:
                break;

            case 1:
            {
                VideoCapture1.Mode = rbVideoCaptureDevice.Checked
                            ? VideoCaptureMode.VideoCapture
                            : VideoCaptureMode.IPCapture;

                VideoCapture1.Output_Filename = edOutput.Text;

                var output = new AVIOutput();
                VideoCapture1.Output_Format = output;
            }

            break;

            case 2:
            {
                VideoCapture1.Mode = rbVideoCaptureDevice.Checked
                            ? VideoCaptureMode.VideoCapture
                            : VideoCaptureMode.IPCapture;

                VideoCapture1.Output_Filename = edOutput.Text;
                var output = new MP4Output();
                VideoCapture1.Output_Format = output;
            }

            break;

            case 3:
            {
                VideoCapture1.Mode = rbVideoCaptureDevice.Checked
                            ? VideoCaptureMode.VideoCapture
                            : VideoCaptureMode.IPCapture;

                VideoCapture1.Output_Filename = edOutput.Text;
                var output = new WebMOutput();
                VideoCapture1.Output_Format = output;
            }

            break;
            }

            VideoCapture1.Video_Effects_Clear();
            VideoCapture1.Video_Effects_Enabled = true;
            VideoCapture1.Video_Effects_Add(new VideoEffectTextLogo(true)
            {
                Mode = TextLogoMode.Timestamp, Text = string.Empty, Left = 150, Top = 10
            });

            await VideoCapture1.StartAsync();

            timer1.Interval = 1000;
            timer1.Enabled  = true;
        }
Exemplo n.º 5
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();
        }