Image Acquisition Toolbox Previous page   Next Page

Creating an AVI File Object for Logging

To create an AVI file in the MATLAB environment, use the avifile function. You specify the name of the AVI file to the avifile function. For example, to create the AVI file named my_datalog.avi, enter this code at the MATLAB command prompt.

The avifile function returns an AVI file object. You can use the AVI file object returned by the avifile function, aviobj, to modify characteristics of the AVI file by setting the values of the object's properties. For example, you can specify the codec used for data compression or specify the desired quality of the output. For complete information about AVI file objects and their properties, see the MATLAB avifile documentation.

Guidelines for Using an AVI File Object to Log Image Data

When you specify the AVI file object as the value of the DiskLogger property, you are creating a copy of the AVI file object. Do not access the AVI file object using the original variable name, aviobj, while the video input object is using the file for data logging. To avoid file access conflicts, keep in mind these guidelines when using an AVI file for data logging:

Closing the DiskLogger AVI file

When data logging has ended, close the AVI file to make it accessible outside the MATLAB environment. Use the value of the video input object DiskLogger property to reference the AVI file, rather than the variable returned when you created the AVI file object (aviobj). See Example: Logging Data to Disk for an example.

Before you close the file, make sure that the video input object has finished logging frames to disk. Because logging to disk takes more time than logging to memory, the completion of disk logging can lag behind the completion of memory logging. To determine when logging to disk is complete, check the value of the DiskLoggerFrameCount property; this property tells how many frames have been logged to disk.


Previous page  Logging Image Data to Disk Example: Logging Data to Disk Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2010 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS