Esempio n. 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            videoCaptureHelper = new VideoCapture();
            Text += " (SDK v" + videoCaptureHelper.SDK_Version + ", " + videoCaptureHelper.SDK_State + ")";

            foreach (var device in videoCaptureHelper.Video_CaptureDevicesInfo)
            {
                cbCamera1.Items.Add(device.Name);
                cbCamera2.Items.Add(device.Name);
            }

            if (cbCamera1.Items.Count > 0)
            {
                cbCamera1.SelectedIndex = 0;
                cbCamera2.SelectedIndex = 0;
            }

            edFilename.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\"
                              + "multiple_video_streams.wmv";

            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;
            }
        }
Esempio n. 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")";

            tmRecording.Elapsed += (senderx, args) =>
            {
                UpdateRecordingTime();
            };

            edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" +
                            "output.mp4";

            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;
            }

            cbOutputFormat.SelectedIndex = 7;
        }
Esempio n. 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text += " (SDK v" + videoCapture2.SDK_Version + ", " + videoCapture2.SDK_State + ")";

            tmRecording1.Elapsed += (senderx, args) =>
            {
                UpdateRecordingTime1();
            };

            tmRecording2.Elapsed += (senderx, args) =>
            {
                UpdateRecordingTime2();
            };

            if (VideoCapture.Filter_Supported_EVR())
            {
                videoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR;
                videoCapture2.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR;
            }
            else if (VideoCapture.Filter_Supported_VMR9())
            {
                videoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9;
                videoCapture2.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR;
            }
            else
            {
                videoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer;
                videoCapture2.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR;
            }
        }
Esempio n. 4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text += " (SDK v" + videoCapture1.SDK_Version + ", " + videoCapture1.SDK_State + ")";

            foreach (var device in videoCapture1.Video_CaptureDevicesInfo)
            {
                cbCamera1.Items.Add(device.Name);
                cbCamera2.Items.Add(device.Name);
            }

            if (cbCamera1.Items.Count > 0)
            {
                cbCamera1.SelectedIndex = 0;
                cbCamera2.SelectedIndex = 0;
            }

            if (VideoCapture.Filter_Supported_EVR())
            {
                videoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR;
                videoCapture2.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR;
            }
            else if (VideoCapture.Filter_Supported_VMR9())
            {
                videoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9;
                videoCapture2.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9;
            }
            else
            {
                videoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer;
                videoCapture2.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer;
            }
        }
Esempio n. 5
0
        private async void btStart_Click(object sender, EventArgs e)
        {
            mmError.Clear();

            MediaPlayer1.FilenamesOrURL.Add(edFilename.Text);
            MediaPlayer1.Loop            = cbLoop.Checked;
            MediaPlayer1.Audio_PlayAudio = true;

            MediaPlayer1.Source_Mode = VFMediaPlayerSource.DVD_DS;

            // read DVD info
            cbDVDControlTitle.Items.Clear();
            cbDVDControlChapter.Items.Clear();
            cbDVDControlAudio.Items.Clear();
            cbDVDControlSubtitles.Items.Clear();

            MediaInfo.Filename = edFilename.Text;
            MediaInfo.ReadDVDInfo();

            for (int i = 0; i < MediaInfo.DVD_Disc_NumOfTitles; i++)
            {
                cbDVDControlTitle.Items.Add("Title " + (i + 1));
            }

            MediaPlayer1.Audio_OutputDevice = "Default DirectSound Device";

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

            MediaPlayer1.Debug_Mode = cbDebugMode.Checked;

            await MediaPlayer1.PlayAsync();

            // DVD
            // select and play first title
            if (cbDVDControlTitle.Items.Count > 0)
            {
                cbDVDControlTitle.SelectedIndex = 0;
                cbDVDControlTitle_SelectedIndexChanged(null, null);
            }

            // show title menu
            MediaPlayer1.DVD_Menu_Show(VFDVDMenu.Title);

            MediaPlayer1.Audio_OutputDevice_Balance_Set(0, tbBalance1.Value);
            MediaPlayer1.Audio_OutputDevice_Volume_Set(0, tbVolume1.Value);

            timer1.Enabled = true;
        }
