Skip to content

Process in a lot of count of continual frames?

Bahar Jalali

Asked Jun 10, 2012, 2:11 AM EDT1 answer
Share
LinkedInX
hi
i have an ip camera that i use this code for get it's video frames. 

BitmapImage src;
Bitmap xxxxxbitmap;



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");
        }


and : 


        private void mjpeg_FrameReady(object sender, FrameReadyEventArgs e)
        {
                src = e.BitmapImage;
               xxxxxbitmap = BitmapImage2Bitmap(src);
               processimage(xxxxxbitmap);     
        }


my function "bitmapimage2bitmap" work correct and i test it. but when i use it in the mjpeg_FrameReady it don't work. i think my program is hanged and don't do any thing, because of counter of frames that they come rapidly and continual. 
i have tested every of functions and they work correct, but when i use in frameready it has problem, no error but hang!
so how must i do a process on my frames?

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    i detect that it has error out of memory in some part of my code that i have something like this : 
    bitmap bit = new bitmap;

    any suggestion?
    0