Matlab Movies for the WEB and for POWERPOINT

by Andreas L. Wiegmann, PhD.

movie icon

[Contribute] [Download] [Purpose] [Examples] [Installation (UNIX/Linux)] [Package (PC)]
[Usage] [Tests] [Known Bugs] [Credits] [Miscellaneous] [Author]

movie icon

Download the package


        Download gzipped and tarred UNIX/Linux versions of the package

        or the individual files needed on Windows PCs.

movie icon

Purpose of this package

          I'm an applied mathematician with a PhD from the University of
        Washington in Seattle, USA, and currently work at the Fraunhofer
        Institute for Industrial Mathematics in Kaiserslautern, Germany.

          My research interests are in the numerical solution of partial 
        differential equations and in optimization. In both areas,
        it is sometimes necessary to consider quantities changing 
        with time or corresponding to the steps of a solution process. 
        My favorite visualization tool is MATLAB, and my preferred way
        of communicating is via the internet -- at least compared with
        the usual research articles. Over the last 4 years, I have found
        this attitude to be also extremely helpful when communicating
        the usefulness of mathematical methods and software to industrial
        customers, who do not usually have a background in mathematics,
        but rather very practical problems. Visualization and animation
        can quickly convey that I rally have something to constribute 
        towards their needs. Thus, I have also written extensive tools
        for this purpose besides this matlab package.
        
        MATLAB comes with its own movie commands, but they are not 
        directly suited to put movies on the WEB: Matlab's movies can 
        only be played with MATLAB, they are generated slowly and 
        consume enormous amounts of disk space when saved. The same
        disk space and memory requirements exist when you use the mathworks
        own mpegread and mpegwrite commands.

        Since 1994, MPEG seems to be evolving as the (commercial) standard
        for animation. Many PCs are now sold with built-in hardware to 
        display movies in this format. Another popular format is GIF.
        These two formats are supported by my MATLAB movie package.

        The package specifically provides a Matlab interface to 
        the University of California at Berkeley's mpeg_encoder 
        and Rene Mueller's gifmerge software. Both create animations
        from sequences of gif images.

        The package extends MATLAB to provide those collections of
        gif images and to access some of the options of the above 
        mentioned software conveniently from within Matlab. 
        Specifically the commands are

        makeframe    --- to generate a single image in gif format
        makemovie    --- to generate movies in MPEG and Gif89a formats
                         from the images generated with makeframe.

        This package is not a movie viewer; any internet browser will
        display its output.

movie icon

Examples of movies created with this package

   Pulsing Meshfunction

          Here you see the movie simple.gif, which is created as an 
        example by the package. If you have set up your browser 
        correctly, clicking on it will start an mpeg_player with 
        the same simple in mpeg format -- 7 times smaller than the 
        gif version. The quality is higher if you create figures with
        less than 256 colors and do not use the quantify option, which
        is otherwise needed due to the gif format limit of 256 colors.

        For more sophisticated examples, please check out the following sites:

        - Joern Sesterhenn has used ideas from this package to create 
          gif movies from Fortran, animating Lock Exchange flows.

        - Professor Randy LeVeque has used the package to 
          animate results from his AMRCLAW Package.

        - I use the package to explain the workings of my numerical 
          method for elliptic pdes with non-smooth solutions, EJIIM.
        If you have a fast network connection, check this out.

movie icon

Installation of the package

        To install the movie package under UNIX/Linux, you should execute

        tar xzf movie_v5.tgz
	
        That creates a new directory Movie. You can move the Movie 
        directory whereever it is convenient for you. Next,

        cd Movie

        Move the other *.tar.gz files (with platform-specific 
        executables) you received to this Movie directory as well.

        install_movies
        
        install_movies edits the site-specific sections of the  
	      files makeframe.m, makeparams and makemovie.m. The variable 
        packagedir has the full path to the matlab movie package, 
        which is the directory in which you run install_movies. (If 
        you want to change the location of the Movie directory, 
        simply run install_movies again in the new directory. In 
        that case, don't worry about error messages that 
        install_movies could not find certain files, by moving 
        the Movie directory that portion of the installation 
        remains intact.)

          When you run install_movies, an e-mail is sent to 
        andreas@familie-wiegmann.de that you did so. This is due to  
        curiosity of the author and to find out how useful this package 
        may be. If you feel that it violates your privacy, please feel
        free to comment out the corresponding lines in the 
        install_movies file.

          In multi-user environments, one copy of the package may be 
        used system wide, by setting the file read, write and  
        execute permissions in the Movie directory (and  
        subdirectories) appropriately and notifying all users of 
        the location of the package.

movie icon

