0

I am using emgucv which is 'c#' wrapper for opencv I want to read video stream by playing the video as for testing i have a video and i want to get continues frames one next to other for this purpose i used the QueryFrame() method but it only get first frame of the video no more. At first frame it capute video content as expected but black screen to later frames don't know whats going inside.

public void processFrames(){
   capt = new Capture("video2.avi");

   Image<Bgr, Byte> ImageFrame = capt.QueryFrame().ToImage<Bgr, Byte();
   if (ImageFrame!=null ) {
      ImageFrame = capt.QueryFrame().ToImage<Bgr, Byte>();
      imageBox1.Image = ImageFrame;
   }
   else {
      timer1.Stop();
   }    
}

private void button1_Click(object sender, EventArgs e){ 
   timer1.Start();
}

private void timer1_Tick(object sender, EventArgs e){
   processFrames();   
}
Basit
  • 862
  • 1
  • 12
  • 30

1 Answers1

1

You don't actually move to the next frame in the video. You need to keep track of the last frame position and query the next one.

ilann
  • 36
  • 3