Пример #1
0
        public void Start(CameraEntity device)
        {
            Func <VideoCapture> captureCreate = () => new VideoCapture(string.Format("rtsp://{0}:{1}@{2}/cam/realmonitor?channel=1&subtype=0", "admin", "admin", $"{"192.168.111.127"}:{554}"));

            _capture = Task.Factory.StartNew(captureCreate).Wait <VideoCapture>(device.Timeout);
            Task.Factory.StartNew(GrabLoop);
        }
Пример #2
0
        public void Start(CameraEntity device)
        {
            var client = new HttpClient();

            State = UnitState.Run;
            Task.Factory.StartNew(async() =>
            {
                while (State == UnitState.Run)
                {
                    var frame = await client.GetByteArrayAsync("http://192.168.100.100/-wvhttp-01-/image.cgi?v=jpg:1280x720");
                    var i     = new Image
                    {
                        JpegData = frame,
                    };
                    GrabberSubject.OnNext(i);
                }
            });
        }