/**********************************************************************/ /* */ /* documentation to create mpeg files from AVS */ /* */ /* 15 dec 1993 */ /* P. Fulconis (CICG computer center of grenoble university (France)) */ /* */ /**********************************************************************/ Introduction ------------ ``image to YUV'' module writes AVS images (created by Geometry Viewer, for example) in yuv format. ``image to PPM'' module writes AVS images in ppm format. Both formats can be read by mpeg encoder. A ppm image will have a memory size twice bigger than the yuv one, but it can be visualised by xv. Both modules also create the parameter file for the mpeg encoder. example of network : geometry viewer | | Image to YUV compilation of the modules : -------------------------- to compile write_ppm and write_yuv : after have modified the makefile (HOME, WRITE), make or make all (compilation of the 2 modules) or make write_ppm or make write_yuv "image to YUV" and "image to PPM" modules : ----------------------------------------- - File name : name of image files created The number of current image and the .yuv (or .ppm) extension is added by the system. (ex: image3.yuv) these files are written in the directory $HOME/AVS/Images, if this directory exists, or in the current directory. - img number : number of the current image (not written yet) - reset : reset of the image number (this number is also reseted when file name changed) - on : on/off switch - on_next : switch 'on' at the next time the current image is not written this is usefull when we want to read a sequence of images using Animator (the first image written will be the first displayed) - param : create the parameter file for mpeg encoder .param this file is written in the directory $HOME/AVS/mpeg, if this directory exists, or in the current directory. - mpeg_encode : creation of the mpeg file - mpeg_play : play the mpeg file Creation of the mpeg file (without AVS): ------------------------- When yuv (or ppm) images, and the parameter file (.param), are created, execute mpeg_encode The image file .mpg will be created To read (play) mpeg file : mpeg_play Sources for public domain files not included here ------------------------------------------------- 1) get mpeg_encode via anon ftp: toe.berkeley.edu:/pub/multimedia/mpeg/{README-mpeg_encode,mpeg_encode-1.2.tar.Z} Name: toe.CS.Berkeley.EDU Address: 128.32.149.117 Aliases: toe.berkeley.edu 2) get mpeg_play via anon ftp: toe.berkeley.edu:/pub/multimedia/mpeg/{README-mpeg_play,mpeg_play-2.0.tar.Z} Name: toe.CS.Berkeley.EDU Address: 128.32.149.117 Aliases: toe.berkeley.edu 3) you can get the following files via anonymous ftp as well, in case you're not using an IBM RS/6000 platform, in which case they're already here for you -rwxrwxr-x 1 avs 14852 Nov 23 1992 arg.h* -rwxrwxr-x 1 avs 11534 Nov 23 1992 bin.h* -rwxrwxr-x 1 avs 29938 Nov 23 1992 im.h* -rwxrwxr-x 1 avs 1047665 Nov 23 1992 libim.a* -rwxrwxr-x 1 avs 86592 Nov 23 1992 libsdsc.a* -rwxrwxr-x 1 avs 5295 Nov 23 1992 sdsc.h* -rwxrwxr-x 1 avs 14798 Nov 23 1992 sdscconfig.h* -rwxrwxr-x 1 avs 8231 Nov 23 1992 tag.h* ftp.sdsc.edu:/pub/sdsc/graphics/imtools/ (there are a bunch of diferent platforms supported) Name: rosebud.sdsc.edu Address: 198.17.47.33 Aliases: ftp.sdsc.edu There's a couple of files out there under /pub/sdsc/graphics/imtools/ (there are a bunch of diferent platforms supported). You will need to grab imtools_v2.1.tar.Z and libsdsc_v2.1.tar.Z, uncompress and untar them, and you will find the .h and other files in there. 4) create libppmyuv.a from the mpeg_encode-1.2.tar.Z file you downloaded in step 1) above. Insert in the Makefile of mpeg_encode-1.2/misc the lines: lib: ppmtoyuv ar ruvl libppyuv.a $(O)/ppmtoyuv You have to add in the original ppmtoyuv.c file (from mpeg_encode-1.2/misc) this function : extern int ppm2yuv (FILE *fin, FILE *fout, int *h, int *w) ; int ppm2yuv (FILE *fin, FILE *fout, int *h, int *w) { if ( ! ReadPPM(fin) ) { fprintf(stderr, "Error reading PPM input file!!!\n"); return(-1); } PPMtoYUV(); WriteYUV(fout); *h = height; *w = width; } Just for info, here is the main function (which is very similar) : void main(int argc, char **argv) { if ( ! ReadPPM(stdin) ) { fprintf(stderr, "Error reading PPM input file!!!\n"); exit(1); } PPMtoYUV(); WriteYUV(stdout); } And, of course, now you need to execute 'make lib'.