04-21-2017 04:16 AM
Hi
I would like to create an avi file each time when I want. My camera is working all the time. I would like to make avi files all the time when I want without stopping the application and starting it again. I would like to change the name of the avi file too. I try to use IMAQ AVI2 Create, IMAQ AVI2 Write Frame and IMAQ AVI2 Close. When I put IMAQ AVI2 Create outside of the main loop I can create avi files but with the same name. On this way I overwrite the previous avi file with the new one. I would like to use IMAQ AVI2 Create in the main loop thus creating avi files with different names without overwriting them.
Could you please help me to resolve the problem?
Solved! Go to Solution.
04-21-2017 04:22 AM - edited 04-21-2017 04:23 AM
04-21-2017 03:17 PM
Your Camera puts image data in buffers at some frame rate (say 30 fps). At some point, you say "I want to save frames in an AVI", and at some other point you say "I want to stop this AVI".
What are the steps to create an AVI? There are basically three:
It takes a little bit of time to open (and maybe to close) an AVI, during which time a few frames may be acquired. However, you aren't saving frames, you are saving the contents of buffers. If you have sufficient buffers, you can "save everything".
The process of capturing images goes at a fixed rate, while the steps in creating the AVI file run at varying speeds. You need to code this as two parallel loops -- the Camera loop running at 30 fps and a State Machine to handle the three phases of creating the AVI outlined above.
Bob Schor