LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a movie .avi and save images in that movie with labwindows/CVI ?

Hi,
I am writing a labwindows/CVI 2012 code that drives a camera using the Imaqdx functions. I need to record a sequence of grabbed images as a movie .avi.
I don't understand how to use the imaqCreateAVI function or the imaqWriteAVIFrame function.

An example of such a labwindows/CVI program showing how to use these two functions would be very helpful. Does such examples already exist ? if yes where ? if no, could somone give me some tips ?
How can I write the images grabbed with the camera directly in the movie without saving the whole images sequence ?
Thanks for your help.

0 Kudos
Message 1 of 5
(4,783 Views)

Hi castorpollux,

 

Have you seen the Grab example in CVI?

You could find it there : C:\Users\Public\Documents\National Instruments\CVI\Samples\IMAQdx\Grab

 

This example shows how to grab image with IMAQdx functions.

It's a good starting point to modify/adapt this project with the IMAQCreateAVI function.

 

Regards,

Valentin
Certified LabVIEW Architect
Certified TestStand Architect
Certified LabWindowsCVI Developer
National Instruments France

0 Kudos
Message 2 of 5
(4,746 Views)

Hi Valentin,

I saw the Grab example program for grabbing images with a camera that you mention. th example shows how to open a session, grab a sequence of images, and display the images on the screen. But it does not show how to create an avi and record the images as successive frames in the avi.

 

Would you have an example program that shows how to create and record grabbed images in an avi file using the NIvision functions such as  imaqCreateAVI, imaqWriteAVIFrame, imaqOpenAVI ?

 

In the folder : C:\Users\Public\Documents\National Instruments\CVI\Samples\, I could not find any NI Vision folder.

 

Regards

0 Kudos
Message 3 of 5
(4,668 Views)

Hi Valentin,

I finally succeeded in aquiring an avi movie with labwindows CVI using the grab exemple program you recommended

C:\Users\Public\Documents\National Instruments\CVI\Samples\IMAQdx\Grab.

I simply added the three following lines :

just after the "activation of the imaq loop", I inserted 

aviSession = imaqCreateAVI ("movie.avi", NULL, IMAQ_USE_DEFAULT_QUALITY, 30, 0);    

 

in the imaq_loop, I inserted just below the line " imaqDisplayImage (image, 0, TRUE);"

imaqWriteAVIFrame (image, aviSession, NULL,0);

 

 

the variable aviSession is declared at the beginning of the program:

static AVISession aviSession

 

Thanks for your help.

Hope this may be helpful to someone else.

CastorPollux

0 Kudos
Message 4 of 5
(4,523 Views)

Hi castorpollux,

 

Thank you for sharing your solution. Smiley Happy

 

I'm sure this will help someone else.

 

Bonne journée,

 

 

Valentin
Certified LabVIEW Architect
Certified TestStand Architect
Certified LabWindowsCVI Developer
National Instruments France

0 Kudos
Message 5 of 5
(4,518 Views)