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.
| Note |
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.
| Note |
mpegID = MPEG_OPEN( Dimensions [, BITRATE=value] [, FILENAME=string] [, IFRAME_GAP=integer value] [, MOTION_VEC_LENGTH={1 | 2 | 3}] [ QUALITY=value{0 to 100}] )
Returns the reference to the IDLgrMPEG object.
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.
| Note |
Set this keyword to a double-precision value to specify the MPEG movie bit rate. Higher bit rates will create higher quality MPEGs but will increase file size. The following table describes the valid values:
If you do not set this keyword, IDL computes the BITRATE value based upon the value you have specified for the QUALITY keyword.
| Note |
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.
Set this keyword to a positive integer value that specifies the number of frames between I frames to be created in the MPEG file. I frames are full-quality image frames that may have a number of predicted or interpolated frames between them.
If you do not specify this keyword, IDL computes the IFRAME_GAP value based upon the value you have specified for the QUALITY keyword.
| Note |
Set this keyword to an integer value specifying the length of the motion vectors to be used to generate predictive frames. Valid values include:
If you do not set this keyword, IDL computes the MOTION_VEC_LENGTH value based upon the value you have specified for the QUALITY keyword.
| Note |
Set this keyword to an integer value between 0 (low quality) and 100 (high quality) inclusive to specify the quality at which the MPEG stream is to be stored. Higher quality values result in lower rates of time compression and less motion prediction which provide higher quality MPEGs but with substantially larger file size. Lower quality factors may result in longer MPEG generation times. The default is 50.
| Note |
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, .., imageN, where n is the zero-based index of the last image in the movie:
; Open an MPEG sequence: mpegID = MPEG_OPEN() ; Add the first frame: MPEG_PUT, mpegID, IMAGE=image0, FRAME=0 MPEG_PUT, mpegID, IMAGE=image1, FRAME=1 ; Subsequent frames: ... ; Last frame: MPEG_PUT, mpegID, IMAGE=imagen, FRAME=n ; Save the MPEG sequence in the file myMovie.mpg: MPEG_SAVE, mpegID, FILENAME='myMovie.mpg' ; Close the MPEG sequence: MPEG_CLOSE, mpegID
Introduced: 5.1
MPEG_CLOSE, MPEG_PUT, MPEG_SAVE, XINTERANIMATE