PDA

View Full Version : Getting number of frames dropped & captured.



timmoth
December 6, 2012, 21:36:03
Hi, i cannot seem to be able to get the number of frames captured and dropped during a video capture.
At the moment i have a timer which when the recording is running will execute these lines.

CapturedFrames.Text = "Captured Frames : " + ImageControl.DeviceCountOfFramesNotDropped.ToStrin g();
DroppedFrames.Text = "Dropped Frames : " + ImageControl.DeviceCountOfFramesDropped.ToString() ;

The label's will just output "Captured Frames : 0" & "Dropped Frames : 0"
Also i have this code when my form loads:
ImageControl.OverlayUpdateEventEnable = false;
ImageControl.LiveCaptureContinuous = true;
ImageControl.LiveCaptureLastImage = true;
ImageControl.LiveDisplay = false;
ImageControl.ImageRingBufferSize = 30;
ImageControl.LiveStart();
Thanks for any help, Tim.

(C# .Net visual studio 2010)

Stefan Geissler
December 7, 2012, 08:53:45
Hi Tim,

The functions DeviceCountOfFramesNotDropped and DeviceCountOfFramesDropped are not reliable and depend on whether they are implemented in the driver and whether the driver is able to recognize dropped frames on its own.

Therefore, I suggest to count the frames over a time period and compare the result with the number of frames, that are expected.

timmoth
December 8, 2012, 10:34:22
thanks, however i am not sure how i would go about doing this, is there any code i can look at or a resource that may help me?

Michael Kirmse
December 11, 2012, 11:12:31
Hello Tim,

I built a small sample application that shows how to count frames, using a Stopwatch to be device independent.

Please download the sample from the link below.
1536

timmoth
December 17, 2012, 16:00:42
Ok thanks Michael, that worked great! and helped me a lot. Just one question though - i really need to be able to display "Captured frames" frames which have actually been saved to file. when i use the method AviStartCapture i believe i can only use AviStopCapture?

How can i be getting the number of frames whilst saving my file?

Thanks again, Tim.

Stefan Geissler
December 17, 2012, 16:37:09
Tim,

you must add a frame filter, that counts the frames. This is the only way.
http://www.imagingcontrol.com/en_US/support/documentation/dotnet/tech_FrameFilter.htm

timmoth
December 20, 2012, 17:50:40
Tim,

you must add a frame filter, that counts the frames. This is the only way.
http://www.imagingcontrol.com/en_US/support/documentation/dotnet/tech_FrameFilter.htm

Ok thanks Stefan, i have now implemented a frame filter, by modifying the Binarization example to count the frames captured and out put them. its working great.

I would just like to know if it is possible to detect when a frame is dropped rather then estimate a frame being dropped from the frame rate and time. maybe using this statement?
if (dest.Ptr == null)
...

Thanks for the help so far, Tim.

Stefan Geissler
December 21, 2012, 09:24:07
Hi

Right now, it is not possible to detect a lost frame, but we are working on this.