Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Record avi and FPS mismatch

Solved!
Go to solution

Hello,

 

My vi captures frames  from the camera, now when I try to record an avi file for future reference the avi frames per second and the FPS of my main software don't match which cause black frames in the avi. I've been wondering what is the best approach to capture an avi while the main software FPS changes? Is it possible to remove frames from an avi or is it possible to just record an avi of just the relevant frames?

 

Thank you,

0 Kudos
Message 1 of 7
(3,699 Views)
Solution
Accepted by topic author simply_me

Hello,

 

Have you taken a look at the help file on the AVI functions? Here is an excerpt: "Note   Frame Per Second indicates the desired playback rate of the AVI you create. The AVI may play at a slower rate depending on the performance of the system on which it plays." If you have a mismatch, I would recommend altering the settings of your software and camera in order to get them to match. If you are wanting to keep your current FPS, you may want to take a look at a producer/consumer architecture for your images. Your producer loop would acquire images and your consumer loop would record the frames into an AVI file. Here is an example on such an architecture with images: http://zone.ni.com/devzone/cda/epd/p/id/5859 .

 

-Zach

0 Kudos
Message 2 of 7
(3,673 Views)

Hello Zach,

 

In my main vi I do particle analysis and other calculations, when one begins to "record" an avi he/she need to provide FPS of acquisition. The acquisition FPS and the main loop of particle analysis FPS have different FPS. While the avi FPS is static, the FPS of the main loop is somewhat dynamic. Hence, I'm pretty sure it has nothing to do with playback settings as I looked on the frames of captured avi and it wasn't synced with the main loop/camera because it was mainly black frames. I'd like to "record" only what I see on the image display which is only the particles....

I'll try to modify my vi according to producer/consumer approach, but I'm not sure that it is what I'm referring to.

 

Thank you,

0 Kudos
Message 3 of 7
(3,666 Views)

Hello Zach,

 

In my main vi I do particle analysis and other calculations, when one begins to "record" an avi he/she need to provide FPS of acquisition. The acquisition FPS and the main loop of particle analysis FPS have different FPS. While the avi FPS is static, the FPS of the main loop is somewhat dynamic. Hence, I'm pretty sure it has nothing to do with playback settings as I looked on the frames of captured avi and it wasn't synced with the main loop/camera because it was mainly black frames. I'd like to "record" only what I see on the image display which is only the particles....

I'll try to modify my vi according to producer/consumer approach, but I'm not sure that it is what I'm referring to.

 

Thank you,

0 Kudos
Message 4 of 7
(3,666 Views)

Hi again Zach,

 

The example in the article isn't available to download (I think that the link on the page is broken), can you please upload it to the thread?

 

Thank you,

0 Kudos
Message 5 of 7
(3,654 Views)

Never mind, I downloaded it from ni.com using example finder. So I'm going to try it now:

first loop get image and "record avi"

Second loop particle analysis and other calculations....

Let's see how it'll go....

0 Kudos
Message 6 of 7
(3,652 Views)

Thank you, it works much better now.

0 Kudos
Message 7 of 7
(3,645 Views)