Esempio n. 6
0
        private void btStart_Click(object sender, EventArgs e)
        {
            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;
            }

            kinect.SensorID          = cbKinectDevice.SelectedIndex;
            kinect.Video_Format      = (VFKinectVideoFormat)cbVideoSourceFormat.SelectedIndex;
            kinect.Video_DepthFormat = (VFKinectDepthFormat)cbDepthSourceFormat.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 = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.mp4";

                var mp4Output = new VFMP4Output();
                ApplyMP4Settings(ref mp4Output);
                VideoCapture1.Output_Format = mp4Output;
            }

            VideoCapture1.Audio_PlayAudio = false;

            kinect.Gestures_Recognizer_Enabled = cbDetectGestures.Checked;

            edGestures.Text = string.Empty;

            kinect.Init(VideoCapture1.Core);
            kinect.Start();
        }
Esempio n. 7
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")";

            foreach (string codec in VideoCapture1.Video_Codecs)
            {
                cbVideoCodecs.Items.Add(codec);
            }

            if (cbVideoCodecs.Items.Count > 0)
            {
                cbVideoCodecs.SelectedIndex = 0;
                cbVideoCodecs_SelectedIndexChanged(null, null);
            }

            foreach (string codec in VideoCapture1.Audio_Codecs)
            {
                cbAudioCodecs.Items.Add(codec);
            }

            if (cbAudioCodecs.Items.Count > 0)
            {
                cbAudioCodecs.SelectedIndex = 0;
                cbAudioCodecs_SelectedIndexChanged(null, null);
            }

            if (cbVideoCodecs.Items.IndexOf("MJPEG Compressor") != -1)
            {
                cbVideoCodecs.SelectedIndex = cbVideoCodecs.Items.IndexOf("MJPEG Compressor");
            }

            if (cbAudioCodecs.Items.IndexOf("PCM") != -1)
            {
                cbAudioCodecs.SelectedIndex = cbAudioCodecs.Items.IndexOf("PCM");
            }

            cbChannels.SelectedIndex   = 1;
            cbBPS.SelectedIndex        = 1;
            cbSampleRate.SelectedIndex = 0;

            edOutputAVI.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.avi";
            edOutputMP4.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.mp4";

            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;
            }
        }
Esempio n. 8
0
        private void btStart_Click(object sender, EventArgs e)
        {
            if (rbSTreamTypeFile.Checked)
            {
                FileStream     fs     = new FileStream(edFilename.Text, FileMode.Open);
                ManagedIStream stream = new ManagedIStream(fs);

                // specifing settings
                // MediaPlayer1.Source_Mode = VFMediaPlayerSource.Memory_DS;
                MediaPlayer1.Source_Stream      = stream;
                MediaPlayer1.Source_Stream_Size = fs.Length;
            }
            else
            {
                byte[]       source = File.ReadAllBytes(edFilename.Text);
                MemoryStream ms     = new MemoryStream(source);

                ManagedIStream stream = new ManagedIStream(ms);

                // specifing settings
                // MediaPlayer1.Source_Mode = VFMediaPlayerSource.Memory_DS;
                MediaPlayer1.Source_Stream      = stream;
                MediaPlayer1.Source_Stream_Size = ms.Length;
            }

            // video and audio present in file. tune this settings to play audio files or video files without audio
            MediaPlayer1.Source_Stream_VideoPresent = true;
            MediaPlayer1.Source_Stream_AudioPresent = true;

            MediaPlayer1.Source_Mode = VFMediaPlayerSource.Memory_DS;

            MediaPlayer1.Audio_OutputDevice = "Default DirectSound Device";

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

            MediaPlayer1.Debug_Mode = cbDebugMode.Checked;
            MediaPlayer1.Play();

            tbTimeline.Maximum = (int)(MediaPlayer1.Duration_Time() / 1000);
            timer1.Enabled     = true;
        }
