MRG Interactive Developments

Mesoscale Research Group, McGill University


MPEG Movie Creation on Unix Platforms

  • Instructions
  • Other resources
  • Downloads



  • MPEG Movie Creation Instructions

    The generation of a high-quality MPEG (Moving Pictures Expert Group) movie from a series of images is relatively simple in the MRG environment. A series of utilities have been installed which greatly ease the movie-creation process:

  • up-to-date jpeg libraries
  • netpbm portable graphics converters
  • mpeg libraries and executables (Berkley and Stanford versions)
  • makempeg - developed by the University of Minnesota

  • Of these utilities, the only one of direct consequence to the MPEG creator is the makempeg perl script, which serves as the primary user interface. The STEPS FOR MPEG GENERATION are as follows:

  • Create a sequence of images (JPEG,GIF,XWD,RGB,PPM) terminating with a 4-digit panel number, padded to the left with zeros as necessary. For example: foo.0001.gif, foo.0002.gif, foo.0003.gif ...
  • If there is no padding capacity in your visualization program, then you will need to run the pad script to convert to canonical names. As well, if the files are generated without a basename (i.e. "foo." above) then you'll have to prepend a string. This is accomplished using a script as described below.
  • Run the makempeg utility as described in the man pages provided under other resources. For example:
    makempeg -fs 1 -fe 10 -base foo for the images above (assuming that there are 10 of them).
  • Run the mpeg_play utility to check out the product. Use of dithering and colour enhancement produces a better quality movie:
    mpeg_play -dither color foo.mpg
  • So that's all that it takes to create and play your own MPEG movie. Remember that the MPEG format does not do well with single-pixel lines, so it's better to use full rendering than mesh images or moving line-graphs. If you're using xrec (Reveur en Couleurs) to create your images, then use a prepend script like:

    #!/sbin/ksh
    if [[ -z $1 ]] ; then
    echo Usage: prepend 'string'
    exit 0;
    fi
    set -A fileList `ls -1 .`
    for file in ${fileList[*]}; do
    echo prepending $1 to $file
    error=`mv $file $1$file`
    wait
    echo $error
    done

    This will allow you to add a base name to your files (which are generated with only the required four-digit identifiers) - don't forget to put a full-stop between your base name and the file. For example:
    prepend myfile. will result in a makempeg base of "myfile".



    Other Resources

  • Penn State CAC MPEG informational page
  • MPEG Home


  • Downloads

  • makempeg utility
  • prepend utility
  • integer padding utility
  • Berkeley MPEG
  • Stanford MPEG
  • Latest JPEG Library
  • NETPBM Project


  • Questions or Comments? Contact our WebMaster.