private void combutton1_Click(object sender, EventArgs e) { //输入 _camera = IPCameraFactory.GetCamera("rtsp://192.168.113.150:554/ufirststream", "root", "pass"); _connector.Connect(_camera.VideoChannel, _imageProvider); _camera.Start(); _videoViewerWF1.Start(); }
// Connect camera video channel to image provider and start private void connectBtn_Click(object sender, EventArgs e) { _camera = IPCameraFactory.GetCamera("192.168.115.98:8080", "admin", "admin"); _connector.Connect(_camera.VideoChannel, _imageProvider); _camera.Start(); _videoViewerWF1.Start(); }
public Bitmap GetImage(string streamUrl) { Bitmap bitmap = new Bitmap(1280, 720); MediaConnector mediaConnector = new MediaConnector(); DrawingImageProvider imageProvider = new DrawingImageProvider(); IIPCamera _camera = IPCameraFactory.GetCamera(streamUrl, "root", "pass"); mediaConnector.Connect(_camera.VideoChannel, imageProvider); _camera.Start(); VideoViewerWF video = new VideoViewerWF(); video.SetImageProvider(imageProvider); video.Name = "videoViewerWF1"; video.Size = new Size(300, 300); video.Start(); Thread.Sleep(10000); try { video.DrawToBitmap(bitmap, new System.Drawing.Rectangle() { Height = 720, Width = 1280 }); } catch (Exception ex) { } finally { video.Stop(); _camera.Stop(); } return(bitmap); }
// Connect camera video channel to image provider and start private void connectBtn_Click(object sender, EventArgs e) { _camera = IPCameraFactory.GetCamera("rtsp://192.168.1.102//live/ch00_1", "root", "pass"); _connector.Connect(_camera.VideoChannel, _imageProvider); _camera.Start(); _videoViewerWF1.Start(); }
// Connect camera video channel to image provider and start private void connectBtn_Click(object sender, EventArgs e) { _camera = IPCameraFactory.GetCamera("rtsp://" + textEdit1.Text + ":554/ufirststream", textEdit2.Text, textEdit3.Text); _connector.Connect(_camera.VideoChannel, _imageProvider); _camera.Start(); _videoViewerWF1.Start(); }
private void button_Connect_Click(object sender, EventArgs e) { _camera = IPCameraFactory.GetCamera("192.168.115.175:8080", "admin", "admin"); _connector.Connect(_camera.VideoChannel, _imageProvider); _videoViewerWf.SetImageProvider(_imageProvider); _videoViewerWf.Start(); _camera.Start(); }
public static void ConnectUSBCamera() { _mediaConnector.Connect(_webCamera, _imageProvider); _videoViewer.SetImageProvider(_imageProvider); _mediaConnector.Connect(_webCamera, _snapshotHandler); _webCamera.Start(); _videoViewer.Start(); timAnimation.Enabled = true; }
private void buttonOzeki_Click(object sender, EventArgs e) { _camera = IPCameraFactory.GetCamera("rtsp://192.168.42.1/live", "", ""); _connector.Connect(_camera.VideoChannel, _imageProvider); _connector.Connect(_camera.VideoChannel, _snapshotHandler); _videoViewerWF1.SetImageProvider(_imageProvider); _videoViewerWF1.Start(); buttonOzeki.BackgroundImage = GUI_KRTI_BismillahNyoba.Properties.Resources.icons8_wi_fi_filled_50; _camera.Start(); }
private void start_button_Click(object sender, EventArgs e) { try { if (mjpegConnection != null) { mjpegConnection.Disconnect(); } if (!mjpegConnection.Connect("http://" + vclient_ipaddress + ":" + client_videoport, 100000)) { MessageBox.Show("Connection failed - mjpegConnection."); } if (!vconnector.Connect(mjpegConnection.VideoChannel, zoom)) { MessageBox.Show("Connection failed - connector zoom."); } if (!vconnector.Connect(zoom, vprovider)) { MessageBox.Show("Connection failed - connector provider."); } vvideoViewer.Start(); groupBox.Controls.Add(vvideoViewer); //client if (!this.connected) { IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse(vclient_ipaddress), int.Parse(client_auport)); this.codec = new AcmMuLawChatCodec(); this.ClientConnect(endPoint, codec); } else { this.ClientDisconnect(); } start_button.Enabled = false; close_button.Enabled = true; } catch (Exception ex) { lblStatus.Text = ex.ToString() + "\n" + lblStatus.Text; } }
private void connectBtn_Click(object sender, EventArgs e) { _webCamera = new WebCamera(); if (_webCamera != null) { _mediaConnector.Connect(_webCamera.VideoChannel, _imageProvider); _videoViewer.SetImageProvider(_imageProvider); _webCamera.Start(); _videoViewer.Start(); } }
public bool Connect(string DVRIPAddress, ushort DVRPortNumber, string DVRUserName, string DVRPassword) { _videoViewerWF1 = new VideoViewerWF(); _videoViewerWF1.Name = "OnvifPreview"; _videoViewerWF1.Size = VideoPanel.Size; VideoPanel.Controls.Add(_videoViewerWF1); _videoViewerWF1.SetImageProvider(_imageProvider); _camera = IPCameraFactory.GetCamera(string.Format("{0}:{1}", DVRIPAddress, DVRPortNumber.ToString()), DVRUserName, DVRPassword); _connector.Connect(_camera.VideoChannel, _imageProvider); _camera.Start(); _videoViewerWF1.Start(); return(true); }
public void ShowFormCall() { Form form = new Form(); form.Text = "cuộc gọi video"; form.Size = new Size(800, 500); form.BackColor = Color.White; form.FormBorderStyle = FormBorderStyle.FixedSingle; form.FormClosing += Form_FormClosing; Button closeCamera = new Button(); closeCamera.Location = new Point(655, 200); closeCamera.Size = new Size(125, 25); closeCamera.Text = "Tắt camera"; closeCamera.Click += CloseCamera_Click; Button hangUp = new Button(); hangUp.Location = new Point(655, 235); hangUp.Size = new Size(125, 25); hangUp.Text = "Tắt máy"; hangUp.Click += HangUp_Click; _lbTime = new Label(); _lbTime.Location = new Point(710, 325); _lbTime.Text = "Đang gọi ... "; VideoViewerWF remoteViewer = new VideoViewerWF(); remoteViewer.Location = new Point(0, 0); remoteViewer.Size = new Size(650, 500); remoteViewer.SetImageProvider(remoteProvider); remoteViewer.Start(); VideoViewerWF localViewer = new VideoViewerWF(); localViewer.Location = new Point(655, 350); localViewer.Size = new Size(150, 150); localViewer.SetImageProvider(Instance.LocalProvider[Instance.LocalProvider.Count - 1]); localViewer.Start(); form.Controls.Add(_lbTime); form.Controls.Add(hangUp); form.Controls.Add(closeCamera); form.Controls.Add(remoteViewer); form.Controls.Add(localViewer); form.ShowDialog(); IsShowFormCall = true; }
private void InitViewer() { _remoteViewer = new VideoViewerWF();; _remoteViewer.Location = new Point(0, 0); _remoteViewer.Size = _flpRemoteVideo.Size; _remoteViewer.SetImageProvider(_remoteProvider); _localViewer = new VideoViewerWF(); _localViewer.Location = new Point(0, 0); _localViewer.Size = _panelLocalVideo.Size; _localViewer.SetImageProvider(_localProvider); _panelLocalVideo.Controls.Add(_localViewer); _flpRemoteVideo.Controls.Add(_remoteViewer); _remoteViewer.Start(); _localViewer.Start(); }
public void Connect(string Domain, string userName, string Password) { if (_camera != null) { _camera.CameraStateChanged -= _CameraStateChanged; _camera.Disconnect(); _mediaConnector.Disconnect(_camera.VideoChannel, _Imageprovider); _camera.Dispose(); _camera = null; } //_camera = IPCameraFactory.GetCamera("192.168.7.37:80", "admin", "12345hik"); _camera = IPCameraFactory.GetCamera(Domain, userName, Password); //stateCamera _camera.CameraStateChanged += _CameraStateChanged; _mediaConnector.Connect(_camera.VideoChannel, _Imageprovider); //_connector.Connect(_camera.VideoChannel, _snapShot); _camera.Start(); _videoViewer.Start(); }
public void ShowUI() { Form form = new Form(); form.Size = new Size(1080, 490); form.FormBorderStyle = FormBorderStyle.FixedSingle; form.Text = "Video trực tiếp"; VideoViewerWF videoViewer = new VideoViewerWF(); videoViewer.Location = new Point(0, 0); videoViewer.Size = new Size(800, 450); videoViewer.SetImageProvider(provider); videoViewer.Start(); form.Controls.Add(videoViewer); CommentBoxControl commentControls = new CommentBoxControl(); commentControls.Location = new Point(810, 0); form.Controls.Add(commentControls); form.ShowDialog(); }
public void StartRemoteVideoViewer() { _remoteViewer.Start(); }
public void StartLocalVideoViewer() { _localViewer.Start(); }
public video_chat_room(string myListening, string videop, string aup, string vclient_n, string vclient_ipadd, string client_videop, string client_aup, string camn, string audioinputn, string audiooutputn) { try { InitializeComponent(); string[] splitmessage = myListening.Split(':'); myListeningUrl = splitmessage[0]; videoport = videop; auport = aup; vclient_name = vclient_n; splitmessage = vclient_ipadd.Split(':'); vclient_ipaddress = splitmessage[0]; client_videoport = client_videop; client_auport = client_aup; camName = camn; audioinputname = audioinputn; audiooutputname = audiooutputn; close_button.Enabled = false; this.client_label.Text = vclient_name; //client vconnector = new MediaConnector(); mjpegConnection = new MJPEGConnection(); vprovider = new DrawingImageProvider(); this.zoom = new Zoom(); videoViewer = new VideoViewerWF() { Name = "Video Preview", Size = new Size(300, 210), Location = new Point(20, 20), BackColor = Color.Black }; vvideoViewer = new VideoViewerWF() { Name = "Video Preview", Size = new Size(300, 210), Location = new Point(20, 20), BackColor = Color.Black }; connector = new MediaConnector(); provider = new DrawingImageProvider(); videoViewer.SetImageProvider(provider); vvideoViewer.SetImageProvider(vprovider); groupBox1.Controls.Add(videoViewer); webCamera = null; foreach (var info in WebCameraFactory.GetDevices()) { if (info.Name == camName) { webCamera = WebCameraFactory.GetDevice(info); break; } } if (webCamera == null) { MessageBox.Show("Couldn't connect to the camera"); return; } connector.Connect(webCamera.VideoChannel, provider); videoSender = webCamera.VideoChannel; webCamera.Start(); videoViewer.Start(); streamer = new MJPEGStreamer(myListeningUrl, int.Parse(videoport)); if (!connector.Connect(videoSender, streamer.VideoChannel)) { MessageBox.Show("Failed to create connection.."); } streamer.ClientConnected += ClientConnected; streamer.ClientDisconnected += ClientDisconnected; streamer.Start(); if (!this.vconnected) { IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse(this.myListeningUrl), int.Parse(this.auport)); this.selectedCodec = new AcmMuLawChatCodec(); this.ServerConnect(endPoint, int.Parse(audioinputn), selectedCodec); } else { this.ServerDisconnect(); } this.lblStatus.Text = "Server & camera started\n" + lblStatus.Text; } catch (Exception ex) { lblStatus.Text = ex.ToString() + "\n" + lblStatus.Text; } }