Esempio n. 9
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")";

            tmRecording.Elapsed += (senderx, args) =>
            {
                UpdateRecordingTime();
            };

            foreach (var device in VideoCapture1.Audio_CaptureDevicesInfo)
            {
                cbAudioInputDevice.Items.Add(device.Name);
            }

            if (cbAudioInputDevice.Items.Count > 0)
            {
                cbAudioInputDevice.SelectedIndex = 0;
                cbAudioInputDevice_SelectedIndexChanged(null, null);
            }

            foreach (var screen in Screen.AllScreens)
            {
                cbScreenCaptureDisplayIndex.Items.Add(screen.DeviceName.Replace(@"\\.\DISPLAY", string.Empty));
            }

            cbScreenCaptureDisplayIndex.Items.Add("All (fullscreen)");
            cbScreenCaptureDisplayIndex.SelectedIndex = 0;

            cbOutputFormat.SelectedIndex = 7;

            edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.mp4";

            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;
            }
        }
Esempio n. 10
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")";

            edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.avi";

            foreach (var device in VideoCapture1.Video_CaptureDevicesInfo)
            {
                cbVideoInputDevice.Items.Add(device.Name);
            }

            if (cbVideoInputDevice.Items.Count > 0)
            {
                cbVideoInputDevice.SelectedIndex = 0;
                cbVideoInputDevice_SelectedIndexChanged(null, null);
            }

            foreach (var device in VideoCapture1.Audio_CaptureDevicesInfo)
            {
                cbAudioInputDevice.Items.Add(device.Name);
            }

            if (cbAudioInputDevice.Items.Count > 0)
            {
                cbAudioInputDevice.SelectedIndex = 0;
                cbAudioInputDevice_SelectedIndexChanged(null, null);
            }

            cbOutputFormat.SelectedIndex = 0;

            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;
            }
        }
Esempio n. 11
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text += " (SDK v" + videoCapture2.SDK_Version + ", " + videoCapture2.SDK_State + ")";

            if (VideoCapture.Filter_Supported_EVR())
            {
                videoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR;
                videoCapture2.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR;
            }
            else if (VideoCapture.Filter_Supported_VMR9())
            {
                videoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VMR9;
                videoCapture2.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR;
            }
            else
            {
                videoCapture1.Video_Renderer.Video_Renderer = VFVideoRenderer.VideoRenderer;
                videoCapture2.Video_Renderer.Video_Renderer = VFVideoRenderer.EVR;
            }
        }
Esempio n. 12
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")";

            edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.mp4";


            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;
            }
        }
Esempio n. 13
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + "), C#";

            cbDecklinkSourceInput.SelectedIndex           = 0;
            cbDecklinkSourceNTSC.SelectedIndex            = 0;
            cbDecklinkSourceComponentLevels.SelectedIndex = 0;
            cbDecklinkSourceTimecode.SelectedIndex        = 0;

            cbOutputFormat.SelectedIndex = 7;

            edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.mp4";

            tmRecording.Elapsed += (senderx, args) =>
            {
                UpdateRecordingTime();
            };

            string defaultAudioRenderer = string.Empty;

            foreach (string audioOutputDevice in VideoCapture1.Audio_OutputDevices)
            {
                cbAudioOutputDevice.Items.Add(audioOutputDevice);

                if (audioOutputDevice.Contains("Default DirectSound Device"))
                {
                    defaultAudioRenderer = audioOutputDevice;
                }
            }

            if (cbAudioOutputDevice.Items.Count > 0)
            {
                if (string.IsNullOrEmpty(defaultAudioRenderer))
                {
                    cbAudioOutputDevice.SelectedIndex = 0;
                }
                else
                {
                    cbAudioOutputDevice.Text = defaultAudioRenderer;
                }
            }

            foreach (var device in VideoCapture1.Decklink_CaptureDevices)
            {
                cbDecklinkCaptureDevice.Items.Add(device.Name);
            }

            if (cbDecklinkCaptureDevice.Items.Count > 0)
            {
                cbDecklinkCaptureDevice.SelectedIndex = 0;
                cbDecklinkCaptureDevice_SelectedIndexChanged(null, null);
            }

            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;
            }
        }
