Exemplo n.º 1
0
        private void Window_Initialized(object sender, EventArgs e)
        {
            _decoder.StartDecodingAsync("http://83.128.74.78:8083/mjpg/video.mjpg");
            _decoder.OnFrameReceived += _decoder_OnFrameReceived;

            // Not used anymore
            //_worker.DoWork += _worker_DoWork;
            //_worker.RunWorkerAsync();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            if (Directory.Exists(FramesDir))
            {
                Directory.Delete(FramesDir, true);
            }

            if (!Directory.Exists(FramesDir))
            {
                Directory.CreateDirectory(FramesDir);
            }

            var decoder = new StreamDecoder();

            decoder.OnFrameReceived += Decoder_OnFrameReceived;
            decoder.StartDecodingAsync("http://83.128.74.78:8083/mjpg/video.mjpg");

            Console.ReadLine();

            //while (true)
            //{
            //    Thread.Sleep(1000);

            //    var frame = decoder.GetLastFrame();

            //    if (frame == null) continue;

            //    Console.WriteLine($"Frame received at: {DateTime.Now}");

            //    using (FileStream fs = new FileStream($"Frames\\{DateTime.Now:HH-mm-ss}.jpeg", FileMode.CreateNew))
            //    {
            //        fs.Write(frame, 0, frame.Length);
            //        fs.Flush();
            //    }
            //}
        }
Exemplo n.º 3
0
 public void StartDecoding() => _decoder.StartDecodingAsync("http://83.128.74.78:8083/mjpg/video.mjpg");