Ejemplo n.º 1
0
        /// <summary>
        /// Inits video capture.
        /// </summary>
        protected void CaptureStart()
        {
            // Uncomment to start debugger
            // System.Diagnostics.Debugger.Launch();

            // configure cam
            VideoCapture1.Mode = VideoCaptureMode.IPCapture;

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

            VideoCapture1.IP_Camera_Source = new IPCameraSourceSettings();
            VideoCapture1.IP_Camera_Source.AudioCapture = false;
            VideoCapture1.IP_Camera_Source.Type         = IPSourceEngine.Auto_LAV;
            VideoCapture1.IP_Camera_Source.URL          = new Uri("http://212.162.177.75/mjpg/video.mjpg");

            VideoCapture1.Output_Filename = @"c:\vf\service_output.mp4";

            var mp4Output = new MP4Output();

            mp4Output.MP4Mode           = MP4Mode.CPU_QSV;
            VideoCapture1.Output_Format = mp4Output;

            VideoCapture1.Video_Renderer.VideoRenderer = VideoRendererMode.None;

            VideoCapture1.OnError -= VideoCapture1_OnError;
            VideoCapture1.OnError += VideoCapture1_OnError;

            VideoCapture1.Start();
        }
Ejemplo n.º 2
0
        private void SetMP4Output(ref MP4Output mp4Output)
        {
            if (this.mp4SettingsDialog == null)
            {
                this.mp4SettingsDialog = new MP4SettingsDialog();
            }

            this.mp4SettingsDialog.SaveSettings(ref mp4Output);
        }
