Esempio n. 1
0
        private void SetMP4Output(ref VFMP4v8v10Output mp4Output)
        {
            if (mp4V10SettingsDialog == null)
            {
                mp4V10SettingsDialog = new MP4v10SettingsDialog();
            }

            mp4V10SettingsDialog.SaveSettings(ref mp4Output);
        }
Esempio n. 2
0
        private void btStart_Click(object sender, EventArgs e)
        {
            mmLog.Clear();

            VideoEdit1.Debug_Mode = cbDebugMode.Checked;

            VideoEdit1.Video_Resize = cbResize.Checked;

            if (VideoEdit1.Video_Resize)
            {
                VideoEdit1.Video_Resize_Width  = Convert.ToInt32(edWidth.Text);
                VideoEdit1.Video_Resize_Height = Convert.ToInt32(edHeight.Text);
            }

            VideoEdit1.Video_FrameRate = Convert.ToDouble(cbFrameRate.Text);

            // apply capture parameters
            if (VideoEdit.Filter_Supported_EVR())
            {
                VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR;
            }
            else if (VideoEdit.Filter_Supported_VMR9())
            {
                VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9;
            }
            else
            {
                VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer;
            }

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

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

                    break;
                }

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

                    break;
                }

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

                    break;
                }

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

                    break;
                }

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

                    break;
                }

                case 5:
                {
                    var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                    SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                    VideoEdit1.Output_Format = ffmpegDLLOutput;

                    break;
                }

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

                    break;
                }

                case 7:
                {
                    var mp4Output = new VFMP4v8v10Output();
                    SetMP4v10Output(ref mp4Output);
                    VideoEdit1.Output_Format = mp4Output;

                    break;
                }

                case 8:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoEdit1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoEdit1.Output_Format = gifOutput;

                    break;
                }

                case 10:
                {
                    var encOutput = new VFMP4v8v10Output();
                    SetMP4v10Output(ref encOutput);
                    encOutput.Encryption        = true;
                    encOutput.Encryption_Format = VFEncryptionFormat.MP4_H264_SW_AAC;

                    VideoEdit1.Output_Format = encOutput;

                    break;
                }
                }
            }

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

            VideoEdit1.Input_Clear_List();
            VideoEdit1.Input_AddVideoBlank(10000, 0, 640, 480, Color.Black);

            VideoEdit1.Start();
        }
Esempio n. 3
0
        private 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  = 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 = cbVideoInputDevice.Text;
            VideoCapture1.Video_CaptureDevice_IsAudioSource = cbUseAudioInputFromVideoCaptureDevice.Checked;
            VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text;
            VideoCapture1.Audio_CaptureDevice_Format_UseBest = cbUseBestAudioInputFormat.Checked;
            VideoCapture1.Video_CaptureDevice_Format_UseBest = cbUseBestVideoInputFormat.Checked;
            VideoCapture1.Video_CaptureDevice_Format         = cbVideoInputFormat.Text;
            VideoCapture1.Audio_CaptureDevice        = cbAudioInputDevice.Text;
            VideoCapture1.Audio_CaptureDevice_Format = cbAudioInputFormat.Text;

            if (cbFramerate.SelectedIndex != -1)
            {
                VideoCapture1.Video_CaptureDevice_FrameRate = (float)Convert.ToDouble(cbFramerate.Text);
            }

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

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

                    break;
                }

                case 1:
                {
                    var mkvOutput = new VFMKVv1Output();
                    SetMKVOutput(ref mkvOutput);
                    VideoCapture1.Output_Format = mkvOutput;

                    break;
                }

                case 2:
                {
                    var wmvOutput = new VFWMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 3:
                {
                    var dvOutput = new VFDVOutput();
                    SetDVOutput(ref dvOutput);
                    VideoCapture1.Output_Format = dvOutput;

                    break;
                }

                case 4:
                {
                    var webmOutput = new VFWebMOutput();
                    SetWebMOutput(ref webmOutput);
                    VideoCapture1.Output_Format = webmOutput;

                    break;
                }

                case 5:
                {
                    var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                    SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                    VideoCapture1.Output_Format = ffmpegDLLOutput;

                    break;
                }

                case 6:
                {
                    var ffmpegOutput = new VFFFMPEGEXEOutput();
                    SetFFMPEGEXEOutput(ref ffmpegOutput);
                    VideoCapture1.Output_Format = ffmpegOutput;

                    break;
                }

                case 7:
                {
                    var mp4Output = new VFMP4v8v10Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 8:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

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

                    VideoCapture1.Output_Format = encOutput;

                    break;
                }

                case 11:
                {
                    var tsOutput = new VFMPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 12:
                {
                    var movOutput = new VFMOVOutput();
                    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, VFAudioEffectType.Amplify, cbAudAmplifyEnabled.Checked, -1, -1);
            VideoCapture1.Audio_Effects_Add(-1, VFAudioEffectType.Equalizer, cbAudEqualizerEnabled.Checked, -1, -1);
            VideoCapture1.Audio_Effects_Add(-1, VFAudioEffectType.TrueBass, cbAudTrueBassEnabled.Checked, -1, -1);

            VideoCapture1.Start();

            tcMain.SelectedIndex = 4;
            tmRecording.Start();
        }
        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  = 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            = VFVideoCaptureMode.ScreenCapture;
            VideoCapture1.Output_Filename = edOutput.Text;

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

                break;
            }

            case 1:
            {
                var mkvOutput = new VFMKVv1Output();
                SetMKVOutput(ref mkvOutput);
                VideoCapture1.Output_Format = mkvOutput;

                break;
            }

            case 2:
            {
                var wmvOutput = new VFWMVOutput();
                SetWMVOutput(ref wmvOutput);
                VideoCapture1.Output_Format = wmvOutput;

                break;
            }

            case 3:
            {
                var dvOutput = new VFDVOutput();
                SetDVOutput(ref dvOutput);
                VideoCapture1.Output_Format = dvOutput;

                break;
            }

            case 4:
            {
                var webmOutput = new VFWebMOutput();
                SetWebMOutput(ref webmOutput);
                VideoCapture1.Output_Format = webmOutput;

                break;
            }

            case 5:
            {
                var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                VideoCapture1.Output_Format = ffmpegDLLOutput;

                break;
            }

            case 6:
            {
                var ffmpegOutput = new VFFFMPEGEXEOutput();
                SetFFMPEGEXEOutput(ref ffmpegOutput);
                VideoCapture1.Output_Format = ffmpegOutput;

                break;
            }

            case 7:
            {
                var mp4Output = new VFMP4v8v10Output();
                SetMP4Output(ref mp4Output);
                VideoCapture1.Output_Format = mp4Output;

                break;
            }

            case 8:
            {
                var mp4Output = new VFMP4v11Output();
                SetMP4v11Output(ref mp4Output);
                VideoCapture1.Output_Format = mp4Output;

                break;
            }

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

                VideoCapture1.Output_Format = gifOutput;

                break;
            }

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

                VideoCapture1.Output_Format = encOutput;

                break;
            }

            case 11:
            {
                var tsOutput = new VFMPEGTSOutput();
                SetMPEGTSOutput(ref tsOutput);
                VideoCapture1.Output_Format = tsOutput;

                break;
            }

            case 12:
            {
                var movOutput = new VFMOVOutput();
                SetMOVOutput(ref movOutput);
                VideoCapture1.Output_Format = movOutput;

                break;
            }
            }

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 2;
        }
