Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

grab and save to avi without ask user to save at selected path

hi ...
how to grab and save to avi at pre-determine selected path without ask user (dialog box) to save at selected path..meaning that we already pre-determined the location before  execute the  program..hope that all of u can can attached the example..
thanks for helping me...
 
0 Kudos
Message 1 of 10
(5,043 Views)

Hi,

There is an example program that does something similar to what you’re trying to do.  It is called Grab and Save to AVI.VI.  I have attached a screen shot of a modified block diagram that allows you to choose the path before the VI is run.  Basically I replaced the dialog VI with the green constant.  That is where you will type in your file path.

GG

Message Edited by Gavin G on 02-05-2007 09:19 AM

Message 2 of 10
(5,028 Views)

Thanks GG, that would be helpful. But how about save the avi with asking the path? Is it possible to save the *.avi after the grabbing?

0 Kudos
Message 3 of 10
(5,005 Views)

Hi Nicole,

When using the Grab and Save to AVI example without altering it you will be asked to specify the file name.  To find the Grab and Save to AVI example click on find examples from the help menu.  Then do a search for AVI. 

Once the vi is run the .avi file will be saved to the selected path.   To clarify, if you are trying to save the AVI file after all the images are taken you can do this by creating an array of image buffers.  But this isn’t recommended as it is very memory intensive.   Saving the images as they are acquired as in the Grab and Save to AVI example won’t use as much memory.  Keep me posted if you have more questions.

Have a great day.

GG 

0 Kudos
Message 4 of 10
(4,998 Views)
Thanks so much Gavin G.it works!!!
0 Kudos
Message 5 of 10
(4,978 Views)

Hi Gavin,

 

I have similar question about saving avi file. I modified the grab and save to avi file to capture video as avi for fixed amount of time. But, I would like to give it a name after the data is captured, rather than before the acquisition. Moreover, it would be nice if I have an option of reject or accept the video (save or not save it) depending on the outcome of the live event being captured. Any help is appreciated. 

 

Thanks,

Ravi. 

0 Kudos
Message 6 of 10
(4,640 Views)

Hi Ravi,

 

You can always save it as a temp.avi file. When you are done with recording, if you want to rename the file, create a new avi file with user choice of name and copy the content from temp;avi to the new avi. You can delete the temp.avi file after you are done or you do not want the content at all.

 

Regards

Lee

0 Kudos
Message 7 of 10
(4,615 Views)

Hi Lee,

 

  Thank you for the reply. I do not want the content at all. I want to eliminate the task of going to the temp.avi file and rename it manually. When you are working if a lof of files it is a hassle. I guess I may be able to implement the operation of renaming and deleting temp.avi in the .vi itself. But, it will be redundant task for the .vi. I will try to make an vi that will create a temp.avi and then gives a choice of naming the file, if a name is given it will rename it or else it will delete the file. I will get back to you after I try. Meanwhile, I appreciate sharing if you can share any other idea you may have regarding this issue.

 

Thank you,

Ravi. 

0 Kudos
Message 8 of 10
(4,541 Views)

Hi Lee,

 

  Thank you for the idea of having temporary file (temp.avi). That clue helped me find a solution, which turned out to be fairly simple. I added code to prompt the user for a new filename or cancel the data after the acquisition is finished. I used 'Move' function to rename the file and save it. If the naming is cancelled, I cleared the error and used 'delete' function to clear the temp.avi. Problem solved. I appreciate any feedback to make it even effective. 

 

Thanks,

Ravi. 

0 Kudos
Message 9 of 10
(4,534 Views)

Hi Ravi,

 

I am glad I was about to give you some idea on your application.

 

Regards

Lee

0 Kudos
Message 10 of 10
(4,500 Views)