Some months ago I made good deal of MPEGs at Honolulu Community College's Web site. These pages describe how they were made and also document the latest information on creating MPEGs on both UNIX and Macintosh platforms.
A VideoSpigot board and its extension, paired with the ScreenPlay Extension (available by ftp at sumex-aim.stanford.edu) captured the video that was shot all around the campus with a little camcorder. We saved each movie with "Graphics" compression with the "Color" option (so the frames are 8-bit) from the QuickTime Extension, available at ftp.apple.com.
You will want to make sure the width and height of the movie both have an even number of pixels - this will eliminate potential problems with converters and encoders later. A common size to use which is fairly fast and yet big enough to see detail in is 160 pixels wide by 120 pixels high.
Using a movie converter HyperCard stack written by Lawrence D'Oliveiro at the University of Waikato in New Zealand (Ido@waikato.ac.nz), the QuickTime movies were converted to numbered PICT files. Normally the frames are saved with the name, a period, and a number (e.g., "movie.1, movie.2, ...", but I changed it to omit the period for easier conversion later. To get the modified stack in BinHex format, select this.
Now that you have a folder of PICT frames that look like "movie1, movie2, ..." you need to convert each frame to GIF format (at least, a batch converter for PICT to some other common format). One program that will do this is GraphicConvertor by Thorsten Lemke. That's also at sumex.
I highly recommend using Fetch, an excellent FTP program for the Mac (also at sumex), to transfer files to UNIX. From the "Remote" menu you can specify entire folders to transfer (the "Put Folder and Files..." option), so moving a folder full of images becomes very automatic. Just remember to specify the format as "Raw Data" when you transfer!
The GIF files were transmitted through NFS-Share to a UNIX box. If you use a method like disk sharing to transfer from the Macintosh, remember to delete any percent-sign files that some programs use to store Macintosh resource information. Just type:
rm -f %*
Now, assuming you have a few directories with GIF frames, each directory representing a movie, make a note of the number of frames in each movie. Typing
ls | wc -l
in a movie's directory will give you the number. Now, you need to convert the files to YUV format - that splits each file into three, each file containing luminance, chrominance, and hue information respectively. Using giftoppm from the pbmplus package at export.lcs.mit.edu, and using ppmtoyuvsplit available at gogol.cenatls.cena.dgac.fr, you can write a little shell script like:
#! /bin/csh set num = 1 set limit = $#argv @ limit++ while ($num != $limit) set file = $argv[$num] giftoppm $file | ppmtoyuvsplit $file @ num++ end
...or whatever, save it as giftoyuv, make it executable, and type
giftoyuv *
in your GIF directory. For those who have had trouble compiling ppmtoyuvsplit, you can obtain a uuencoded SunOS 4.1.3 binary here. You can also obtain ppmtoyuv (for the Berkeley encoder, see below) and ppmtoyuvsplit from the netpbm graphics utilities package, available by FTP at ftp.cs.ubc.ca or ftp.x.org.
Using the mpeg encoder/decoder, available from havefun.stanford.edu (or for a DOS version or other (faster, better) PC-based solutions, contact mitgml@dct.ac.uk), type:
mpeg -a <start frame #> -b <end frame #> -h <frame width in pixels> -v <frame height in pixels> -PF movie.mpg movie
In this case, the final MPEG movie is "movie.mpg" and the files are "movie1.Y, movie1.U, movie1.V, movie2.Y, movie2.U, movie2.V, ..." In our case the frame sizes were 160 pixels wide by 120 high, which is the original VideoSpigot size.
You can also get Berkeley's MPEG encoder and player packages by FTPing mm-ftp.cs.berkeley.edu. The encoder has some pretty nice options, and can take in YUV frames that aren't split into three parts.
Thanks go to the Manoa Innovation Center's Digital Media Lab for giving up a little time on their super-stocked Quadra, and to Mike Butsch (butsch@wave.esm.vt.edu) for pointing out a few quirks.
Record a soundless Quicktime in 256 colors with no compression. This time, it doesn't matter what size you make the window. Using the movie converter stack (as described above) and split the movie out into a folder of PICT images.
Now, using GraphicConverter 1.7.8 or better (also described above), batch convert the PICT folder into a folder of PPM images! Make sure you specify in the preferences to not create preview icons, as that will slow down conversion considerably.
Transfer the folder of PPMs (using Fetch or some other method) to your UNIX box.
For this step you'll need to use Berkeley's encoder (it's just the easiest thing to set up in this case). You'll also need the netpbm package (see above). Make sure the "mpeg_encode" program and "anytopnm" program from the netpbm package are available to you.
Put the following into a file called "mpeg.params" in your folder of PPMs:
PATTERN IBBBPBBBBP OUTPUT movie.mpg INPUT_DIR . INPUT movie*.ppm [1-100] END_INPUT BASE_FILE_FORMAT PNM INPUT_CONVERT anytopnm * GOP_SIZE 30 SLICES_PER_FRAME 1 PIXEL HALF RANGE 10 PSEARCH_ALG LOGARITHMIC BSEARCH_ALG CROSS2 IQSCALE 8 PQSCALE 10 BQSCALE 25 REFERENCE_FRAME DECODED
The only line you'll need to change is the one with the text "movie*.ppm". You'll need to substitute the prefix name of the frames with the text before the asterix. You'll also need to specify the end frame number as the last number of that pair of numbers between the brackets ([]). For instance, if you have files like "joe1.ppm joe2.ppm ...." going from 1 to 55 frames, then specify that line as:
joe*.ppm [1-55]
Now type:
mpeg_encode mpeg.params
in your folder of PPMs and sit back and relax! The final MPEG will be called "movie.mpg" (or whatever you specify the name as in the OUTPUT line of the mpeg.params file).
The lowdown: I did a 300 frame, 30 second 120 by 160 pixel movie in about half an hour using this method and a Quadra (Centris) 660av. Yes, it's slow, but the movie plays back extremely well, and compressed to about 260k.
This method is somewhat simpler than the GIF conversion method as described above, but it could be simpler if there existed a decent picttoppm converter - current converters can't seem to get around QuickTime-touched PICT files. If you manage to find one, please let me know!
Maynard Handley (maynard@elwing.otago.ac.nz) should receive a prize (and a job) for his latest update to the well-known Mac MPEG player Sparkle! Sparkle versions 2.0 and up will convert QuickTime movies to MPEG movies fairly quickly and very easily - it's as simple as opening a QuickTime Movie, selecting "Save As..." from the File menu and choosing "MPEG".
With this program, it's possible to step forward and backwards through MPEG movies, a feature rarely seen in MPEG players.
The latest version of Sparkle can always be found at the info-mac archives (or one of its mirror sites) at sumex-aim.stanford.edu
in the /grf/util directory
. Here's what you will need to run Sparkle:
ftp.apple.com
in the /dts/mac directory
. Although Maynard writes that this is an optional requirement, Sparkle runs much better with it. Read his documentation for more details.
I found that conversion seemed quite fast to me, especially having done so much conversion by hand! Using the default MPEG encoding settings I found compression to be adequate but the quality was quite good. Since Sparkle's encoder uses the code from Berkeley's encoder, try using the settings as described earlier in this documentation. They'll compress a 15 second 160 by 120 QuickTime movie to about 200k. You'll need to experiment to find the right compression and quality settings for your needs.
A nice QuickTime to MPEG converter has been made by Rainer Menes (menes@statistik.tu-muenchen.de) that works under MacMiNT, a custom multitasking environment. The package, which you can get by FTPing suniams1.statistik.tu-muenchen.de, includes a QT to YUV converter, as well as both the Berkeley and Stanford encoders, which will all do their thing (although a little slowly) on your Mac.
You will need a Mac with a 68030 processor and a 68881 FPU for the package to run. However, a 68020, 68030, and 68040LC machine should be able to run with softfpu 2.43, available at the Stanford archives.
Ranier has done a great job! The YUV converter will handle 24-bit QT files, improving the quality somewhat. Using the package and Berkeley encoder, I've been able to get a 24-bit, 20-second 160 by 120 MPEG down to 114k!
There are some things to keep in mind though:
For those who have new SGI Indy workstations, there's a pretty good solution. The "movieplayer" software recognizes and plays QuickTime movies! To make a playable movie, first follow the instructions on the (NCSA Mosaic and) QuickTime Guide.
Usually these movies have the suffix of ".mov". If the player doesn't recognize the suffix, try ".mv". Load up the movie in the player, then (using one of the menu options) save it out to frames on the local disk. This will save each frame of the movie into "fit" format, a strange SGI graphics format.
The following script should convert your fit files into ppm format. From there, follow the instructions that come with the Berkeley or Stanford encoders. Of all the software QT to MPEG methods, this one is the fastest. I've been able to convert three-minute QuickTime movies in at most half that time.
#! /bin/csh # This script converts all the files in a directory # if the files are of the form foo.xx # then call this routine as: fitall2ppm foo foreach file ($argv[1]*) imgcopy $file /tmp/$file.$$.rgb toppm /tmp/$file.$$.rgb $file.ppm rm /tmp/$file.$$.rgb end
For those looking for an X program that will play back QuickTime files, try "xanim", available at ftp.x.org. You may. however, need to convert your movie into the format as described in the QuickTime Guide (see above). xanim also recognizes FLI, FLC, IFF, GIF, RLE, AVI and other animation formats.
Good luck! Contact kevinh@eit.com for comments, etc. For other solutions and info, keep your eyes on the following resources:
atum.ee.upenn.edu
in the /dist/pkg/MPEGTool
directory.
/info/sft/
directory as qt-on-ibm.hqx
.
Last modified 6/7/94