The Movie3 Script
by Zachary X. Reiter and Clifford A. Reiter
October 2002
The image3 addon script, movie3.ijs, contains the main functions used for reading and writing *.mov files which are sequences of jpeg or png images. Also, sequences of jpeg images in *.avi files may be read.
Image Compatability Functions
For reading purposes, these simple *.mov files are treated as images, in which case the default is to read the first frame which is convenient for automatically creating thumbnails. For example, that frame is read as the result of read_image.
- [track frame] mov_wh 'filename' results in the width and height of an image
- [track frame] raw_read_mov 'filename' reads frame image as an h by w by 3 array of bytes
- [track frame] read_mov 'filename' reads frame image as an h by w by 3 array of integers
- [frame] avi_wh 'filename' results in the width and height of an image
- [frame] raw_read_avi 'filename' reads frame image as an h by w by 3 array of bytes
- [frame] read_avi 'filename' reads frame image as an h by w by 3 array of integers
Main Movie Functions
- [track ] mov_l 'filename' results in the length of a track
- avi_l 'filename' results in the length (number of frames) in the movie
- qt_read_all_frames 'filename' results in a L by h by w by 3 array of bytes file where L is the number of frames in the movie.
- [framerate] fseq_to_png_mov (boxed_list_of_in_filenames);'out_filename' creates a png *.mov from the listed sequence of files. The listed files may have any supported image type; in particular, they need not be png images.
- [framerate] fseq_to_jpeg_mov (boxed_list_of_in_filenames);'out_filename' creates a jpeg *.mov from the listed files
- [options] mk_zoom 'fn_image_in';'fn_movie_out' uses a file as an image source and creates a jpeg *.mov zoom of the given width and height with the given ending upper left corner; those parameters are specified by the optional left argument: [endxy_pixels,vid_wh,num_frames,frame_rate]
- [track] f on_frames 'infile';'outfile' applies f to the frames in the given track and outputs the resulting modified movie
- 'infile' mov_to_fseq extension outfileprefix writes the frames of the movie to the file sequence with the given prefix, the given extension, and with frame numbers as a name suffix.
- 'infile' avi_to_fseq extension outfileprefix writes the frames of the movie to the file sequence with the given prefix, the given extension, and with frame numbers as a name suffix.
Lossless Transformations
Various lossless transformations are available for jpeg movie *.mov manipulation.
qtjpeg_flip_h qtjpeg_ll_flip_h
qtjpeg_flip_v qtjpeg_ll_flip_v
qtjpeg_rot_180 qtjpeg_ll_rot_180
qtjpeg_rot_90 qtjpeg_ll_rot_90
qtjpeg_transpose qtjpeg_ll_transpose
qtjpeg_transverse qtjpeg_ll_transverse
qtjpeg_rot_270 qtjpeg_ll_rot_270
qtjpeg_xform
For example,
qtjpeg_rot_90 'inmovie.mov';'outmovie.mov' results in a movie which is a 90 degree clockwise rotation of the input movie.
Numerous lower level functions appear in the script. It is the source for those details. The Movie lab illustrates the use of several of the main functions.
Link to:
Image3 Main Help