MPEG_OPEN

The MPEG_OPEN function initializes an IDLgrMPEG object for MPEG encoding and returns the object reference. The MPEG routines provide a wrapper around the IDL Object Graphics IDLgrMPEG object, eliminating the need to use the Object Graphics interface to create MPEG files.

This routine is written in the IDL language. Its source code can be found in the file mpeg_open.pro in the lib subdirectory of the IDL distribution.

Calling Sequence

mpegID = MPEG_OPEN( Dimensions )

Arguments

Dimensions

A two-element vector of the form [ xsize , ysize ] indicating the dimensions of the images to be used as frames in the MPEG movie file. All images in the MPEG file must have the same dimensions.

Keywords

FILENAME

Set this keyword equal to a string representing the name of the file in which the encoded MPEG sequence is to be saved. The default file name is idl.mpg .

Example

The following sequence of IDL commands illustrates the steps needed to create an MPEG movie file from a series of image arrays named image0, image1, .., image n , where n is the zero-based index of the last image in the movie:

mpegID = MPEG_OPEN() ; Open an MPEG sequence.

MPEG_PUT, mpegID, IMAGE=image0, FRAME=0
; Add the first frame.

MPEG_PUT, mpegID, IMAGE=image1, FRAME=1

... ; Subsequent frames.

MPEG_PUT, mpegID, IMAGE=imagen, FRAME=n
; Last frame.

MPEG_SAVE, mpegID, FILENAME='myMovie.mpg'
; Save the MPEG sequence in the file myMovie.mpg; .

MPEG_CLOSE, mpegID ; Close the MPEG sequence .

See Also

MPEG_CLOSE , MPEG_PUT , MPEG_SAVE , XINTERANIMATE