#!/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 ($#argv <= 2) then echo "Usage: mpeg_create root [-t format] [-r xsizeXysize] files" 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 ln -s $i $tmpfile.tmp$$ echo "Processing $i" switch ($ptype) case SUN: rasttopnm $tmpfile.tmp$$ > $tmpfile$index.ppm rm $tmpfile.tmp$$ ppmtoyuvsplit $tmpfile$index $tmpfile$index.ppm rm $tmpfile$index.ppm breaksw case GIF: giftoppm $tmpfile.tmp$$ > $tmpfile.ppm rm $tmpfile.tmp$$ 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