Usage

        Include the path to the matlab movie package (under MATLAB) 
        with a statement similar to:

        path(path,'/user7/awiegman/Matlab/Movie') --- Matlab 4
        addpath('/user7/awiegman/Matlab/Movie')   --- Matlab 5, 6


        where the path in single quotes is where you installed the
        movie package.

        Alternatively, include it in your .cshrc file, similar to
        
        setenv MATLABPATH /user7/awiegman/Projects/Matlab/Movie
	
        Try 
        	help makeframe
        and
        	help makemovie
	
        under Matlab as well.

movie icon

Tests

        Try  
        	type simplemovie  
        or  
        	type moviedemo   
	
        under MATLAB to see examples of how to generate movies. 
        Executing   simplemovie should generate the files

        simple.mpg         and         simple.gif
        
        as they come with this package and included above in this 
        document.

movie icon

Known Bugs


        - Gif Animations of figures with more than 256 colors are
          not created at all. This is a limit of the Gif image format,
          not my package. This package uses ppmquant to scale down
          down the color space, but ideally this should be done by
          the user for all frames in the same manner. The ppmquant 
          executable is not yet available for all platforms, and
          is buggy on the windows platform.

        - Switching desktops while creating the frames (with new,
          higher quality version) puts part of the current desktop
          in your movie.

        - On SGI machines, the correct directory name may be SGI64, not 
          SGI as is currently the case. Please let me know if you have  
          a definitive answer to the question: Is the computer variable
          on SGI always set to `SGI64`?

movie icon

Credits

        Creation of this package was made possible by the advent of 
        Matlab, UNIX and the Web. Other than Matlab, most of the needed 
        software is available as source code from various sites listed 
        below. 

        For convenience, I distribute all needed executables for
        Windows, Linux, SGI, DEC Alpha, Sun SPARC and HP700 workstations. 


        The UC Berkeley mpeg_encode:

	     ftp://mm-ftp.cs.berkeley.edu/pub/mpeg/encode/

        and mpeg_play: Executables for DEC Alpha, HP7000, Sun SPARC and 
        for many other workstations may be obtained from the Geometry 
        Center at the University of Minnesota:

             http://www.geom.umn.edu/software/download/mpeg_play.html

        The player is not part of the package and called only in the 
        demonstration files moviedemo.m and simplemovie.m


        Executables of the pnmcut and giftopnm programs by Jef 
        Poskanzer are also included. The pbm package is available 
        from netlib and many other sources. 


        Finally, executables of Mark Podlipec's txtmerge, improved to 
        gifmerge by Rene K. Mueller, are included. 

             http://smurfland.cit.buffalo.edu/xanim/xa_gifs.html

        and

	     http://the-labs.com/GIFMerge/

movie icon

Miscellaneous

        Matlab version compatibility:

        I have extensively tested the movie package version for 
        Matlab 4.2c. A new version of the package for Matlab 5, 6
        is available as of 12/13/1997. For help with other versions 
        of Matlab feel free to contact me at

	     andreas@vicmasoft.com

        Disk Space: 

        If mpg_encode, mpeg_play, gifmerge, pnmcut or giftopnm are 
        available on your system, you may want to replace the 
        executables of the files with links to the appropriate files,
        or change the paths in makeframe, makeparams and makemovie 
        appropriately.


        Supported Architectures:

        Currently, the package is self-contained for PCs under Windows 95,
        and Windows NT, DEC Alpha, SUN SPARC, SGI and Hewlett-Packard 
        HP7000 workstations. 
	

        Porting the package to different architectures:

        It is fairly easy to assemble all the necessary files for 
        other architectures from the internet (see the Credit section 
        for URLs). Slight modifications of makeframe and makemovie 
        are needed, as well as new directories containing the 
        executables for the new architectures. Naming conventions 
        for the directories are those of Matlab, the new directory 
        (e.g. SUN4 for Sun SPARC workstation) needs to contain the 
        same files as e.g. the ALPHA directory, but compiled for 
        the new architecture. For demonstration purposes, a file
        install.sun is included, that searches the system for some of
        the necessary file from the pbmplus package and puts them in 
        the right locations. (Needed back when I did not have all the 
        executables for SPARC stations.)


        Debugging:

        In case either makeframe or makemovie does not work, you may
        want to consider calling it with all options and a dummy 
        variable, e.g.   makeframe(i,[240,192],'debug'); 
        or               makemovie(0,13,'demo',10,1,'all','debug');
        This generates extra information on what particular portion 
        of the package is being executed.

        Update for Matlab 5, 6:  - The commands do NOT support
                                   the debug option anymore.
                                 - The arguments in makemovie have changed,
                                   necessetating internal gymnastics to 
                                   ensure compatibility with Matlab 4.

movie icon

All files are provided as is, with no guarantees whatsoever...

movie icon

This page was last modified: Tuesday, April 28th, 2009
Go to Andreas' professional homepage