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.
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
MPEG_PUT, mpegID, IMAGE=imagen, FRAME=n
;
Last frame.
MPEG_SAVE, mpegID, FILENAME='myMovie.mpg'
;
Save the MPEG sequence in the file
myMovie.mpg;
.