PDA

View Full Version : fast image sequence capturing



mcshin
April 10, 2009, 19:53:16
I need to capture about 1 hour of video at 30 fps. I have been looking for the best way to do it. And I simply downloaded Save Image Sequence example from http://www.imagingcontrol.com/en_US/library/dotnet/saving-a-sequence-of-single-images/ and modified one function to:

DateTime currTime;
string fn;
long tics;
int ms;
for (int i = 0; i < 10; i++)
{
currTime = DateTime.Now;
tics = currTime.Ticks;
ms = (int) (tics / 10000);
icImagingControl1.MemorySnapImage();

fn = "c:\\frame." + ms + ".bmp";
icImagingControl1.MemorySaveImage(fn);
}

When I compare the millisecond (as well as visually checking by capturing a clock), I'm only getting about 15 fps rather than 30fps. The camera is DMK 31BF03.

My questions are:
1. Is this the best way to do it? I thought about capturing a large large AVI, but I didn't know how it was going to work with 1 hr worth of video.
2. Is there anything that I can do to achieve 30 fps in saving of these images?

Thanks!

Stefan Geissler
April 14, 2009, 12:47:15
Hi,

I am afraid, this is not the best way to capture AVI files, because no AVI files are captured. You only save single images. Since "MemorySnapImage" is in use, the frame rate you can achieve is in worst case the half of the currently used, because "MemorySnapImage" waits for the next complete frame.

However, if you want to capture AVI file, why do no use the "AviStartCapture" function? You may have a look on the "Capturing an AVI File" sample in the "samples\C#" directory of your IC Imaging Control installation path.

Using this function, you can achieve 30 fps.

mcshin
April 14, 2009, 16:47:03
Thanks for the replies. Two more questions, if you don't mind.

1. How big of avi file can I create (using the DemoApp that came with SDK) without losing any frame rate or any data? Of course, as long as there is room for it in the hard drive.
2. What's the lossless or very minimal loss compression codec that you would recommend?

Thanks!

Stefan Geissler
April 14, 2009, 17:09:14
1. How big of avi file can I create (using the DemoApp that came with SDK) without losing any frame rate or any data? Of course, as long as there is room for it in the hard drive.
This depends on your file system: FAT32 is 2 GB max, NTFS is 4 GB max. If you use a good codec, e.g. DivX, then you can save 1 hour at 30 fps without any problems - I guess.


2. What's the lossless or very minimal loss compression codec that you would recommend?
Well, this is a good question. A good point of start is DivX http://www.divx.com. There is a free version available, that puts a small watermark on the video.