Bahar Jalali

Bahar Jalali

  • NA
  • 185
  • 304.9k

how process frames one by one?

Jun 13 2012 3:29 AM
hi
i have an ip camera that i use this code to get frames, i work on wpf, and i use the MjpegProcessor.dll

Bitmap xxxxxbitmap;
BitmapImage src;
DateTime startTime;
public MainWindow()
        {
            InitializeComponent();
            _mjpeg = new MjpegDecoder();
            _mjpeg.FrameReady += mjpeg_FrameReady;
        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            _mjpeg.ParseStream(new Uri("http://192.168.1.10:88/cgi-bin/guest/Video.cgi?media=Mjpeg"), "admin", "admin");
        }

        private void mjpeg_FrameReady(object sender, FrameReadyEventArgs e)
        {
            myimg.Source = e.BitmapImage;
            src = e.BitmapImage;
           // startTime = DateTime.Now;
            xxxxxbitmap = BitmapImage2Bitmap(src);
          //  label1.Content = string.Format("Status: {0} sec", DateTime.Now.Subtract(startTime).TotalSeconds);
            processimage(xxxxxbitmap);
        }

but when i use my code to process here, my program hangs!   i think because it can't get frames one by one and because of the speed of the frames!

how can i process every frames realtime? if you can get me a simple process on the frames it will be so appropriate!

thanks