#!/bin/csh -f # # Mon Dec 18 13:25:38 MST 1995 # Script to generate MPEG movie files from Sun or GIF input files. # # NOTE the use of the '-t' option to specify format (Sun is default) # and the '-r' option to specify xsize and ysize (512x512 is default). # if ($1 == -h) then echo "Usage: mpeg_create root [-t format] [-r xsizeXysize] files" echo " where root is the root name of the mpeg file generated (i.e. root.mpg), " echo " '-t format' allows format specification of input files 'files'," echo " Currently Sun rasterfile and GIF are the only two input " echo " formats allowed (Sun rasterfile is the default). " echo " '-r xsizeXysize' specifies the number of pixels in the horizontal" echo " and vertical directions of 'files'. 512x512 pixels is the" echo " default." exit 0 endif if ($#argv <= 2) then echo "Usage: mpeg_create root [-t format] [-r xsizeXysize] files" echo " Use 'mpeg_create -h ' more details." exit 0 endif # Initialize default values set nx=512 set ny=512 set ptype=SUN set index=0 set rootname=$1 shift while ($#argv) set i = $argv[1] switch ($1) case -r: shift set nx=`echo $1 | awk '{print substr ($1,0,3)}'` set ny=`echo $1 | awk '{print substr ($1,5,3)}'` goto AROUND breaksw case -t: shift set ptype=$1 goto AROUND breaksw endsw @ index = $index + 1 set tmpfile = fred echo "ln -s $i $tmpfile.tmp$$" ln -s $i $tmpfile.tmp$$ echo "Processing $i" switch ($ptype) case SUN: rasttopnm $tmpfile.tmp$$ > $tmpfile$index.ppm rm $tmpfile.tmp$$ /opt/X11R5/bin/ppmtoyuvsplit $tmpfile$index $tmpfile$index.ppm rm $tmpfile$index.ppm breaksw case GIF: echo "giftoppm $tmpfile.tmp$$ > $tmpfile$index.ppm" /opt/X11R5/bin/giftoppm $tmpfile.tmp$$ > $tmpfile$index.ppm rm $tmpfile.tmp$$ /opt/X11R5/bin/ppmtoyuvsplit $tmpfile$index $tmpfile$index.ppm rm $tmpfile$index.ppm breaksw endsw AROUND: shift end # Encode the entire sequence into MPEG format. mpeg -PF -h $nx -v $ny -a 1 -b $index $tmpfile mv $tmpfile.mpg $rootname.mpg # Cleanup echo "Cleaning up..." /bin/rm -f fred*.Y /bin/rm -f fred*.U /bin/rm -f fred*.V