Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Read and Write avi frame in same loop

Hello, I'd like to extract a frame from an avi, modify it, and save it in the same slot in the original avi. SO far cannot seem to have both read and write functions in the same loop. Is this possible if using different refnums? many thanks!
0 Kudos
Message 1 of 4
(3,436 Views)

Hi dfd,

There is an example that both reads and writes to an AVI file that ships with LabVIEW.  It is called AVI Read Write with Data Example.VI.  If you look at that example you will see after the Write is preformed the IMAQ AVI Close function is used.  And then the reference to the AVI file is reopened before performing the read.  Each AVI session is going to be either a read or write session.  So when reading the AVI file, read the frames into an array and then close the session.  Once the image processing is complete reopen a new AVI session and write the frames to file.  I hope this helps.

Have a great day,

GG

0 Kudos
Message 2 of 4
(3,420 Views)

As far as I know, you can't modify a frame within an existing AVI.  You will need to read the entire AVI and write the modified version to a different file.  You can open the references for both files simultaneously, which makes the copying a little simpler, especially for very large AVI files.

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 3 of 4
(3,417 Views)
Thanks for your help guys. Seems to be working now
0 Kudos
Message 4 of 4
(3,412 Views)