Exemplo n.º 1
0
        internal void DiscoverDevices()
        {
            DeviceList.Clear();
            CameraList.Clear();

            foreach (var userCamera in SavedCameras)
            {
                if (userCamera.DeviceInfo != null)
                {
                    try
                    {
                        DeviceList.Add(userCamera.DeviceInfo);
                    }
                    catch (Exception ex)
                    {
                    }
                }

                if (userCamera.Camera != null)
                {
                    try
                    {
                        CameraList.Add(userCamera.Camera);
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }

            DiscoverUsbDevices();
            IPCameraFactory.DiscoverDevices();
        }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 // 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();
 }
Exemplo n.º 4
0
 // 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();
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 // 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();
 }
Exemplo n.º 7
0
        private void ConnectCam1_Click(object sender, RoutedEventArgs e)
        {
            _camera1 = IPCameraFactory.GetCamera(IpCam1.Text, UseCam1.Text, PassCam1.Text);

            _connector1.Connect(_camera1.VideoChannel, _drawingImageProvider1);
            _camera1.Start();
            viewVid1.Start();
        }
Exemplo n.º 8
0
 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();
 }
Exemplo n.º 9
0
        private void button_Discover_Click(object sender, RoutedEventArgs e)
        {
            _deviceList = new List <DiscoveredDeviceInfo>();

            InvokeGuiThread(() => comboBox_Devices.Items.Clear());

            IPCameraFactory.DiscoverDevices();
        }
Exemplo n.º 10
0
        private void ConnectCam4_Click(object sender, RoutedEventArgs e)
        {
            _camera4 = IPCameraFactory.GetCamera(IpCam4.Text, UseCam4.Text, PassCam4.Text);

            _connector4.Connect(_camera4.VideoChannel, _drawingImageProvider4);
            _camera4.Start();
            viewVid4.Start();
        }
Exemplo n.º 11
0
        private void ConnectCam3_Click(object sender, RoutedEventArgs e)
        {
            _camera3 = IPCameraFactory.GetCamera(IpCam3.Text, UseCam3.Text, PassCam3.Text);

            _connector3.Connect(_camera3.VideoChannel, _drawingImageProvider3);
            _camera3.Start();
            viewVid3.Start();
        }
Exemplo n.º 12
0
        private void ConnectCam2_Click(object sender, RoutedEventArgs e)
        {
            _camera2 = IPCameraFactory.GetCamera(IpCam2.Text, UseCam2.Text, PassCam2.Text);

            _connector2.Connect(_camera2.VideoChannel, _drawingImageProvider2);
            _camera2.Start();
            viewVid2.Start();
        }
Exemplo n.º 13
0
        private void Connect_Click(object sender, RoutedEventArgs e)
        {
            // _camera = new IPCamera(txtIp.Text, txtUser.Text, txtPass.Text);
            _camera = IPCameraFactory.GetCamera(txtIp.Text, txtUser.Text, txtPass.Text);

            _connector.Connect(_camera.VideoChannel, _drawingImageProvider);
            _camera.Start();
            videoViewer.Start();
        }
Exemplo n.º 14
0
 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();
 }
    public MyServer()
    {
        _connector = new MediaConnector();
        _camera    = IPCameraFactory.GetCamera("192.168.115.98:8080", "admin", "admin");

        if (_camera != null)
        {
            _camera.Start();
        }
    }
Exemplo n.º 16
0
        public MyServer()
        {
            _connector = new MediaConnector();
            _camera    = IPCameraFactory.GetCamera("192.168.0.132:8554", null, null);

            if (_camera != null)
            {
                _camera.Start();
            }
        }
Exemplo n.º 17
0
 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);
 }
        private void ConnectIPCamera_Click(object sender, RoutedEventArgs e)
        {
            var host = HostTextBox.Text;
            var user = UserTextBox.Text;
            var pass = Password.Password;

            _ipCamera = IPCameraFactory.GetCamera(host, user, pass);
            if (_ipCamera == null)
            {
                return;
            }
            _connector.Connect(_ipCamera.VideoChannel, _provider);
            _videoSender = _ipCamera.VideoChannel;
            _ipCamera.Start();
            _videoViewerWpf.Start();
        }
Exemplo n.º 19
0
        private void ConnectBtn_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 9; i++)

            {
                Cameras[i] = IPCameraFactory.GetCamera(connectStr[i], "admin", (String)ar.GetValue("password" + (i + 1).ToString(), typeof(String)));
                CamPTZ[i]  = new IPCamera(PTZStr[i], "admin", (String)ar.GetValue("password" + (i + 1).ToString(), typeof(String)));
                //CamPTZ[i] = new IPCamera("165.246.112.35", "admin","ibst0552997730");
                _connector[i].Connect(Cameras[i].VideoChannel, _imageProvider[i]);
                //_connector[i].Connect(Cameras[i].AudioChannel, _speaker);
                Cameras[i].Start();
                CamPTZ[i].Start();
                videoViewerWFs[i].Start();
            }
            _speaker.Start();
        }
Exemplo n.º 20
0
        private void ConnectIPCamera_Click(object sender, RoutedEventArgs e)
        {
            var host = HostAddress.Text;
            var port = HostPort.Text;
            var user = HostUserName.Text;
            var pass = HostPassword.Password;

            _ipCamera = IPCameraFactory.GetCamera(host + ":" + port, user, pass);
            if (_ipCamera == null)
            {
                statusBar.Content = "No Camera Found!"; return;
            }

            _mediaConnector.Connect(_ipCamera.VideoChannel, _imageProvider);
            _videoViewer.SetImageProvider(_imageProvider);
            _ipCamera.Start();
            _videoViewer.Start();
        }
Exemplo n.º 21
0
        private void Connect()
        {
            //http://10.10.10.202/onvif/device_service
            //rtsp://10.10.10.78/axis-media/media.amp
            _camera = IPCameraFactory.GetCamera("rtsp://10.10.10.78/axis-media/media.amp", "root", "cavi123,.");// , CameraTransportType.TCP
            _camera.CameraStateChanged += camera_CameraStateChanged;


            //_camera.CameraStateChanged += _camera_CameraStateChanged;
            _connector.Connect(_camera.VideoChannel, _imgHandler);

            _videoView.SetImageProvider(_imgHandler);


            _camera.Start();
            _videoView.Start();

            //ICameraNetworkManager camIp = _camera.NetworkManager;
        }
Exemplo n.º 22
0
        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();
        }
Exemplo n.º 23
0
 public IpCameraEngine(string ipAddress, string username, string password)
 {
     _camera = IPCameraFactory.GetCamera(ipAddress, username, password);
     _camera.CameraStateChanged  += Camera_CameraStateChanged;
     _camera.CameraErrorOccurred += Camera_CameraErrorOccurred;
 }
Exemplo n.º 24
0
        /*
         * private void FillDevicesWithUsbCameras()
         * {
         *  var usbList = WebCameraFactory.GetDevices();
         *  foreach (var device in usbList)
         *  {
         *      _devices.Add("[USB] Name: " + device.Name);
         *      //USBDevicesDiscovered = true;
         *  }
         * }*/

        private void FillDevicesWithIpCameras()
        {
            IPCameraFactory.DeviceDiscovered += IPCameraFactory_DeviceDiscovered;
            IPCameraFactory.DiscoverDevices();
            IPCameraFactory.DeviceDiscovered -= IPCameraFactory_DeviceDiscovered;
        }