Esempio n. 14
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")";

            tmRecording.Elapsed += (senderx, args) =>
            {
                UpdateRecordingTime();
            };

            cbOutputFormat.SelectedIndex = 7;

            foreach (var device in VideoCapture1.Video_CaptureDevicesInfo)
            {
                cbVideoInputDevice.Items.Add(device.Name);
            }

            if (cbVideoInputDevice.Items.Count > 0)
            {
                cbVideoInputDevice.SelectedIndex = 0;
            }

            cbVideoInputDevice_SelectedIndexChanged(null, null);

            foreach (var device in VideoCapture1.Audio_CaptureDevicesInfo)
            {
                cbAudioInputDevice.Items.Add(device.Name);
            }

            if (cbAudioInputDevice.Items.Count > 0)
            {
                cbAudioInputDevice.SelectedIndex = 0;
                cbAudioInputDevice_SelectedIndexChanged(null, null);
            }

            cbAudioInputLine.Items.Clear();

            if (!string.IsNullOrEmpty(cbAudioInputDevice.Text))
            {
                var deviceItem =
                    VideoCapture1.Audio_CaptureDevicesInfo.First(device => device.Name == cbAudioInputDevice.Text);
                if (deviceItem != null)
                {
                    foreach (string line in deviceItem.Lines)
                    {
                        cbAudioInputLine.Items.Add(line);
                    }

                    if (cbAudioInputLine.Items.Count > 0)
                    {
                        cbAudioInputLine.SelectedIndex = 0;
                        cbAudioInputLine_SelectedIndexChanged(null, null);
                        cbAudioInputFormat_SelectedIndexChanged(null, null);
                    }
                }
            }

            string defaultAudioRenderer = string.Empty;

            foreach (string audioOutputDevice in VideoCapture1.Audio_OutputDevices)
            {
                cbAudioOutputDevice.Items.Add(audioOutputDevice);

                if (audioOutputDevice.Contains("Default DirectSound Device"))
                {
                    defaultAudioRenderer = audioOutputDevice;
                }
            }

            if (cbAudioOutputDevice.Items.Count > 0)
            {
                if (string.IsNullOrEmpty(defaultAudioRenderer))
                {
                    cbAudioOutputDevice.SelectedIndex = 0;
                }
                else
                {
                    cbAudioOutputDevice.Text = defaultAudioRenderer;
                }
            }

            foreach (string preset in VideoCapture1.Audio_Effects_Equalizer_Presets())
            {
                cbAudEqualizerPreset.Items.Add(preset);
            }

            edOutput.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.mp4";

            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;
            }
        }
Esempio n. 15
0
        private void btStart_Click(object sender, EventArgs e)
        {
            if (onvifControl != null)
            {
                onvifControl.Disconnect();
                onvifControl.Dispose();
                onvifControl = null;

                btONVIFConnect.Text = "Connect";
            }

            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.Audio_RecordAudio = true;
            VideoCapture1.Audio_PlayAudio   = true;

            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.Video_Sample_Grabber_Enabled = true;

            // 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;
            }

            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 (rbCaptureAVI.Checked)
            {
                VideoCapture1.Mode = VFVideoCaptureMode.IPCapture;

                VideoCapture1.Output_Filename = edOutputAVI.Text;

                var aviOutput = new VFAVIOutput
                {
                    ACM =
                    {
                        Name       = this.cbAudioCodecs.Text,
                        Channels   = Convert.ToInt32(this.cbChannels.Text),
                        BPS        = Convert.ToInt32(this.cbBPS.Text),
                        SampleRate = Convert.ToInt32(this.cbSampleRate.Text)
                    },
                    Video_Codec = this.cbVideoCodecs.Text
                };

                VideoCapture1.Output_Format = aviOutput;
            }
            else
            {
                VideoCapture1.Mode = VFVideoCaptureMode.IPCapture;

                VideoCapture1.Output_Filename = edOutputMP4.Text;

                var mp4Output = new VFMP4Output();

                if (IsWindows7OrNewer())
                {
                    mp4Output.MP4Mode = VFMP4Mode.v10;
                }
                else
                {
                    mp4Output.MP4Mode = VFMP4Mode.v8;
                }

                VideoCapture1.Output_Format = mp4Output;
            }

            VideoCapture1.Start();
        }
