Making movies and animations from FEAP

If you want to make movies using FEAP one can make the following modifications to the program.

  • One needs to add two subrouines to $FEAPHOME8_3/unix/x11u.c to create graphics files. xpmdump_( ) for XPM files which is a x-windows dump format and jpgdump_( ) for lossless JPG files. Just copy the listings from the links and stick it at the end of x11u.c.
  • To call the new programs, one can set up a UMACro file. [For XPMDump and JPGDump] The function of the UMACro files is to make a copy of the current plot window's contents (which can be closed or partially covered) and output it to a file with the name FeapXXXXX.xpm or FeapXXXXX.jpg, where XXXXX is a sequentially increasing number from 00001 up to a maximum of 99999. The program looks to see if there are existing files and starts numbering after any current files (though if you have a gap in current file numbers it will start at the first missing file number and clobber those after the gap).

    To create an image file just call (from the Macro prompt):
      Macro> XPMD
      Macro> JPGD

    To get the files of a movie you can put this command inside a time stepping loop, for example, which contains you plotting commands. Here is an example input file with such a set up in the batch commands.

  • To stich the image files into a movie one needs movie software such as iMovie or any of a number of available packages. The program called ffmepg is available for free for the Mac (via fink) and for Linux (via a standard rpm package); similar or likely better programs are probably available for windows. In Linux or the Mac, one can for example run the command:

      ffmpeg -r 10 -sameq -i Feap%05d.jpg outmovie.mp4

    This will make a movie with 10 frames per second (can be adjusted as needed), with movie frames having the same quality as the input jpgs, the '%05d' is expanded by ffmpeg to a sequence of integers with 5 digits, and the output will be an MPEG4 movie. ffmpeg has many many options to control the quality of the output as well as the file format etc.

  • For this modification to x11u.c to work you will need to change your loader options to include the jpeg library.

      LDOPTIONS = -L/usr/X11R6/lib -lX11 -ljpeg -lm

    This a free and usually installed library. If one only uses the XPM dump then this library is not needed.