MATLAB Function Reference Previous page   Next Page
addframe

Add frame to Audio/Video Interleaved (AVI) file

Syntax

Description

aviobj = addframe(aviobj,frame) appends the data in frame to the AVI file identified by aviobj, which was created by a previous call to avifile. frame can be either an indexed image (m-by-n) or a truecolor image (m-by-n-by-3) of double or uint8 precision. If frame is not the first frame added to the AVI file, it must be consistent with the dimensions of the previous frames.

addframe returns a handle to the updated AVI file object, aviobj. For example, addframe updates the TotalFrames property of the AVI file object each time it adds a frame to the AVI file.

aviobj = addframe(aviobj,frame1,frame2,frame3,...) adds multiple frames to an AVI file.

aviobj = addframe(aviobj,mov) appends the frames contained in the MATLAB movie mov to the AVI file aviobj. MATLAB movies that store frames as indexed images use the colormap in the first frame as the colormap for the AVI file, unless the colormap has been previously set.

aviobj = addframe(aviobj,h) captures a frame from the figure or axis handle h and appends this frame to the AVI file. addframe renders the figure into an offscreen array before appending it to the AVI file. This ensures that the figure is written correctly to the AVI file even if the figure is obscured on the screen by another window or screen saver.

Example

This example calls addframe to add frames to the AVI file object aviobj.

See Also

avifile, close, movie2avi


Previous page  acsch addpath Next page

© 1994-2005 The MathWorks, Inc.