Ejemplo n.º 3
0
        private async void btStart_Click(object sender, EventArgs e)
        {
            VideoCapture1.Debug_Mode = cbDebugMode.Checked;
            VideoCapture1.Debug_Dir  = Path.Combine(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
            {
                VideoWidth     = bmp.Width,
                VideoHeight    = bmp.Height,
                VideoFrameRate = 25.0f
            };
            bmp.Dispose();

            if (rbPreview.Checked)
            {
                VideoCapture1.Mode = VideoCaptureMode.PushSourcePreview;
            }
            else if (rbCapture.Checked)
            {
                VideoCapture1.Mode = VideoCaptureMode.PushSourceCapture;

                VideoCapture1.Output_Filename = edOutput.Text;

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

                    break;
                }

                case 1:
                {
                    var wmvOutput = new WMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 2:
                {
                    var mp4Output = new MP4Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 3:
                {
                    var mp4Output = new MP4HWOutput();
                    SetMP4HWOutput(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

                case 5:
                {
                    var tsOutput = new MPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 6:
                {
                    var movOutput = new MOVOutput();
                    SetMOVOutput(ref movOutput);
                    VideoCapture1.Output_Format = movOutput;

                    break;
                }
                }
            }

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 2;
            tmRecording.Start();

            await PushImagesAsync();
        }
        private async void btStart_Click(object sender, RoutedEventArgs e)
        {
            Logs.Clear();

            VideoCapture1.Video_Sample_Grabber_Enabled = true;

            VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true;
            VideoCapture1.Debug_Dir  = Path.Combine(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;
            }

            VideoCapture1.Video_Renderer_SetAuto();

            VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.SelectedItem.ToString();

            // apply capture params
            VideoCapture1.Video_CaptureDevice                = new VideoCaptureSource(cbVideoInputDevice.SelectedItem.ToString());
            VideoCapture1.Video_CaptureDevice.Format         = cbVideoInputFormat.SelectedItem.ToString();
            VideoCapture1.Video_CaptureDevice.Format_UseBest = cbUseBestVideoInputFormat.IsChecked == true;

            VideoCapture1.Audio_CaptureDevice                = new AudioCaptureSource(cbAudioInputDevice.SelectedItem.ToString());
            VideoCapture1.Audio_CaptureDevice.Format         = cbAudioInputFormat.SelectedItem?.ToString();
            VideoCapture1.Audio_CaptureDevice.Format_UseBest = cbUseBestAudioInputFormat.IsChecked == true;

            if (cbVideoInputFrameRate.SelectedIndex != -1)
            {
                VideoCapture1.Video_CaptureDevice.FrameRate = (float)Convert.ToDouble(cbVideoInputFrameRate.SelectedItem.ToString());
            }

            if (rbPreview.IsChecked == true)
            {
                VideoCapture1.Mode = VideoCaptureMode.VideoPreview;
            }
            else
            {
                VideoCapture1.Mode = VideoCaptureMode.VideoCapture;

                VideoCapture1.Output_Filename = edOutput.Text;

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

                    break;
                }

                case 1:
                {
                    var wmvOutput = new WMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 2:
                {
                    var mp4Output = new MP4Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 3:
                {
                    var mp4Output = new MP4HWOutput();
                    SetMP4HWOutput(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

                case 5:
                {
                    var tsOutput = new MPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 6:
                {
                    var movOutput = new MOVOutput();
                    SetMOVOutput(ref movOutput);
                    VideoCapture1.Output_Format = movOutput;

                    break;
                }
                }
            }

            VideoCapture1.Video_Effects_Enabled         = true;
            VideoCapture1.Video_Effects_MergeImageLogos = cbMergeImageLogos.IsChecked == true;
            VideoCapture1.Video_Effects_MergeTextLogos  = cbMergeTextLogos.IsChecked == true;
            VideoCapture1.Video_Effects_Clear();
            Logos.Clear();
            ConfigureVideoEffects();

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 3;
            tmRecording.Start();
        }
Ejemplo 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 (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();
        }
Ejemplo n.º 6
0
        private async 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  = Path.Combine(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            = VideoCaptureMode.ScreenCapture;
            VideoCapture1.Output_Filename = edOutput.Text;

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

                break;
            }

            case 1:
            {
                var wmvOutput = new WMVOutput();
                SetWMVOutput(ref wmvOutput);
                VideoCapture1.Output_Format = wmvOutput;

                break;
            }

            case 2:
            {
                var mp4Output = new MP4Output();
                SetMP4Output(ref mp4Output);
                VideoCapture1.Output_Format = mp4Output;

                break;
            }

            case 3:
            {
                var mp4Output = new MP4HWOutput();
                SetMP4HWOutput(ref mp4Output);
                VideoCapture1.Output_Format = mp4Output;

                break;
            }

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

                VideoCapture1.Output_Format = gifOutput;

                break;
            }

            case 5:
            {
                var tsOutput = new MPEGTSOutput();
                SetMPEGTSOutput(ref tsOutput);
                VideoCapture1.Output_Format = tsOutput;

                break;
            }

            case 6:
            {
                var movOutput = new MOVOutput();
                SetMOVOutput(ref movOutput);
                VideoCapture1.Output_Format = movOutput;

                break;
            }
            }

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 2;
        }
Ejemplo n.º 7
0
        private async void btStart_Click(object sender, EventArgs e)
        {
            if (onvifControl != null)
            {
                onvifControl.Disconnect();
                onvifControl.Dispose();
                onvifControl = null;

                btONVIFConnect.Text = "Connect";
            }

            mmLog.Clear();

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

            VideoCapture1.Audio_RecordAudio = cbIPAudioCapture.Checked;
            VideoCapture1.Audio_PlayAudio   = cbIPAudioCapture.Checked;

            VideoCapture1.Video_Renderer_SetAuto();

            VideoCapture1.Video_Sample_Grabber_Enabled = true;

            // source
            VideoCapture1.IP_Camera_Source = new IPCameraSourceSettings
            {
                URL = new Uri(cbIPURL.Text, UriKind.Absolute)
            };

            bool lavGPU = false;

            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.Auto_LAV;
                lavGPU = true;
                break;

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

            case 5:
            {
                // 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 6:
                VideoCapture1.IP_Camera_Source.Type = IPSourceEngine.RTSP_LowLatency;
                VideoCapture1.IP_Camera_Source.RTSP_LowLatency_UseUDP = false;
                break;

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

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

            case 9:
                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.IP_Camera_Source.VLC_ZeroClockJitterEnabled = cbVLCZeroClockJitter.Checked;
            VideoCapture1.IP_Camera_Source.VLC_CustomLatency          = Convert.ToInt32(edVLCCacheSize.Text);
            VideoCapture1.IP_Camera_Source.ForcedFramerate            = Convert.ToInt32(edIPForcedFramerate.Text);
            VideoCapture1.IP_Camera_Source.ForcedFramerate_InstanceID = edIPForcedFramerateID.Text[0];

            if (VideoCapture1.IP_Camera_Source.Type == IPSourceEngine.Auto_LAV)
            {
                VideoCapture1.IP_Camera_Source.LAV_GPU_Use  = lavGPU;
                VideoCapture1.IP_Camera_Source.LAV_GPU_Mode = LAVGPUDecoder.DXVA2CopyBack;
            }

            if (cbIPCameraONVIF.Checked)
            {
                VideoCapture1.IP_Camera_Source.ONVIF_Source = true;

                if (cbONVIFProfile.SelectedIndex != -1)
                {
                    VideoCapture1.IP_Camera_Source.ONVIF_SourceProfile = cbONVIFProfile.Text;
                }
            }

            if (cbIPDisconnect.Checked)
            {
                VideoCapture1.IP_Camera_Source.DisconnectEventInterval = TimeSpan.FromSeconds(10);
            }

            if (rbPreview.Checked)
            {
                VideoCapture1.Mode = VideoCaptureMode.IPPreview;
            }
            else if (rbCapture.Checked)
            {
                VideoCapture1.Mode            = VideoCaptureMode.IPCapture;
                VideoCapture1.Output_Filename = edOutput.Text;

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

                    break;
                }

                case 1:
                {
                    var wmvOutput = new WMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 2:
                {
                    var mp4Output = new MP4Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 3:
                {
                    var mp4Output = new MP4HWOutput();
                    SetMP4HWOutput(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

                case 5:
                {
                    var tsOutput = new MPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 6:
                {
                    var movOutput = new MOVOutput();
                    SetMOVOutput(ref movOutput);
                    VideoCapture1.Output_Format = movOutput;

                    break;
                }
                }
            }

            VideoCapture1.Video_Effects_Enabled = true;
            ConfigureVideoEffects();

            VideoView1.StatusOverlay = new TextStatusOverlay();

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 3;
            tmRecording.Start();
        }
Ejemplo n.º 8
0
        private async 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  = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "VisioForge");

            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_Renderer_SetAuto();

            VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text;

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

            if (cbVideoInputFrameRate.SelectedIndex != -1)
            {
                VideoCapture1.Video_CaptureDevice.FrameRate = (float)Convert.ToDouble(cbVideoInputFrameRate.Text);
            }

            if (rbPreview.Checked)
            {
                VideoCapture1.Mode = VideoCaptureMode.VideoPreview;
            }
            else
            {
                VideoCapture1.Mode            = VideoCaptureMode.VideoCapture;
                VideoCapture1.Output_Filename = edOutput.Text;

                switch (cbOutputFormat.SelectedIndex)
                {
                case 0:
                {
                    var dvOutput = new DVOutput();
                    SetDVOutput(ref dvOutput);
                    VideoCapture1.Output_Format = dvOutput;

                    break;
                }

                case 1:
                {
                    VideoCapture1.Output_Format = new DirectCaptureDVOutput();

                    break;
                }

                case 2:
                {
                    var aviOutput = new AVIOutput();
                    SetAVIOutput(ref aviOutput);
                    VideoCapture1.Output_Format = aviOutput;

                    break;
                }

                case 3:
                {
                    var wmvOutput = new WMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 4:
                {
                    var mp4Output = new MP4Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 5:
                {
                    var mp4Output = new MP4HWOutput();
                    SetMP4HWOutput(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

                case 7:
                {
                    var tsOutput = new MPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 8:
                {
                    var movOutput = new MOVOutput();
                    SetMOVOutput(ref movOutput);
                    VideoCapture1.Output_Format = movOutput;

                    break;
                }
                }
            }

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

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 3;
            tmRecording.Start();
        }
Ejemplo n.º 9
0
        private async void btStart_Click(object sender, EventArgs e)
        {
            mmLog.Clear();

            VideoCapture1.Video_Sample_Grabber_Enabled = true;

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

            VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text;

            if (cbRecordAudio.Checked)
            {
                VideoCapture1.Audio_RecordAudio = true;
                VideoCapture1.Audio_PlayAudio   = true;
            }
            else
            {
                VideoCapture1.Audio_RecordAudio = false;
                VideoCapture1.Audio_PlayAudio   = false;
            }

            // apply capture parameters
            VideoCapture1.Decklink_Source = new DecklinkSourceSettings
            {
                Name        = cbDecklinkCaptureDevice.Text,
                VideoFormat = cbDecklinkCaptureVideoFormat.Text
            };

            if (rbPreview.Checked)
            {
                VideoCapture1.Mode = VideoCaptureMode.DecklinkSourcePreview;
            }
            else
            {
                VideoCapture1.Mode            = VideoCaptureMode.DecklinkSourceCapture;
                VideoCapture1.Output_Filename = edOutput.Text;

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

                    break;
                }

                case 1:
                {
                    var wmvOutput = new WMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 2:
                {
                    var mp4Output = new MP4Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 3:
                {
                    var mp4Output = new MP4HWOutput();
                    SetMP4HWOutput(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

                case 5:
                {
                    var tsOutput = new MPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 6:
                {
                    var movOutput = new MOVOutput();
                    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, AudioEffectType.Amplify, AUDIO_EFFECT_ID_AMPLIFY, cbAudAmplifyEnabled.Checked, TimeSpan.Zero, TimeSpan.Zero);

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 4;
            tmRecording.Start();
        }
Ejemplo n.º 10
0
        private async 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  = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "VisioForge");

            VideoCapture1.Video_Sample_Grabber_Enabled = true;

            // 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 = PIPMode.Horizontal;
                        VideoCapture1.PIP_Sources_Add_ScreenSource(source, 0, 0, 0, 0);
                    }
                }
            }
            else
            {
                VideoCapture1.Screen_Capture_Source = CreateScreenCaptureSource(
                    Convert.ToInt32(cbScreenCaptureDisplayIndex.Text),
                    false);
            }

            // audio source
            if (cbRecordAudio.Checked)
            {
                VideoCapture1.Audio_RecordAudio = true;
                VideoCapture1.Audio_PlayAudio   = false;

                VideoCapture1.Audio_CaptureDevice        = new AudioCaptureSource(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 = VideoCaptureMode.ScreenPreview;
            }
            else
            {
                VideoCapture1.Mode            = VideoCaptureMode.ScreenCapture;
                VideoCapture1.Output_Filename = edOutput.Text;

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

                    break;
                }

                case 1:
                {
                    var wmvOutput = new WMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 2:
                {
                    var mp4Output = new MP4Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 3:
                {
                    var mp4Output = new MP4HWOutput();
                    SetMP4HWOutput(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

                case 5:
                {
                    var tsOutput = new MPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 6:
                {
                    var movOutput = new MOVOutput();
                    SetMOVOutput(ref movOutput);
                    VideoCapture1.Output_Format = movOutput;

                    break;
                }
                }
            }

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 3;
            tmRecording.Start();
        }
Ejemplo n.º 11
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;
        }
Ejemplo n.º 12
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();
        }
Ejemplo n.º 13
0
        private async 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  = Path.Combine(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;
            }

            VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text;

            // apply capture parameters
            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 = (float)Convert.ToDouble(cbVideoInputFrameRate.Text);
            }

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


            if (rbPreview.Checked)
            {
                VideoCapture1.Mode = VideoCaptureMode.VideoPreview;
            }
            else
            {
                VideoCapture1.Mode            = VideoCaptureMode.VideoCapture;
                VideoCapture1.Output_Filename = edOutput.Text;

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

                    break;
                }

                case 1:
                {
                    var wmvOutput = new WMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 2:
                {
                    var mp4Output = new MP4Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 3:
                {
                    var mp4Output = new MP4HWOutput();
                    SetMP4HWOutput(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

                case 5:
                {
                    var tsOutput = new MPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 6:
                {
                    var movOutput = new MOVOutput();
                    SetMOVOutput(ref movOutput);
                    VideoCapture1.Output_Format = movOutput;

                    break;
                }
                }
            }

            VideoCapture1.Video_Effects_Enabled         = true;
            VideoCapture1.Video_Effects_MergeImageLogos = cbMergeImageLogos.Checked;
            VideoCapture1.Video_Effects_MergeTextLogos  = cbMergeTextLogos.Checked;
            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, AudioEffectType.Amplify, AUDIO_EFFECT_ID_AMPLIFY, cbAudAmplifyEnabled.Checked, TimeSpan.Zero, TimeSpan.Zero);
            VideoCapture1.Audio_Effects_Add(-1, AudioEffectType.Equalizer, AUDIO_EFFECT_ID_EQ, cbAudEqualizerEnabled.Checked, TimeSpan.Zero, TimeSpan.Zero);
            VideoCapture1.Audio_Effects_Add(-1, AudioEffectType.TrueBass, AUDIO_EFFECT_ID_TRUE_BASS, cbAudTrueBassEnabled.Checked, TimeSpan.Zero, TimeSpan.Zero);

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 4;
            tmRecording.Start();
        }
Ejemplo n.º 14
0
        private async 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  = Path.Combine(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 = new VideoCaptureSource(cbVideoInputDevice.Text);
            VideoCapture1.Video_CaptureDevice.Format_UseBest = cbUseBestVideoInputFormat.Checked;
            VideoCapture1.Video_CaptureDevice.Format         = cbVideoInputFormat.Text;

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

            if (cbVideoInputFrameRate.SelectedIndex != -1)
            {
                VideoCapture1.Video_CaptureDevice.FrameRate = (float)Convert.ToDouble(cbVideoInputFrameRate.Text);
            }

            VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text;

            VideoCapture1.Mode            = VideoCaptureMode.VideoCapture;
            VideoCapture1.Output_Filename = edOutput.Text;

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

                break;
            }

            case 1:
            {
                var wmvOutput = new WMVOutput();
                SetWMVOutput(ref wmvOutput);
                VideoCapture1.Output_Format = wmvOutput;

                break;
            }

            case 2:
            {
                var mp4Output = new MP4Output();
                SetMP4Output(ref mp4Output);
                VideoCapture1.Output_Format = mp4Output;

                break;
            }

            case 3:
            {
                var mp4Output = new MP4HWOutput();
                SetMP4HWOutput(ref mp4Output);
                VideoCapture1.Output_Format = mp4Output;

                break;
            }

            case 4:
            {
                var tsOutput = new MPEGTSOutput();
                SetMPEGTSOutput(ref tsOutput);
                VideoCapture1.Output_Format = tsOutput;

                break;
            }

            case 5:
            {
                var movOutput = new MOVOutput();
                SetMOVOutput(ref movOutput);
                VideoCapture1.Output_Format = movOutput;

                break;
            }
            }

            // separate capture settings
            VideoCapture1.SeparateCapture_Enabled = true;
            if (rbSeparateCaptureStartManually.Checked)
            {
                VideoCapture1.SeparateCapture_Mode             = SeparateCaptureMode.Normal;
                VideoCapture1.SeparateCapture_AutostartCapture = false;
            }
            else if (rbSeparateCaptureSplitByDuration.Checked)
            {
                VideoCapture1.SeparateCapture_Mode             = SeparateCaptureMode.SplitByDuration;
                VideoCapture1.SeparateCapture_AutostartCapture = true;
                VideoCapture1.SeparateCapture_TimeThreshold    = TimeSpan.FromMilliseconds(Convert.ToInt32(edSeparateCaptureDuration.Text));
            }
            else if (rbSeparateCaptureSplitBySize.Checked)
            {
                VideoCapture1.SeparateCapture_Mode              = SeparateCaptureMode.SplitByFileSize;
                VideoCapture1.SeparateCapture_AutostartCapture  = true;
                VideoCapture1.SeparateCapture_FileSizeThreshold = Convert.ToInt32(edSeparateCaptureFileSize.Text) * 1024 * 1024;
            }

            //VideoCapture1.Video_Effects_Enabled = true;
            //VideoCapture1.Video_Effects_Clear();
            //var tsEffect = new VideoEffectTextLogo(true) { Mode = TextLogoMode.Timestamp };
            //VideoCapture1.Video_Effects_Add(tsEffect);

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 4;
            tmRecording.Start();
        }
Ejemplo n.º 15
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();
        }