Esempio n. 5
0
        private async void BtStart_Click(object sender, EventArgs e)
        {
            VideoEdit1.Debug_Mode      = cbDebugMode.Checked;
            VideoEdit1.Debug_Telemetry = cbTelemetry.Checked;

            mmLog.Clear();

            VideoEdit1.Mode = VFVideoEditMode.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 VFAVIOutput();
                SetAVIOutput(ref aviOutput);
                VideoEdit1.Output_Format = aviOutput;
                break;
            }

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

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

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

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

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

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

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

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

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

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

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

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

            case 13:
            {
                var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                VideoEdit1.Output_Format = ffmpegDLLOutput;
                break;
            }

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

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

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

            case 17:
            {
                var gifOutput = new VFAnimatedGIFOutput();
                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();
        }
        public void FillSettings(VFVideoCaptureOutputFormat format, VideoCaptureCore core)
        {
            switch (format)
            {
            case VFVideoCaptureOutputFormat.AVI:
            {
                var aviOutput = new VFAVIOutput();
                SetAVIOutput(ref aviOutput, core);
                core.Output_Format = aviOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.WMV:
            {
                var wmvOutput = new VFWMVOutput();
                SetWMVOutput(ref wmvOutput, core);
                core.Output_Format = wmvOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.DV:
            {
                var dvOutput = new VFDVOutput();
                SetDVOutput(ref dvOutput);
                core.Output_Format = dvOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.MKVv1:
            {
                var mkvOutput = new VFMKVv1Output();
                SetMKVOutput(ref mkvOutput, core);
                core.Output_Format = mkvOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.PCM_ACM:
            {
                var acmOutput = new VFACMOutput();
                SetACMOutput(ref acmOutput, core);
                core.Output_Format = acmOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.WMA:
            {
                var wmaOutput = new VFWMAOutput();
                SetWMAOutput(ref wmaOutput, core);
                core.Output_Format = wmaOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.MP3:
            {
                var mp3Output = new VFMP3Output();
                SetMP3Output(ref mp3Output);
                core.Output_Format = mp3Output;

                break;
            }

            case VFVideoCaptureOutputFormat.Custom:
            {
                var customOutput = new VFCustomOutput();
                SetCustomOutput(ref customOutput, core);
                core.Output_Format = customOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureDV:
            {
                core.Output_Format = new VFDirectCaptureDVOutput();
                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureMPEG:
            {
                core.Output_Format = new VFDirectCaptureMPEGOutput();
                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureAVI:
            {
                core.Output_Format = new VFDirectCaptureAVIOutput();
                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureMKV:
            {
                core.Output_Format = new VFDirectCaptureMKVOutput();
                break;
            }

            case VFVideoCaptureOutputFormat.FFMPEG_DLL:
            {
                var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                core.Output_Format = ffmpegDLLOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.WebM:
            {
                var webmOutput = new VFWebMOutput();
                SetWebMOutput(ref webmOutput);
                core.Output_Format = webmOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureMP4_GDCL:
            {
                var directCaptureOutputGDCL = new VFDirectCaptureMP4Output();
                SetDirectCaptureCustomOutput(ref directCaptureOutputGDCL, core);
                directCaptureOutputGDCL.Muxer = VFDirectCaptureMP4Muxer.GDCL;
                core.Output_Format            = directCaptureOutputGDCL;

                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureMP4_Monogram:
            {
                var directCaptureOutputMG = new VFDirectCaptureMP4Output();
                SetDirectCaptureCustomOutput(ref directCaptureOutputMG, core);
                directCaptureOutputMG.Muxer = VFDirectCaptureMP4Muxer.Monogram;
                core.Output_Format          = directCaptureOutputMG;

                break;
            }

            case VFVideoCaptureOutputFormat.DirectCaptureCustom:
            {
                var directCaptureOutput = new VFDirectCaptureCustomOutput();
                SetDirectCaptureCustomOutput(ref directCaptureOutput, core);
                core.Output_Format = directCaptureOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.MP4_CUDA:
            {
                if (mp4V10SettingsDialog == null)
                {
                    mp4V10SettingsDialog = new MP4v10SettingsDialog();
                }

                var mp4Output = new VFMP4v8v10Output();
                SetMP4Output(ref mp4Output);
                core.Output_Format = mp4Output;

                break;
            }

            case VFVideoCaptureOutputFormat.MP4v8v10:
            {
                if (mp4V10SettingsDialog == null)
                {
                    mp4V10SettingsDialog = new MP4v10SettingsDialog();
                }

                var mp4Output = new VFMP4v8v10Output();
                SetMP4Output(ref mp4Output);
                core.Output_Format = mp4Output;

                break;
            }

            case VFVideoCaptureOutputFormat.MP4v11:
            {
                var mp4Output = new VFMP4v11Output();
                SetMP4Output(ref mp4Output);
                core.Output_Format = mp4Output;

                break;
            }

            case VFVideoCaptureOutputFormat.Encrypted:
            {
                if (mp4V10SettingsDialog == null)
                {
                    mp4V10SettingsDialog = new MP4v10SettingsDialog();
                }

                var mp4Output = new VFMP4v8v10Output();
                SetMP4Output(ref mp4Output);
                mp4Output.Encryption = true;
                core.Output_Format   = mp4Output;

                break;
            }

            case VFVideoCaptureOutputFormat.FLAC:
            {
                var flacOutput = new VFFLACOutput();
                SetFLACOutput(ref flacOutput);
                core.Output_Format = flacOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.OggVorbis:
            {
                var oggVorbisOutput = new VFOGGVorbisOutput();
                SetOGGOutput(ref oggVorbisOutput);
                core.Output_Format = oggVorbisOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.Speex:
            {
                var speexOutput = new VFSpeexOutput();
                SetSpeexOutput(ref speexOutput);
                core.Output_Format = speexOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.FFMPEG_EXE:
            {
                var ffmpegOutput = new VFFFMPEGEXEOutput();
                SetFFMPEGEXEOutput(ref ffmpegOutput);
                core.Output_Format = ffmpegOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.M4A:
            {
                var m4aOutput = new VFM4AOutput();
                SetM4AOutput(ref m4aOutput);
                core.Output_Format = m4aOutput;

                break;
            }

            case VFVideoCaptureOutputFormat.AnimatedGIF:
            {
                var gifOutput = new VFAnimatedGIFOutput();
                SetGIFOutput(ref gifOutput);
                core.Output_Format = gifOutput;
                break;
            }

            case VFVideoCaptureOutputFormat.VLC_EXE:
            {
                var vlcOutput = new VFVLCEXEOutput();
                //SetGIFOutput(ref gifOutput);
                core.Output_Format = vlcOutput;
                break;
            }

            default:
                throw new ArgumentOutOfRangeException(nameof(format), format, null);
            }
        }
Esempio n. 7
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 (VideoEdit.Filter_Supported_EVR())
            {
                VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR;
            }
            else if (VideoEdit.Filter_Supported_VMR9())
            {
                VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9;
            }
            else
            {
                VideoEdit1.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer;
            }

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

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

                    break;
                }

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

                    break;
                }

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

                    break;
                }

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

                    break;
                }

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

                    break;
                }

                case 5:
                {
                    var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                    SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                    VideoEdit1.Output_Format = ffmpegDLLOutput;

                    break;
                }

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

                    break;
                }

                case 7:
                {
                    var mp4Output = new VFMP4v8v10Output();
                    SetMP4v10Output(ref mp4Output);
                    VideoEdit1.Output_Format = mp4Output;

                    break;
                }

                case 8:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoEdit1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoEdit1.Output_Format = gifOutput;

                    break;
                }

                case 10:
                {
                    var encOutput = new VFMP4v8v10Output();
                    SetMP4v10Output(ref encOutput);
                    encOutput.Encryption        = true;
                    encOutput.Encryption_Format = VFEncryptionFormat.MP4_H264_SW_AAC;

                    VideoEdit1.Output_Format = encOutput;

                    break;
                }
                }
            }

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

            VideoEdit1.Input_Clear_List();

            if (rbImagesPredefined.Checked)
            {
                predefinedImagesUsed = true;

                await VideoEdit1.Input_AddVideoBlankAsync(
                    TimeSpan.FromMilliseconds(10000),
                    TimeSpan.FromMilliseconds(0),
                    1280,
                    720,
                    Color.Black);
            }
            else
            {
                predefinedImagesUsed = false;

                if (!Directory.Exists(edImagesFolder.Text))
                {
                    MessageBox.Show(this, "Folder with images doesn't exists!");
                    return;
                }

                loadedFiles = EnumerateImageFiles(edImagesFolder.Text);

                int width  = Convert.ToInt32(edWidth.Text);
                int height = Convert.ToInt32(edHeight.Text);

                loadedImageFilename = null;
                if (loadedImage != null)
                {
                    loadedImage.Dispose();
                    loadedImage = null;
                }

                await VideoEdit1.Input_AddVideoBlankAsync(
                    TimeSpan.FromSeconds(loadedFiles.Length * 2),
                    TimeSpan.FromMilliseconds(0),
                    width,
                    height,
                    Color.Black);
            }

            await VideoEdit1.StartAsync();
        }
Esempio n. 8
0
        public void LoadSettings(VFMP4v8v10Output mp4Output)
        {
            switch (mp4Output.MP4Mode)
            {
            case VFMP4Mode.v10:
                cbMP4Mode.SelectedIndex = 1;
                break;

            case VFMP4Mode.v8:
                cbMP4Mode.SelectedIndex = 0;
                break;

            case VFMP4Mode.v10_NVENC:
                cbMP4Mode.SelectedIndex = 2;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            if (mp4Output.MP4Mode == VFMP4Mode.v8 || mp4Output.MP4Mode == VFMP4Mode.v10)
            {
                // Legacy / Modern settings
                // Video H264 settings
                switch (mp4Output.Video.Profile)
                {
                case VFH264Profile.ProfileAuto:
                    cbH264Profile.SelectedIndex = 0;
                    break;

                case VFH264Profile.ProfileBaseline:
                    cbH264Profile.SelectedIndex = 1;
                    break;

                case VFH264Profile.ProfileMain:
                    cbH264Profile.SelectedIndex = 2;
                    break;

                case VFH264Profile.ProfileHigh:
                    cbH264Profile.SelectedIndex = 3;
                    break;

                case VFH264Profile.ProfileHigh10:
                    cbH264Profile.SelectedIndex = 4;
                    break;

                case VFH264Profile.ProfileHigh422:
                    cbH264Profile.SelectedIndex = 5;
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                switch (mp4Output.Video.Level)
                {
                case VFH264Level.LevelAuto:
                    cbH264Level.SelectedIndex = 0;
                    break;

                case VFH264Level.Level1:
                    cbH264Level.SelectedIndex = 1;
                    break;

                case VFH264Level.Level11:
                    cbH264Level.SelectedIndex = 2;
                    break;

                case VFH264Level.Level12:
                    cbH264Level.SelectedIndex = 3;
                    break;

                case VFH264Level.Level13:
                    cbH264Level.SelectedIndex = 4;
                    break;

                case VFH264Level.Level2:
                    cbH264Level.SelectedIndex = 5;
                    break;

                case VFH264Level.Level21:
                    cbH264Level.SelectedIndex = 6;
                    break;

                case VFH264Level.Level22:
                    cbH264Level.SelectedIndex = 7;
                    break;

                case VFH264Level.Level3:
                    cbH264Level.SelectedIndex = 8;
                    break;

                case VFH264Level.Level31:
                    cbH264Level.SelectedIndex = 9;
                    break;

                case VFH264Level.Level32:
                    cbH264Level.SelectedIndex = 10;
                    break;

                case VFH264Level.Level4:
                    cbH264Level.SelectedIndex = 11;
                    break;

                case VFH264Level.Level41:
                    cbH264Level.SelectedIndex = 12;
                    break;

                case VFH264Level.Level42:
                    cbH264Level.SelectedIndex = 13;
                    break;

                case VFH264Level.Level5:
                    cbH264Level.SelectedIndex = 14;
                    break;

                case VFH264Level.Level51:
                    cbH264Level.SelectedIndex = 15;
                    break;

                case VFH264Level.Level51_NVENC:
                    cbH264Level.SelectedIndex = 15;
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                switch (mp4Output.Video.TargetUsage)
                {
                case VFH264TargetUsage.Auto:
                    cbH264TargetUsage.SelectedIndex = 0;
                    break;

                case VFH264TargetUsage.BestQuality:
                    cbH264TargetUsage.SelectedIndex = 1;
                    break;

                case VFH264TargetUsage.Balanced:
                    cbH264TargetUsage.SelectedIndex = 2;
                    break;

                case VFH264TargetUsage.BestSpeed:
                    cbH264TargetUsage.SelectedIndex = 3;
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                switch (mp4Output.Video.PictureType)
                {
                case VFH264PictureType.Auto:
                    cbH264PictureType.SelectedIndex = 0;
                    break;

                case VFH264PictureType.Frame:
                    cbH264PictureType.SelectedIndex = 1;
                    break;

                case VFH264PictureType.TFF:
                    cbH264PictureType.SelectedIndex = 2;
                    break;

                case VFH264PictureType.BFF:
                    cbH264PictureType.SelectedIndex = 3;
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                cbH264RateControl.SelectedIndex = (int)mp4Output.Video.RateControl;
                cbH264MBEncoding.SelectedIndex  = (int)mp4Output.Video.MBEncoding;
                cbH264GOP.Checked         = mp4Output.Video.GOP;
                cbH264AutoBitrate.Checked = mp4Output.Video.BitrateAuto;
                edH264IDR.Text            = mp4Output.Video.IDR_Period.ToString();
                edH264P.Text       = mp4Output.Video.P_Period.ToString();
                edH264Bitrate.Text = mp4Output.Video.Bitrate.ToString();
            }
            else if (mp4Output.MP4Mode == VFMP4Mode.v10_NVENC)
            {
                // NVENC settings
                switch (mp4Output.Video_NVENC.Profile)
                {
                case VFNVENCVideoEncoderProfile.Auto:
                    cbNVENCProfile.SelectedIndex = 0;
                    break;

                case VFNVENCVideoEncoderProfile.H264_Baseline:
                    cbNVENCProfile.SelectedIndex = 1;
                    break;

                case VFNVENCVideoEncoderProfile.H264_Main:
                    cbNVENCProfile.SelectedIndex = 2;
                    break;

                case VFNVENCVideoEncoderProfile.H264_High:
                    cbNVENCProfile.SelectedIndex = 3;
                    break;

                case VFNVENCVideoEncoderProfile.H264_High444:
                    cbNVENCProfile.SelectedIndex = 4;
                    break;

                case VFNVENCVideoEncoderProfile.H264_ProgressiveHigh:
                    cbNVENCProfile.SelectedIndex = 5;
                    break;

                case VFNVENCVideoEncoderProfile.H264_ConstrainedHigh:
                    cbNVENCProfile.SelectedIndex = 6;
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                switch (mp4Output.Video_NVENC.Level)
                {
                case VFNVENCEncoderLevel.Auto:
                    cbNVENCLevel.SelectedIndex = 0;
                    break;

                case VFNVENCEncoderLevel.H264_1:
                    cbNVENCLevel.SelectedIndex = 1;
                    break;

                case VFNVENCEncoderLevel.H264_11:
                    cbNVENCLevel.SelectedIndex = 2;
                    break;

                case VFNVENCEncoderLevel.H264_12:
                    cbNVENCLevel.SelectedIndex = 3;
                    break;

                case VFNVENCEncoderLevel.H264_13:
                    cbNVENCLevel.SelectedIndex = 4;
                    break;

                case VFNVENCEncoderLevel.H264_2:
                    cbNVENCLevel.SelectedIndex = 5;
                    break;

                case VFNVENCEncoderLevel.H264_21:
                    cbNVENCLevel.SelectedIndex = 6;
                    break;

                case VFNVENCEncoderLevel.H264_22:
                    cbNVENCLevel.SelectedIndex = 7;
                    break;

                case VFNVENCEncoderLevel.H264_3:
                    cbNVENCLevel.SelectedIndex = 8;
                    break;

                case VFNVENCEncoderLevel.H264_31:
                    cbNVENCLevel.SelectedIndex = 9;
                    break;

                case VFNVENCEncoderLevel.H264_32:
                    cbNVENCLevel.SelectedIndex = 10;
                    break;

                case VFNVENCEncoderLevel.H264_4:
                    cbNVENCLevel.SelectedIndex = 11;
                    break;

                case VFNVENCEncoderLevel.H264_41:
                    cbNVENCLevel.SelectedIndex = 12;
                    break;

                case VFNVENCEncoderLevel.H264_42:
                    cbNVENCLevel.SelectedIndex = 13;
                    break;

                case VFNVENCEncoderLevel.H264_5:
                    cbNVENCLevel.SelectedIndex = 14;
                    break;

                case VFNVENCEncoderLevel.H264_51:
                    cbNVENCLevel.SelectedIndex = 15;
                    break;

                case VFNVENCEncoderLevel.H264_52:
                    cbNVENCLevel.SelectedIndex = 16;
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                edNVENCBitrate.Text = mp4Output.Video_NVENC.Bitrate.ToString();
                edNVENCQP.Text      = mp4Output.Video_NVENC.QP.ToString();
                cbNVENCRateControl.SelectedIndex = (int)mp4Output.Video_NVENC.RateControl;
                edNVENCGOP.Text     = mp4Output.Video_NVENC.GOP.ToString();
                edNVENCBFrames.Text = mp4Output.Video_NVENC.BFrames.ToString();
            }

            // Audio AAC settings
            cbAACBitrate.Text               = mp4Output.Audio_AAC.Bitrate.ToString();
            cbAACVersion.SelectedIndex      = (int)mp4Output.Audio_AAC.Version;
            cbAACOutput.SelectedIndex       = (int)mp4Output.Audio_AAC.Output;
            cbAACObjectType.SelectedIndex   = (int)mp4Output.Audio_AAC.Object - 1;
            cbMP4UseSpecialSyncMode.Checked = mp4Output.UseSpecialSyncMode;

            if ((mp4Output.MP4V10Flags & (int)MP4V10Flags.TimeAdjust) != 0)
            {
                cbMP4TimeAdjust.Checked = true;
            }
            else
            {
                cbMP4TimeAdjust.Checked = false;
            }

            if ((mp4Output.MP4V10Flags & (int)MP4V10Flags.TimeOverride) != 0)
            {
                cbMP4TimeOverride.Checked = true;
            }
            else
            {
                cbMP4TimeOverride.Checked = false;
            }

            switch (mp4Output.Encryption_KeyType)
            {
            case VFEncryptionKeyType.String:
                rbEncryptionKeyString.Checked = true;
                edEncryptionKeyString.Text    = mp4Output.Encryption_Key.ToString();
                break;

            case VFEncryptionKeyType.File:
                rbEncryptionKeyFile.Checked = true;
                edEncryptionKeyString.Text  = mp4Output.Encryption_Key.ToString();
                break;

            case VFEncryptionKeyType.Binary:
                rbEncryptionKeyFile.Checked = true;
                edEncryptionKeyHEX.Text     = ConvertByteArrayToHexString((byte[])mp4Output.Encryption_Key);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            switch (mp4Output.Encryption_Mode)
            {
            case VFEncryptionMode.v8_AES128:
                rbEncryptionModeAES128.Checked = true;
                break;

            case VFEncryptionMode.v9_AES256:
                rbEncryptionModeAES128.Checked = false;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Esempio n. 9
0
        public void SaveSettings(ref VFMP4v8v10Output mp4Output)
        {
            int tmp;

            switch (cbMP4Mode.SelectedIndex)
            {
            case 0:
                // v8 Legacy(XP compatible, CPU or Intel QuickSync GPU)
                mp4Output.MP4Mode = VFMP4Mode.v8;
                break;

            case 1:
                // v10(CPU or Intel QuickSync GPU)
                mp4Output.MP4Mode = VFMP4Mode.v10;
                break;

            case 2:
                // v10 nVidia NVENC
                mp4Output.MP4Mode = VFMP4Mode.v10_NVENC;
                break;
            }

            if (mp4Output.MP4Mode == VFMP4Mode.v8 || mp4Output.MP4Mode == VFMP4Mode.v10)
            {
                // Legacy / Modern settings

                // Video H264 settings
                switch (cbH264Profile.SelectedIndex)
                {
                case 0:
                    mp4Output.Video.Profile = VFH264Profile.ProfileAuto;
                    break;

                case 1:
                    mp4Output.Video.Profile = VFH264Profile.ProfileBaseline;
                    break;

                case 2:
                    mp4Output.Video.Profile = VFH264Profile.ProfileMain;
                    break;

                case 3:
                    mp4Output.Video.Profile = VFH264Profile.ProfileHigh;
                    break;

                case 4:
                    mp4Output.Video.Profile = VFH264Profile.ProfileHigh10;
                    break;

                case 5:
                    mp4Output.Video.Profile = VFH264Profile.ProfileHigh422;
                    break;
                }

                switch (cbH264Level.SelectedIndex)
                {
                case 0:
                    mp4Output.Video.Level = VFH264Level.LevelAuto;
                    break;

                case 1:
                    mp4Output.Video.Level = VFH264Level.Level1;
                    break;

                case 2:
                    mp4Output.Video.Level = VFH264Level.Level11;
                    break;

                case 3:
                    mp4Output.Video.Level = VFH264Level.Level12;
                    break;

                case 4:
                    mp4Output.Video.Level = VFH264Level.Level13;
                    break;

                case 5:
                    mp4Output.Video.Level = VFH264Level.Level2;
                    break;

                case 6:
                    mp4Output.Video.Level = VFH264Level.Level21;
                    break;

                case 7:
                    mp4Output.Video.Level = VFH264Level.Level22;
                    break;

                case 8:
                    mp4Output.Video.Level = VFH264Level.Level3;
                    break;

                case 9:
                    mp4Output.Video.Level = VFH264Level.Level31;
                    break;

                case 10:
                    mp4Output.Video.Level = VFH264Level.Level32;
                    break;

                case 11:
                    mp4Output.Video.Level = VFH264Level.Level4;
                    break;

                case 12:
                    mp4Output.Video.Level = VFH264Level.Level41;
                    break;

                case 13:
                    mp4Output.Video.Level = VFH264Level.Level42;
                    break;

                case 14:
                    mp4Output.Video.Level = VFH264Level.Level5;
                    break;

                case 15:
                    mp4Output.Video.Level = VFH264Level.Level51;
                    break;
                }

                switch (cbH264TargetUsage.SelectedIndex)
                {
                case 0:
                    mp4Output.Video.TargetUsage = VFH264TargetUsage.Auto;
                    break;

                case 1:
                    mp4Output.Video.TargetUsage = VFH264TargetUsage.BestQuality;
                    break;

                case 2:
                    mp4Output.Video.TargetUsage = VFH264TargetUsage.Balanced;
                    break;

                case 3:
                    mp4Output.Video.TargetUsage = VFH264TargetUsage.BestSpeed;
                    break;
                }

                switch (cbH264PictureType.SelectedIndex)
                {
                case 0:
                    mp4Output.Video.PictureType = VFH264PictureType.Auto;
                    break;

                case 1:
                    mp4Output.Video.PictureType = VFH264PictureType.Frame;
                    break;

                case 2:
                    mp4Output.Video.PictureType = VFH264PictureType.TFF;
                    break;

                case 3:
                    mp4Output.Video.PictureType = VFH264PictureType.BFF;
                    break;
                }

                mp4Output.Video.RateControl = (VFH264RateControl)cbH264RateControl.SelectedIndex;
                mp4Output.Video.MBEncoding  = (VFH264MBEncoding)cbH264MBEncoding.SelectedIndex;
                mp4Output.Video.GOP         = cbH264GOP.Checked;
                mp4Output.Video.BitrateAuto = cbH264AutoBitrate.Checked;

                int.TryParse(edH264IDR.Text, out tmp);
                mp4Output.Video.IDR_Period = tmp;

                int.TryParse(edH264P.Text, out tmp);
                mp4Output.Video.P_Period = tmp;

                int.TryParse(edH264Bitrate.Text, out tmp);
                mp4Output.Video.Bitrate = tmp;
            }
            else if (mp4Output.MP4Mode == VFMP4Mode.v10_NVENC)
            {
                // NVENC settings
                switch (cbNVENCProfile.SelectedIndex)
                {
                case 0:
                    mp4Output.Video_NVENC.Profile = VFNVENCVideoEncoderProfile.Auto;
                    break;

                case 1:
                    mp4Output.Video_NVENC.Profile = VFNVENCVideoEncoderProfile.H264_Baseline;
                    break;

                case 2:
                    mp4Output.Video_NVENC.Profile = VFNVENCVideoEncoderProfile.H264_Main;
                    break;

                case 3:
                    mp4Output.Video_NVENC.Profile = VFNVENCVideoEncoderProfile.H264_High;
                    break;

                case 4:
                    mp4Output.Video_NVENC.Profile = VFNVENCVideoEncoderProfile.H264_High444;
                    break;

                case 5:
                    mp4Output.Video_NVENC.Profile = VFNVENCVideoEncoderProfile.H264_ProgressiveHigh;
                    break;

                case 6:
                    mp4Output.Video_NVENC.Profile = VFNVENCVideoEncoderProfile.H264_ConstrainedHigh;
                    break;
                }

                switch (cbNVENCLevel.SelectedIndex)
                {
                case 0:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.Auto;
                    break;

                case 1:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_1;
                    break;

                case 2:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_11;
                    break;

                case 3:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_12;
                    break;

                case 4:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_13;
                    break;

                case 5:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_2;
                    break;

                case 6:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_21;
                    break;

                case 7:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_22;
                    break;

                case 8:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_3;
                    break;

                case 9:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_31;
                    break;

                case 10:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_32;
                    break;

                case 11:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_4;
                    break;

                case 12:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_41;
                    break;

                case 13:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_42;
                    break;

                case 14:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_5;
                    break;

                case 15:
                    mp4Output.Video_NVENC.Level = VFNVENCEncoderLevel.H264_51;
                    break;
                }

                mp4Output.Video_NVENC.Bitrate     = Convert.ToInt32(edNVENCBitrate.Text);
                mp4Output.Video_NVENC.QP          = Convert.ToInt32(edNVENCQP.Text);
                mp4Output.Video_NVENC.RateControl = (VFNVENCRateControlMode)cbNVENCRateControl.SelectedIndex;
                mp4Output.Video_NVENC.GOP         = Convert.ToInt32(edNVENCGOP.Text);
                mp4Output.Video_NVENC.BFrames     = Convert.ToInt32(edNVENCBFrames.Text);
            }

            // Audio AAC settings
            int.TryParse(cbAACBitrate.Text, out tmp);
            mp4Output.Audio_AAC.Bitrate = tmp;
            mp4Output.Audio_AAC.Version = (VFAACVersion)cbAACVersion.SelectedIndex;
            mp4Output.Audio_AAC.Output  = (VFAACOutput)cbAACOutput.SelectedIndex;
            mp4Output.Audio_AAC.Object  = (VFAACObject)(cbAACObjectType.SelectedIndex + 1);

            mp4Output.UseSpecialSyncMode = cbMP4UseSpecialSyncMode.Checked;

            if (cbMP4CustomAVSettings.Checked)
            {
                mp4Output.MP4V10Flags = 0;
                if (cbMP4TimeAdjust.Checked)
                {
                    mp4Output.MP4V10Flags |= (int)MP4V10Flags.TimeAdjust;
                }

                if (cbMP4TimeOverride.Checked)
                {
                    mp4Output.MP4V10Flags |= (int)MP4V10Flags.TimeOverride;
                }
            }

            mp4Output.Encryption_Format = VFEncryptionFormat.MP4_H264_SW_AAC;

            if (rbEncryptionKeyString.Checked)
            {
                mp4Output.Encryption_KeyType = VFEncryptionKeyType.String;
                mp4Output.Encryption_Key     = edEncryptionKeyString.Text;
            }
            else if (rbEncryptionKeyFile.Checked)
            {
                mp4Output.Encryption_KeyType = VFEncryptionKeyType.File;
                mp4Output.Encryption_Key     = edEncryptionKeyFile.Text;
            }
            else
            {
                mp4Output.Encryption_KeyType = VFEncryptionKeyType.Binary;
                mp4Output.Encryption_Key     = ConvertHexStringToByteArray(edEncryptionKeyHEX.Text);
            }

            if (rbEncryptionModeAES128.Checked)
            {
                mp4Output.Encryption_Mode = VFEncryptionMode.v8_AES128;
            }
            else
            {
                mp4Output.Encryption_Mode = VFEncryptionMode.v9_AES256;
            }
        }
Esempio n. 10
0
        private void btStart_Click(object sender, EventArgs e)
        {
            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  =
                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
            {
                VideoPresent   = true,
                VideoWidth     = bmp.Width,
                VideoHeight    = bmp.Height,
                VideoFrameRate = 25.0f
            };
            bmp.Dispose();

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

                VideoCapture1.Output_Filename = edOutput.Text;

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

                    break;
                }

                case 1:
                {
                    var mkvOutput = new VFMKVv1Output();
                    SetMKVOutput(ref mkvOutput);
                    VideoCapture1.Output_Format = mkvOutput;

                    break;
                }

                case 2:
                {
                    var wmvOutput = new VFWMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 3:
                {
                    var dvOutput = new VFDVOutput();
                    SetDVOutput(ref dvOutput);
                    VideoCapture1.Output_Format = dvOutput;

                    break;
                }

                case 4:
                {
                    var webmOutput = new VFWebMOutput();
                    SetWebMOutput(ref webmOutput);
                    VideoCapture1.Output_Format = webmOutput;

                    break;
                }

                case 5:
                {
                    var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                    SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                    VideoCapture1.Output_Format = ffmpegDLLOutput;

                    break;
                }

                case 6:
                {
                    var ffmpegOutput = new VFFFMPEGEXEOutput();
                    SetFFMPEGEXEOutput(ref ffmpegOutput);
                    VideoCapture1.Output_Format = ffmpegOutput;

                    break;
                }

                case 7:
                {
                    var mp4Output = new VFMP4v8v10Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 8:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

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

                    VideoCapture1.Output_Format = encOutput;

                    break;
                }

                case 11:
                {
                    var tsOutput = new VFMPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 12:
                {
                    var movOutput = new VFMOVOutput();
                    SetMOVOutput(ref movOutput);
                    VideoCapture1.Output_Format = movOutput;

                    break;
                }
                }
            }

            VideoCapture1.Start();

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

            PushImages();
        }
Esempio n. 11
0
        private void btStart_Click(object sender, EventArgs e)
        {
            kinect.SensorID = cbKinectDevice.SelectedIndex;

            if (rbUseVideoSource.Checked)
            {
                kinect.Video_Source = VFKinectVideoSource.Video;
            }
            else
            {
                kinect.Video_Source = VFKinectVideoSource.DepthGrayscale;
            }

            VideoCapture1.Audio_CaptureDevice        = cbAudioCaptureDevice.Text;
            VideoCapture1.Audio_CaptureDevice_Format = cbAudioCaptureFormat.Text;
            VideoCapture1.Audio_RecordAudio          = true;
            VideoCapture1.Audio_PlayAudio            = true;

            if (rbPreview.Checked)
            {
                VideoCapture1.Mode = VFVideoCaptureMode.KinectPreview;
            }
            else
            {
                VideoCapture1.Mode = VFVideoCaptureMode.KinectCapture;

                VideoCapture1.Output_Filename = edOutput.Text;

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

                    break;
                }

                case 1:
                {
                    var mkvOutput = new VFMKVv1Output();
                    SetMKVOutput(ref mkvOutput);
                    VideoCapture1.Output_Format = mkvOutput;

                    break;
                }

                case 2:
                {
                    var wmvOutput = new VFWMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 3:
                {
                    var dvOutput = new VFDVOutput();
                    SetDVOutput(ref dvOutput);
                    VideoCapture1.Output_Format = dvOutput;

                    break;
                }

                case 4:
                {
                    var webmOutput = new VFWebMOutput();
                    SetWebMOutput(ref webmOutput);
                    VideoCapture1.Output_Format = webmOutput;

                    break;
                }

                case 5:
                {
                    var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                    SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                    VideoCapture1.Output_Format = ffmpegDLLOutput;

                    break;
                }

                case 6:
                {
                    var ffmpegOutput = new VFFFMPEGEXEOutput();
                    SetFFMPEGEXEOutput(ref ffmpegOutput);
                    VideoCapture1.Output_Format = ffmpegOutput;

                    break;
                }

                case 7:
                {
                    var mp4Output = new VFMP4v8v10Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 8:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

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

                    VideoCapture1.Output_Format = encOutput;

                    break;
                }

                case 11:
                {
                    var tsOutput = new VFMPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 12:
                {
                    var movOutput = new VFMOVOutput();
                    SetMOVOutput(ref movOutput);
                    VideoCapture1.Output_Format = movOutput;

                    break;
                }
                }
            }

            if (VideoCapture.Filter_Supported_EVR())
            {
                VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR;
            }
            else if (VideoCapture.Filter_Supported_VMR9())
            {
                VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9;
            }
            else
            {
                VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer;
            }

            VideoCapture1.Audio_PlayAudio = false;

            kinect.Init(VideoCapture1.Core);
            kinect.Start();

            tcMain.SelectedIndex = 2;
            tmRecording.Start();
        }
Esempio n. 12
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  = 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 = cbVideoInputDevice.Text;
            VideoCapture1.Video_CaptureDevice_IsAudioSource = cbUseAudioInputFromVideoCaptureDevice.Checked;
            VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text;
            VideoCapture1.Audio_CaptureDevice_Format_UseBest = cbUseBestAudioInputFormat.Checked;
            VideoCapture1.Video_CaptureDevice_Format_UseBest = cbUseBestVideoInputFormat.Checked;
            VideoCapture1.Video_CaptureDevice_Format         = cbVideoInputFormat.Text;
            VideoCapture1.Audio_CaptureDevice        = cbAudioInputDevice.Text;
            VideoCapture1.Audio_CaptureDevice_Format = cbAudioInputFormat.Text;

            if (cbFramerate.SelectedIndex != -1)
            {
                VideoCapture1.Video_CaptureDevice_FrameRate = (float)Convert.ToDouble(cbFramerate.Text);
            }

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

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

                break;
            }

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

                break;
            }

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

                break;
            }

            case 3:
            {
                var mp4Output = new VFMP4v11Output();
                SetMP4v11Output(ref mp4Output);
                VideoCapture1.Output_Format = mp4Output;

                break;
            }

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

                break;
            }

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

                break;
            }
            }

            // separate capture settings
            VideoCapture1.SeparateCapture_Enabled = true;
            if (rbSeparateCaptureStartManually.Checked)
            {
                VideoCapture1.SeparateCapture_Mode             = VFSeparateCaptureMode.Normal;
                VideoCapture1.SeparateCapture_AutostartCapture = false;
            }
            else if (rbSeparateCaptureSplitByDuration.Checked)
            {
                VideoCapture1.SeparateCapture_Mode             = VFSeparateCaptureMode.SplitByDuration;
                VideoCapture1.SeparateCapture_AutostartCapture = true;
                VideoCapture1.SeparateCapture_TimeThreshold    = TimeSpan.FromMilliseconds(Convert.ToInt32(edSeparateCaptureDuration.Text));
            }
            else if (rbSeparateCaptureSplitBySize.Checked)
            {
                VideoCapture1.SeparateCapture_Mode              = VFSeparateCaptureMode.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 VFVideoEffectTextLogo(true) { Mode = TextLogoMode.Timestamp };
            //VideoCapture1.Video_Effects_Add(tsEffect);

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 4;
            tmRecording.Start();
        }
Esempio n. 13
0
        private async void btStart_Click(object sender, RoutedEventArgs e)
        {
            mmLog.Clear();

            VideoCapture1.Video_Sample_Grabber_Enabled = true;

            VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true;
            VideoCapture1.Debug_Dir  =
                Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\";

            VideoCapture1.Audio_OutputDevice = "Default DirectSound Device";

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

            // apply capture params
            VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF;

            VideoCapture1.Video_CaptureDevice = cbVideoInputDevice.Text;
            VideoCapture1.Video_CaptureDevice_IsAudioSource = cbUseAudioInputFromVideoCaptureDevice.IsChecked == true;
            VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text;
            VideoCapture1.Audio_CaptureDevice_Format_UseBest = cbUseBestAudioInputFormat.IsChecked == true;
            VideoCapture1.Video_CaptureFormat         = cbVideoInputFormat.Text;
            VideoCapture1.Video_CaptureFormat_UseBest = cbUseBestVideoInputFormat.IsChecked == true;
            VideoCapture1.Audio_CaptureDevice         = cbAudioInputDevice.Text;
            VideoCapture1.Audio_CaptureDevice_Format  = cbAudioInputFormat.Text;

            if (cbFramerate.SelectedIndex != -1)
            {
                VideoCapture1.Video_FrameRate = (float)Convert.ToDouble(cbFramerate.Text);
            }

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

                VideoCapture1.Output_Filename = edOutput.Text;

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

                    break;
                }

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

                    break;
                }

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

                    break;
                }

                case 3:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

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

                    break;
                }

                case 6:
                {
                    var movOutput = new VFMOVOutput();
                    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();
            lbLogos.Items.Clear();
            ConfigureVideoEffects();

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 3;
            tmRecording.Start();
        }
        private async void btStart_Click(object sender, RoutedEventArgs e)
        {
            mmLog.Clear();

            VideoCapture1.Video_Sample_Grabber_Enabled = true;

            VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true;
            VideoCapture1.Debug_Dir  =
                Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\";

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

            if (cbRecordAudio.IsChecked == true)
            {
                VideoCapture1.Audio_RecordAudio = true;
                VideoCapture1.Audio_PlayAudio   = false;

                VideoCapture1.Audio_CaptureDevice        = 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 parameters
            VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF;

            VideoCapture1.Video_Effects_Enabled = true;
            VideoCapture1.Video_Effects_Clear();

            if (rbPreview.IsChecked == true)
            {
                VideoCapture1.Mode = VFVideoCaptureMode.ScreenPreview;
            }
            else
            {
                VideoCapture1.Mode = VFVideoCaptureMode.ScreenCapture;

                VideoCapture1.Output_Filename = edOutput.Text;
                switch (cbOutputFormat.SelectedIndex)
                {
                case 0:
                {
                    var aviOutput = new VFAVIOutput();
                    SetAVIOutput(ref aviOutput);
                    VideoCapture1.Output_Format = aviOutput;

                    break;
                }

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

                    break;
                }

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

                    break;
                }

                case 3:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

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

                    break;
                }

                case 6:
                {
                    var movOutput = new VFMOVOutput();
                    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();
        }
Esempio n. 15
0
        private void btStart_Click(object sender, EventArgs e)
        {
            mmLog.Clear();

            VideoCapture1.Debug_Mode = cbDebugMode.Checked;
            VideoCapture1.Debug_Dir  = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\";

            VideoCapture1.Mode = VFVideoCaptureMode.VideoPreview;

            VideoCapture1.Audio_CaptureDevice                = cbAudioInputDevice.Text;
            VideoCapture1.Audio_CaptureDevice_Format         = cbAudioInputFormat.Text;
            VideoCapture1.Audio_CaptureDevice_Line           = cbAudioInputLine.Text;
            VideoCapture1.Audio_CaptureDevice_Format_UseBest = cbUseBestAudioInputFormat.Checked;

            VideoCapture1.Video_CaptureDevice = cbVideoInputDevice.Text;
            VideoCapture1.Video_CaptureDevice_IsAudioSource  = cbUseAudioInputFromVideoCaptureDevice.Checked;
            VideoCapture1.Video_CaptureDevice_Format_UseBest = cbUseBestVideoInputFormat.Checked;
            VideoCapture1.Video_CaptureDevice_Format         = cbVideoInputFormat.Text;

            if (cbFramerate.SelectedIndex != -1)
            {
                VideoCapture1.Video_CaptureDevice_FrameRate = Convert.ToDouble(cbFramerate.Text, CultureInfo.CurrentCulture);
            }

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

            VideoCapture1.Timeshift_Settings = new TimeshiftSettings
            {
                Player_Screen = MediaPlayer1,
                TempFolder    = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\SBE\\",
                Player_AudioOutput_Enabled = cbPlayerPlayAudio.Checked
            };
            var mp4Settings = new VFMP4v8v10Output();

            mp4Settings.Video.IDR_Period = 5;

            VideoCapture1.Timeshift_Settings.EncodingSettings = mp4Settings;

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

            case 1:
            {
                VideoCapture1.Output_Filename = edOutput.Text;
                VideoCapture1.Mode            = VFVideoCaptureMode.VideoCapture;
                var output = new VFAVIOutput();
                VideoCapture1.Output_Format = output;
            }

            break;

            case 2:
            {
                VideoCapture1.Output_Filename = edOutput.Text;
                VideoCapture1.Mode            = VFVideoCaptureMode.VideoCapture;
                var output = new VFMP4v8v10Output();
                VideoCapture1.Output_Format = output;
            }

            break;

            case 3:
            {
                VideoCapture1.Output_Filename = edOutput.Text;
                VideoCapture1.Mode            = VFVideoCaptureMode.VideoCapture;
                var output = new VFWebMOutput();
                VideoCapture1.Output_Format = output;
            }

            break;
            }

            VideoCapture1.Start();

            timer1.Interval = 1000;
            timer1.Enabled  = true;
        }
Esempio n. 16
0
        private void btStart_Click(object sender, RoutedEventArgs e)
        {
            if (onvifControl != null)
            {
                onvifControl.Disconnect();
                onvifControl.Dispose();
                onvifControl = null;

                btONVIFConnect.Content = "Connect";
            }

            mmLog.Clear();

            VideoCapture1.Video_Sample_Grabber_Enabled = true;

            VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true;
            VideoCapture1.Debug_Dir  =
                Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\";

            VideoCapture1.Audio_RecordAudio = cbIPAudioCapture.IsChecked == true;
            VideoCapture1.Audio_PlayAudio   = cbIPAudioCapture.IsChecked == true;

            VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF;

            // source
            VideoCapture1.IP_Camera_Source = new IPCameraSourceSettings
            {
                URL = edIPUrl.Text
            };

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

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

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

            case 3:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_Live555;
                break;

            case 4:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.HTTP_FFMPEG;
                break;

            case 5:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.MMS_WMV;
                break;

            case 6:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_UDP_FFMPEG;
                break;

            case 7:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_TCP_FFMPEG;
                break;

            case 8:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_HTTP_FFMPEG;
                break;

            case 9:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.HTTP_MJPEG_LowLatency;
                cbIPAudioCapture.IsChecked          = false;
                VideoCapture1.Audio_RecordAudio     = false;
                VideoCapture1.Audio_PlayAudio       = false;

                break;

            case 10:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_LowLatency;
                VideoCapture1.IP_Camera_Source.RTSP_LowLatency_UseUDP = false;
                break;

            case 11:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_LowLatency;
                VideoCapture1.IP_Camera_Source.RTSP_LowLatency_UseUDP = true;
                break;
            }

            VideoCapture1.IP_Camera_Source.AudioCapture = cbIPAudioCapture.IsChecked == true;
            VideoCapture1.IP_Camera_Source.Login        = edIPLogin.Text;
            VideoCapture1.IP_Camera_Source.Password     = edIPPassword.Text;
            VideoCapture1.IP_Camera_Source.VLC_ZeroClockJitterEnabled = cbVLCZeroClockJitter.IsChecked == true;
            VideoCapture1.IP_Camera_Source.VLC_CustomLatency          = Convert.ToInt32(edVLCCacheSize.Text);
            VideoCapture1.IP_Camera_Source.ForcedFramerate            = Convert.ToDouble(edIPForcedFramerate.Text);
            VideoCapture1.IP_Camera_Source.ForcedFramerate_InstanceID = edIPForcedFramerateID.Text[0];

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

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

            if (cbIPDisconnect.IsChecked == true)
            {
                VideoCapture1.IP_Camera_Source.DisconnectEventInterval = 5000;
            }

            if (rbPreview.IsChecked == true)
            {
                VideoCapture1.Mode = VFVideoCaptureMode.IPPreview;
            }
            else if (rbCapture.IsChecked == true)
            {
                VideoCapture1.Mode = VFVideoCaptureMode.IPCapture;

                VideoCapture1.Output_Filename = edOutput.Text;

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

                    break;
                }

                case 1:
                {
                    var mkvOutput = new VFMKVv1Output();
                    SetMKVOutput(ref mkvOutput);
                    VideoCapture1.Output_Format = mkvOutput;

                    break;
                }

                case 2:
                {
                    var wmvOutput = new VFWMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 3:
                {
                    var dvOutput = new VFDVOutput();
                    SetDVOutput(ref dvOutput);
                    VideoCapture1.Output_Format = dvOutput;

                    break;
                }

                case 4:
                {
                    var webmOutput = new VFWebMOutput();
                    SetWebMOutput(ref webmOutput);
                    VideoCapture1.Output_Format = webmOutput;

                    break;
                }

                case 5:
                {
                    var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                    SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                    VideoCapture1.Output_Format = ffmpegDLLOutput;

                    break;
                }

                case 6:
                {
                    var ffmpegOutput = new VFFFMPEGEXEOutput();
                    SetFFMPEGEXEOutput(ref ffmpegOutput);
                    VideoCapture1.Output_Format = ffmpegOutput;

                    break;
                }

                case 7:
                {
                    var mp4Output = new VFMP4v8v10Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 8:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

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

                    VideoCapture1.Output_Format = encOutput;

                    break;
                }

                case 11:
                {
                    var tsOutput = new VFMPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 12:
                {
                    var movOutput = new VFMOVOutput();
                    SetMOVOutput(ref movOutput);
                    VideoCapture1.Output_Format = movOutput;

                    break;
                }
                }
            }

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

            VideoCapture1.Start();

            tcMain.SelectedIndex = 3;
            tmRecording.Start();
        }
Esempio n. 17
0
        private void btStart_Click(object sender, RoutedEventArgs e)
        {
            VideoCapture1.Video_Sample_Grabber_Enabled = true;

            mmLog.Clear();

            VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true;
            VideoCapture1.Debug_Dir  =
                Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\";

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

            VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF;

            VideoCapture1.Video_CaptureDevice = cbVideoInputDevice.Text;
            VideoCapture1.Video_CaptureDevice_IsAudioSource = true;
            VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text;
            VideoCapture1.Audio_CaptureDevice_Format_UseBest = true;
            VideoCapture1.Video_CaptureFormat         = cbVideoInputFormat.Text;
            VideoCapture1.Video_CaptureFormat_UseBest = cbUseBestVideoInputFormat.IsChecked == true;

            if (cbFramerate.SelectedIndex != -1)
            {
                VideoCapture1.Video_FrameRate = (float)Convert.ToDouble(cbFramerate.Text);
            }

            if (rbPreview.IsChecked == true)
            {
                VideoCapture1.Mode = VFVideoCaptureMode.VideoPreview;
            }
            else
            {
                VideoCapture1.Mode            = VFVideoCaptureMode.VideoCapture;
                VideoCapture1.Output_Filename = edOutput.Text;


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

                    break;
                }

                case 1:
                {
                    var mkvOutput = new VFMKVv1Output();
                    SetMKVOutput(ref mkvOutput);
                    VideoCapture1.Output_Format = mkvOutput;

                    break;
                }

                case 2:
                {
                    var wmvOutput = new VFWMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 3:
                {
                    var dvOutput = new VFDVOutput();
                    SetDVOutput(ref dvOutput);
                    VideoCapture1.Output_Format = dvOutput;

                    break;
                }

                case 4:
                {
                    VideoCapture1.Output_Format = new VFDirectCaptureDVOutput();

                    break;
                }

                case 5:
                {
                    var webmOutput = new VFWebMOutput();
                    SetWebMOutput(ref webmOutput);
                    VideoCapture1.Output_Format = webmOutput;

                    break;
                }

                case 6:
                {
                    var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                    SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                    VideoCapture1.Output_Format = ffmpegDLLOutput;

                    break;
                }

                case 7:
                {
                    var ffmpegOutput = new VFFFMPEGEXEOutput();
                    SetFFMPEGEXEOutput(ref ffmpegOutput);
                    VideoCapture1.Output_Format = ffmpegOutput;

                    break;
                }

                case 8:
                {
                    var mp4Output = new VFMP4v8v10Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 9:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 10:
                {
                    var gifOutput = new VFAnimatedGIFOutput();
                    SetGIFOutput(ref gifOutput);

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

                case 11:
                {
                    var encOutput = new VFMP4v8v10Output();
                    SetMP4Output(ref encOutput);
                    encOutput.Encryption        = true;
                    encOutput.Encryption_Format = VFEncryptionFormat.MP4_H264_SW_AAC;

                    VideoCapture1.Output_Format = encOutput;

                    break;
                }

                case 12:
                {
                    var tsOutput = new VFMPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 13:
                {
                    var movOutput = new VFMOVOutput();
                    SetMOVOutput(ref movOutput);
                    VideoCapture1.Output_Format = movOutput;

                    break;
                }
                }
            }

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

            VideoCapture1.Start();

            tcMain.SelectedIndex = 3;
            tmRecording.Start();
        }
        private void btStart_Click(object sender, RoutedEventArgs e)
        {
            mmLog.Clear();

            VideoCapture1.Video_Sample_Grabber_Enabled = true;

            VideoCapture1.Debug_Mode = cbDebugMode.IsChecked == true;
            VideoCapture1.Debug_Dir  =
                Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\";

            // from screen
            VideoCapture1.Screen_Capture_Source = new ScreenCaptureSourceSettings();

            if (rbScreenCaptureWindow.IsChecked == true)
            {
                VideoCapture1.Screen_Capture_Source.Mode = VFScreenCaptureMode.Window;

                VideoCapture1.Screen_Capture_Source.WindowHandle = IntPtr.Zero;

                try
                {
                    VideoCapture1.Screen_Capture_Source.WindowHandle = FindWindow(edScreenCaptureWindowName.Text, null);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Unable to get window handle for screen capture. " + ex.Message);
                }

                if (VideoCapture1.Screen_Capture_Source.WindowHandle == IntPtr.Zero)
                {
                    MessageBox.Show("Incorrect window title for screen capture.");
                    return;
                }
            }
            else
            {
                VideoCapture1.Screen_Capture_Source.Mode = VFScreenCaptureMode.Screen;
            }

            VideoCapture1.Screen_Capture_Source.FrameRate       = (float)Convert.ToDouble(edScreenFrameRate.Text);
            VideoCapture1.Screen_Capture_Source.FullScreen      = rbScreenFullScreen.IsChecked == true;
            VideoCapture1.Screen_Capture_Source.Top             = Convert.ToInt32(edScreenTop.Text);
            VideoCapture1.Screen_Capture_Source.Bottom          = Convert.ToInt32(edScreenBottom.Text);
            VideoCapture1.Screen_Capture_Source.Left            = Convert.ToInt32(edScreenLeft.Text);
            VideoCapture1.Screen_Capture_Source.Right           = Convert.ToInt32(edScreenRight.Text);
            VideoCapture1.Screen_Capture_Source.GrabMouseCursor = cbScreenCapture_GrabMouseCursor.IsChecked == true;
            VideoCapture1.Screen_Capture_Source.DisplayIndex    = Convert.ToInt32(cbScreenCaptureDisplayIndex.Text);
            VideoCapture1.Screen_Capture_Source.AllowDesktopDuplicationEngine =
                cbScreenCapture_DesktopDuplication.IsChecked == true;

            if (cbRecordAudio.IsChecked == true)
            {
                VideoCapture1.Audio_RecordAudio = true;
                VideoCapture1.Audio_PlayAudio   = false;

                VideoCapture1.Audio_CaptureDevice        = 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 parameters
            VideoCapture1.Video_Renderer.Video_Renderer = VFVideoRendererWPF.WPF;

            VideoCapture1.Video_Effects_Enabled = true;
            VideoCapture1.Video_Effects_Clear();

            if (rbPreview.IsChecked == true)
            {
                VideoCapture1.Mode = VFVideoCaptureMode.ScreenPreview;
            }
            else
            {
                VideoCapture1.Mode = VFVideoCaptureMode.ScreenCapture;

                VideoCapture1.Output_Filename = edOutput.Text;
                switch (cbOutputFormat.SelectedIndex)
                {
                case 0:
                {
                    var aviOutput = new VFAVIOutput();
                    SetAVIOutput(ref aviOutput);
                    VideoCapture1.Output_Format = aviOutput;

                    break;
                }

                case 1:
                {
                    var mkvOutput = new VFMKVv1Output();
                    SetMKVOutput(ref mkvOutput);
                    VideoCapture1.Output_Format = mkvOutput;

                    break;
                }

                case 2:
                {
                    var wmvOutput = new VFWMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 3:
                {
                    var dvOutput = new VFDVOutput();
                    SetDVOutput(ref dvOutput);
                    VideoCapture1.Output_Format = dvOutput;

                    break;
                }

                case 4:
                {
                    var webmOutput = new VFWebMOutput();
                    SetWebMOutput(ref webmOutput);
                    VideoCapture1.Output_Format = webmOutput;

                    break;
                }

                case 5:
                {
                    var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                    SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                    VideoCapture1.Output_Format = ffmpegDLLOutput;

                    break;
                }

                case 6:
                {
                    var ffmpegOutput = new VFFFMPEGEXEOutput();
                    SetFFMPEGEXEOutput(ref ffmpegOutput);
                    VideoCapture1.Output_Format = ffmpegOutput;

                    break;
                }

                case 7:
                {
                    var mp4Output = new VFMP4v8v10Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 8:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

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

                    VideoCapture1.Output_Format = encOutput;

                    break;
                }

                case 11:
                {
                    var tsOutput = new VFMPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 12:
                {
                    var movOutput = new VFMOVOutput();
                    SetMOVOutput(ref movOutput);
                    VideoCapture1.Output_Format = movOutput;

                    break;
                }
                }
            }

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

            VideoCapture1.Start();

            tcMain.SelectedIndex = 3;
            tmRecording.Start();
        }
Esempio n. 19
0
        private async void btStart_Click(object sender, EventArgs e)
        {
#if !NETCOREAPP
            if (onvifControl != null)
            {
                onvifControl.Disconnect();
                onvifControl.Dispose();
                onvifControl = null;

                btONVIFConnect.Text = "Connect";
            }
#endif

            mmLog.Clear();

            VideoCapture1.Debug_Mode = cbDebugMode.Checked;
            VideoCapture1.Debug_Dir  = 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 = cbIPURL.Text
            };

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

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

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

            case 3:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_Live555;
                break;

            case 4:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.HTTP_FFMPEG;
                break;

            case 5:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.MMS_WMV;
                break;

            case 6:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_UDP_FFMPEG;
                break;

            case 7:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_TCP_FFMPEG;
                break;

            case 8:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_HTTP_FFMPEG;
                break;

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

            case 10:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_LowLatency;
                VideoCapture1.IP_Camera_Source.RTSP_LowLatency_UseUDP = false;
                break;

            case 11:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.RTSP_LowLatency;
                VideoCapture1.IP_Camera_Source.RTSP_LowLatency_UseUDP = true;
                break;

            case 12:
                VideoCapture1.IP_Camera_Source.Type = VFIPSource.NDI;
                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);

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

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

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

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

                    break;
                }

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

                    break;
                }

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

                    break;
                }

                case 3:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

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

                    break;
                }

                case 6:
                {
                    var movOutput = new VFMOVOutput();
                    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();
        }
Esempio n. 20
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  = 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 = VFVideoCaptureMode.DecklinkSourcePreview;
            }
            else
            {
                VideoCapture1.Mode            = VFVideoCaptureMode.DecklinkSourceCapture;
                VideoCapture1.Output_Filename = edOutput.Text;

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

                    break;
                }

                case 1:
                {
                    var mkvOutput = new VFMKVv1Output();
                    SetMKVOutput(ref mkvOutput);
                    VideoCapture1.Output_Format = mkvOutput;

                    break;
                }

                case 2:
                {
                    var wmvOutput = new VFWMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 3:
                {
                    var dvOutput = new VFDVOutput();
                    SetDVOutput(ref dvOutput);
                    VideoCapture1.Output_Format = dvOutput;

                    break;
                }

                case 4:
                {
                    var webmOutput = new VFWebMOutput();
                    SetWebMOutput(ref webmOutput);
                    VideoCapture1.Output_Format = webmOutput;

                    break;
                }

                case 5:
                {
                    var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                    SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                    VideoCapture1.Output_Format = ffmpegDLLOutput;

                    break;
                }

                case 6:
                {
                    var ffmpegOutput = new VFFFMPEGEXEOutput();
                    SetFFMPEGEXEOutput(ref ffmpegOutput);
                    VideoCapture1.Output_Format = ffmpegOutput;

                    break;
                }

                case 7:
                {
                    var mp4Output = new VFMP4v8v10Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 8:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

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

                    VideoCapture1.Output_Format = encOutput;

                    break;
                }

                case 11:
                {
                    var tsOutput = new VFMPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 12:
                {
                    var movOutput = new VFMOVOutput();
                    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, VFAudioEffectType.Amplify, cbAudAmplifyEnabled.Checked, TimeSpan.Zero, TimeSpan.Zero);

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 4;
            tmRecording.Start();
        }
Esempio n. 21
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  = 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 = VFPIPMode.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        = 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 = VFVideoCaptureMode.ScreenPreview;
            }
            else
            {
                VideoCapture1.Mode            = VFVideoCaptureMode.ScreenCapture;
                VideoCapture1.Output_Filename = edOutput.Text;

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

                    break;
                }

                case 1:
                {
                    var mkvOutput = new VFMKVv1Output();
                    SetMKVOutput(ref mkvOutput);
                    VideoCapture1.Output_Format = mkvOutput;

                    break;
                }

                case 2:
                {
                    var wmvOutput = new VFWMVOutput();
                    SetWMVOutput(ref wmvOutput);
                    VideoCapture1.Output_Format = wmvOutput;

                    break;
                }

                case 3:
                {
                    var dvOutput = new VFDVOutput();
                    SetDVOutput(ref dvOutput);
                    VideoCapture1.Output_Format = dvOutput;

                    break;
                }

                case 4:
                {
                    var webmOutput = new VFWebMOutput();
                    SetWebMOutput(ref webmOutput);
                    VideoCapture1.Output_Format = webmOutput;

                    break;
                }

                case 5:
                {
                    var ffmpegDLLOutput = new VFFFMPEGDLLOutput();
                    SetFFMPEGDLLOutput(ref ffmpegDLLOutput);
                    VideoCapture1.Output_Format = ffmpegDLLOutput;

                    break;
                }

                case 6:
                {
                    var ffmpegOutput = new VFFFMPEGEXEOutput();
                    SetFFMPEGEXEOutput(ref ffmpegOutput);
                    VideoCapture1.Output_Format = ffmpegOutput;

                    break;
                }

                case 7:
                {
                    var mp4Output = new VFMP4v8v10Output();
                    SetMP4Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

                case 8:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

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

                    VideoCapture1.Output_Format = encOutput;

                    break;
                }

                case 11:
                {
                    var tsOutput = new VFMPEGTSOutput();
                    SetMPEGTSOutput(ref tsOutput);
                    VideoCapture1.Output_Format = tsOutput;

                    break;
                }

                case 12:
                {
                    var movOutput = new VFMOVOutput();
                    SetMOVOutput(ref movOutput);
                    VideoCapture1.Output_Format = movOutput;

                    break;
                }
                }
            }

            await VideoCapture1.StartAsync();

            tcMain.SelectedIndex = 3;
            tmRecording.Start();
        }
Esempio n. 22
0
        private async void btStart_Click(object sender, EventArgs e)
        {
            VideoCapture1.Debug_Mode = cbDebugMode.Checked;
            VideoCapture1.Debug_Dir  =
                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 = VFVideoCaptureMode.PushSourcePreview;
            }
            else if (rbCapture.Checked)
            {
                VideoCapture1.Mode = VFVideoCaptureMode.PushSourceCapture;

                VideoCapture1.Output_Filename = edOutput.Text;

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

                    break;
                }

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

                    break;
                }

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

                    break;
                }

                case 3:
                {
                    var mp4Output = new VFMP4v11Output();
                    SetMP4v11Output(ref mp4Output);
                    VideoCapture1.Output_Format = mp4Output;

                    break;
                }

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

                    VideoCapture1.Output_Format = gifOutput;

                    break;
                }

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

                    break;
                }

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

                    break;
                }
                }
            }

            await VideoCapture1.StartAsync();

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

            await PushImagesAsync();
        }