Esempio n. 16
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\\";

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

            // apply capture parameters
            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.Video_CaptureDevice = cbVideoInputDevice.Text;
            VideoCapture1.Video_CaptureDevice_IsAudioSource = true;
            VideoCapture1.Audio_OutputDevice = cbAudioOutputDevice.Text;
            VideoCapture1.Audio_CaptureDevice_Format_UseBest = true;
            VideoCapture1.Video_CaptureDevice_Format         = cbVideoInputFormat.Text;
            VideoCapture1.Video_CaptureDevice_Format_UseBest = cbUseBestVideoInputFormat.Checked;

            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:
                {
                    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();
        }
Esempio n. 17
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")";

            foreach (string codec in VideoCapture1.Video_Codecs)
            {
                cbVideoCodecs.Items.Add(codec);
            }

            if (cbVideoCodecs.Items.Count > 0)
            {
                cbVideoCodecs.SelectedIndex = 0;
                cbVideoCodecs_SelectedIndexChanged(null, null);
            }

            foreach (string codec in VideoCapture1.Audio_Codecs)
            {
                cbAudioCodecs.Items.Add(codec);
            }

            if (cbAudioCodecs.Items.Count > 0)
            {
                cbAudioCodecs.SelectedIndex = 0;
                cbAudioCodecs_SelectedIndexChanged(null, null);
            }

            if (cbVideoCodecs.Items.IndexOf("MJPEG Compressor") != -1)
            {
                cbVideoCodecs.SelectedIndex = cbVideoCodecs.Items.IndexOf("MJPEG Compressor");
            }

            if (cbAudioCodecs.Items.IndexOf("PCM") != -1)
            {
                cbAudioCodecs.SelectedIndex = cbAudioCodecs.Items.IndexOf("PCM");
            }

            foreach (var device in VideoCapture1.Audio_CaptureDevicesInfo)
            {
                cbAudioInputDevice.Items.Add(device.Name);
            }

            if (cbAudioInputDevice.Items.Count > 0)
            {
                cbAudioInputDevice.SelectedIndex = 0;
                cbAudioInputDevice_SelectedIndexChanged(null, null);
            }

            foreach (string profile in VideoCapture1.WMV_Internal_Profiles())
            {
                cbWMVInternalProfile9.Items.Add(profile);
            }

            if (cbWMVInternalProfile9.Items.Count > 0)
            {
                cbWMVInternalProfile9.SelectedIndex = 0;
            }

            foreach (var screen in Screen.AllScreens)
            {
                cbScreenCaptureDisplayIndex.Items.Add(screen.DeviceName.Replace(@"\\.\DISPLAY", string.Empty));
            }

            cbScreenCaptureDisplayIndex.SelectedIndex = 0;

            cbChannels.SelectedIndex   = 1;
            cbBPS.SelectedIndex        = 1;
            cbSampleRate.SelectedIndex = 0;
            cbImageType.SelectedIndex  = 1;
            cbMode.SelectedIndex       = 0;

            cbH264Profile.SelectedIndex     = 2;
            cbH264Level.SelectedIndex       = 0;
            cbH264RateControl.SelectedIndex = 1;
            cbAACOutput.SelectedIndex       = 0;
            cbAACVersion.SelectedIndex      = 0;
            cbAACObjectType.SelectedIndex   = 1;
            cbAACBitrate.SelectedIndex      = 12;
            cbH264TargetUsage.SelectedIndex = 3;

            edOutput.Text            = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.avi";
            edScreenshotsFolder.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\";

            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;
            }
        }
