Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Capture and save simultaneously

I'm using a PCI-1410 frame grabber and would like to save a video sequence while viewing the images on my PC screen. The resulting file would be saved as an AVI.

If I use the grab function then it takes too much processor time to write the image to the AVI between each grab and I miss many frames.
If I use the sequence function then I cannot see the video on my screen while capturing it.

Do you have an example to show me how to do both things at the same time ? Or is ther a way to first store images in RAM then later process to get an AVI (such as a buffer)?
Oh, by the way, I need to capture at 20 fps (minimum).

Thanks in advance, Martin
0 Kudos
Message 1 of 6
(4,264 Views)
Martin,
 
Are you referring to the Grab and Save to AVI example to save your AVI?  I have used this example many times and have not had any frame rate problems. 
 
Regards,
Jasper S
0 Kudos
Message 2 of 6
(4,255 Views)
Jasper,

Thanks for your reply. I couldn't find the example you mentionned. I'm using LabView 7.1 along with the NI Vision module. The few examples I found related with AVI files were located under the vision folder in the LabView examples directory.

Could this example be new with LabView 8 and more?

From your experience, do you think I'm asking too much to the PC when I try to save my images to the hard drive in real time at 20 fps ?
What I do basically is to acquire an image from a grab acquisition and add it to my AVI file. All this in a loop repeating every 50 msec.
I have a P4 3.0 GHz 1.0 Gb RAM.

Thanks again,

Martin
0 Kudos
Message 3 of 6
(4,250 Views)
Hi Martin, If you have the example you can find it by browsing in the example finder.  Go to Hardware Input and Outputs»IMAQ»File Input and Output.  But as far as the writing to file the limits will depend on the hard drive and the size of each frame.  If you are using gray scale images then you should be able to write 20 fps on most hard drives.  But if you are using 64 bit RBG images then you might not be able to write that fast.  What type of images are you writing to file?  Also let me know if you don't have that example.

Regards,
GG
0 Kudos
Message 4 of 6
(4,228 Views)

Hi Jasper,

 

I am trying to capture images from a USB camera using LabView and would like to control the number of frames as well as how often I grab the frames. I am using the Grab and Acquire VI and can talk to the camera but I cannot control how often I grab the frames as well as the time intervals between them. I am looking at the timed sequences coupled with IMAQ Write File but haven't got them working. Any suggestions?

 

Thanks

 

MikeJo

0 Kudos
Message 5 of 6
(3,601 Views)

Hey MikeJo,

 

First, it might be a little more beneficial to create a new thread for your new question, as the last post on this particular thread was over a year and a half ago. You could always reverence this thread.

 

Second, you should be able to control your frame rate if you use some timing in the loop that contains your Grab.vi. If you have a wait function of, say, 500 ms, your frame rate should be 2 fps. However, if you are also trying to save your images to disk in the same loop, you will notices that the maximum frame rate might not be what you expect. This is because of the time it takes to write an image to disk. If this is the case, you might want to consider implementing a parallel loop architecture and handle all the saving in your consumer loop. This will allow your producer loop to continuously acquire at a specified frame rate, and your consumer loop can take its time saving those images to disk.

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 6 of 6
(3,573 Views)