Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Dropping frames

First, I am not the programmer and the program is written by another person in CVI.

 

We are capturing 2 video sources concurrently and writing them to disk. One is standard NTSC 640x480 but at only 1 fps, the other is 646x456 (or very close) 8bit at 60fps.

In 1m54s scan, this generates a 2.2GB file. This equates to 20MB/s transfer speed.

I looked at the program in task manager and the memory used doesn't change throughout the entire scan. The system memory never changes either (I have 4GB memory, 3.5 GB free - windows 32bit).

 

It seems like the program should be buffering to memory, then writing to the harddrive when it can. Is this true? Is there a command I can have the programmer look into? A buffer size variable?

 

Thanks,

Alex

0 Kudos
Message 1 of 4
(3,385 Views)

Alex,

 

The buffering depends on how the programmer set it up.  Some would preallocate all the space, then fill it as the program runs, then write everything to the drive at the end.  Others stream to disk while using an intermediate buffer to handle the difference in speeds between the incoming and outgoing video.

 

The use of memory shown by the system isn't really a significant issue.  Your subject says dropping frames, but you don't talk about that at all.  I would suggest you start by explaining your problem instead of your troubleshooting details.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 4
(3,376 Views)

During an inspection, every frame we take from the video, we tie to a position we pull from the motion controller. When viewing the FPS and visual feedback from the camera, there are visible pauses, which correlate to jumps in the distance feedback from the motion controller. Typical gap is .1mm between laser frames. These "blips" occur approximatly once a second and the distance between frames jumps up to 1mm maximum (this value is between .2 and 1mm).

NI's HLGRAB demo also experiences these same blips while writing to the harddrive.

 

The harddrive speed is a minimum of 52MB/s and the file is writing at approximatly 20MB/s so we shouldn't be near the hardware limits.

Message Edited by AlexChannell on 05-26-2010 10:09 AM
0 Kudos
Message 3 of 4
(3,370 Views)

It sounds like you have a small buffer between acquisition and writing to disk, perhaps ten frames.  If the hard drive is slower than acquisition, occasionally your buffer write index will pass the buffer read index and you will lose a buffer of data.

 

How are you streaming to disk?  Are you putting all the images and data in the same file?  If you are opening and closing images, you will never get the 52MB/s rate.  If you are compressing images, that can take a significant amount of time also.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 4
(3,366 Views)