Esempio n. 18
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. 19
0
        private void btStart_Click(object sender, EventArgs e)
        {
            if (onvifControl != null)
            {
                onvifControl.Disconnect();
                onvifControl.Dispose();
                onvifControl = null;

                btONVIFConnect.Text = "Connect";
            }

            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.Audio_RecordAudio = true;
            VideoCapture1.Audio_PlayAudio   = true;

            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.Video_Sample_Grabber_Enabled = true;

            // 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;
            }

            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 (rbCaptureAVI.Checked)
            {
                VideoCapture1.Mode = VFVideoCaptureMode.IPCapture;

                VideoCapture1.Output_Filename = edOutputAVI.Text;

                var aviOutput = new VFAVIOutput
                {
                    ACM =
                    {
                        Name       = this.cbAudioCodecs.Text,
                        Channels   = Convert.ToInt32(this.cbChannels.Text),
                        BPS        = Convert.ToInt32(this.cbBPS.Text),
                        SampleRate = Convert.ToInt32(this.cbSampleRate.Text)
                    },
                    Video_Codec = this.cbVideoCodecs.Text
                };

                VideoCapture1.Output_Format = aviOutput;
            }
            else
            {
                VideoCapture1.Mode = VFVideoCaptureMode.IPCapture;

                VideoCapture1.Output_Filename = edOutputMP4.Text;

                var mp4Output = new VFMP4Output();

                // Main settings
                mp4Output.MP4Mode = VFMP4Mode.v10;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                mp4Output.Video_H264.PictureType = VFH264PictureType.Auto;

                mp4Output.Video_H264.RateControl = (VFH264RateControl)cbH264RateControl.SelectedIndex;
                mp4Output.Video_H264.GOP         = cbH264GOP.Checked;
                mp4Output.Video_H264.BitrateAuto = cbH264AutoBitrate.Checked;

                int tmp;
                int.TryParse(edH264Bitrate.Text, out tmp);
                mp4Output.Video_H264.Bitrate = tmp;

                // 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);

                VideoCapture1.Output_Format = mp4Output;
            }

            VideoCapture1.Start();
        }
Esempio n. 20
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Text += " (SDK v" + VideoCapture1.SDK_Version + ", " + VideoCapture1.SDK_State + ")";

            foreach (string codec in VideoCapture1.Video_Codecs)
            {
                cbVideoCodecs.Items.Add(codec);
            }

            if (cbVideoCodecs.Items.Count > 0)
            {
                cbVideoCodecs.SelectedIndex = 0;
                cbVideoCodecs_SelectedIndexChanged(null, null);
            }

            foreach (string codec in VideoCapture1.Audio_Codecs)
            {
                cbAudioCodecs.Items.Add(codec);
            }

            if (cbAudioCodecs.Items.Count > 0)
            {
                cbAudioCodecs.SelectedIndex = 0;
                cbAudioCodecs_SelectedIndexChanged(null, null);
            }

            if (cbVideoCodecs.Items.IndexOf("MJPEG Compressor") != -1)
            {
                cbVideoCodecs.SelectedIndex = cbVideoCodecs.Items.IndexOf("MJPEG Compressor");
            }

            if (cbAudioCodecs.Items.IndexOf("PCM") != -1)
            {
                cbAudioCodecs.SelectedIndex = cbAudioCodecs.Items.IndexOf("PCM");
            }

            foreach (string profile in VideoCapture1.WMV_Internal_Profiles())
            {
                cbWMVInternalProfile9.Items.Add(profile);
            }

            if (cbWMVInternalProfile9.Items.Count > 0)
            {
                cbWMVInternalProfile9.SelectedIndex = 0;
            }

            foreach (var device in VideoCapture1.Video_CaptureDevicesInfo)
            {
                cbVideoInputDevice.Items.Add(device.Name);
            }

            if (cbVideoInputDevice.Items.Count > 0)
            {
                cbVideoInputDevice.SelectedIndex = 0;
            }

            cbVideoInputDevice_SelectedIndexChanged(null, null);

            foreach (var device in VideoCapture1.Audio_CaptureDevicesInfo)
            {
                cbAudioInputDevice.Items.Add(device.Name);
            }

            if (cbAudioInputDevice.Items.Count > 0)
            {
                cbAudioInputDevice.SelectedIndex = 0;
                cbAudioInputDevice_SelectedIndexChanged(null, null);
            }

            cbAudioInputLine.Items.Clear();

            if (!string.IsNullOrEmpty(cbAudioInputDevice.Text))
            {
                var deviceItem =
                    VideoCapture1.Audio_CaptureDevicesInfo.First(device => device.Name == cbAudioInputDevice.Text);
                if (deviceItem != null)
                {
                    foreach (string line in deviceItem.Lines)
                    {
                        cbAudioInputLine.Items.Add(line);
                    }

                    if (cbAudioInputLine.Items.Count > 0)
                    {
                        cbAudioInputLine.SelectedIndex = 0;
                        cbAudioInputLine_SelectedIndexChanged(null, null);
                        cbAudioInputFormat_SelectedIndexChanged(null, null);
                    }
                }
            }

            foreach (string audioOutputDevice in VideoCapture1.Audio_OutputDevices)
            {
                cbAudioOutputDevice.Items.Add(audioOutputDevice);
            }

            if (cbAudioOutputDevice.Items.Count > 0)
            {
                cbAudioOutputDevice.SelectedIndex = 0;
            }

            foreach (string preset in VideoCapture1.Audio_Effects_Equalizer_Presets())
            {
                cbAudEqualizerPreset.Items.Add(preset);
            }

            cbChannels.SelectedIndex   = 1;
            cbBPS.SelectedIndex        = 1;
            cbSampleRate.SelectedIndex = 0;
            cbImageType.SelectedIndex  = 1;
            cbMode.SelectedIndex       = 0;

            edScreenshotsFolder.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VisioForge\";
            edOutput.Text            = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\VisioForge\\" + "output.avi";

            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;
            }
        }
Esempio n. 21
0
        private 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.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 = cbIPAudioCapture.Checked;
            VideoCapture1.Audio_PlayAudio   = cbIPAudioCapture.Checked;

            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.Video_Sample_Grabber_Enabled = true;

            // 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:
            {
                // 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;
            }

            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 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. 22
0
        private async void btStart_Click(object sender, EventArgs e)
        {
            mmError.Text = string.Empty;

            if (rbSTreamTypeFile.Checked)
            {
                _fileStream = new FileStream(edFilename.Text, FileMode.Open);
                _stream     = new ManagedIStream(_fileStream);

                // specifying settings
                MediaPlayer1.Source_Stream      = _stream;
                MediaPlayer1.Source_Stream_Size = _fileStream.Length;
            }
            else
            {
                _memorySource = File.ReadAllBytes(edFilename.Text);
                _memoryStream = new MemoryStream(_memorySource);
                _stream       = new ManagedIStream(_memoryStream);

                // specifying settings
                MediaPlayer1.Source_Stream      = _stream;
                MediaPlayer1.Source_Stream_Size = _memoryStream.Length;
            }

            // video and audio present in file. tune this settings to play audio files or video files without audio
            if (rbVideoWithAudio.Checked)
            {
                MediaPlayer1.Source_Stream_VideoPresent = true;
                MediaPlayer1.Source_Stream_AudioPresent = true;
            }
            else if (rbVideoWithoutAudio.Checked)
            {
                MediaPlayer1.Source_Stream_VideoPresent = true;
                MediaPlayer1.Source_Stream_AudioPresent = false;
            }
            else
            {
                MediaPlayer1.Source_Stream_VideoPresent = false;
                MediaPlayer1.Source_Stream_AudioPresent = true;
            }

            MediaPlayer1.Source_Mode = VFMediaPlayerSource.Memory_DS;

            MediaPlayer1.Audio_OutputDevice = "Default DirectSound Device";

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

            MediaPlayer1.Debug_Mode = cbDebugMode.Checked;
            await MediaPlayer1.PlayAsync();

            tbTimeline.Maximum = (int)MediaPlayer1.Duration_Time().TotalSeconds;
            timer1.Enabled     = true;
        }