VFD(tm) Video for DOS Release 1.5 Copyright (c) 1994/95 by Bob Williamson CIS 76570,2752 VFD(tm) is a DOS command-line motion video cross-compiler for creating .FLC, .FLI and .AVI files from: Windows .DIB files (all BMP & RLE) Windows .BMP files (1, 4, 8, 16 & 24-bit) Windows .RLE files (4 & 8-bit, including deltas) IBM OS/2 .BMP files (1, 4, 8 & 24-bit) Truevision .TGA files (8, 16, 24 & 32-bit rle & uncmp) CompuServe .GIF files (PC & Mac 87a, 89a) *registered version* Zsoft .PCX files (8 & 24-bit) *registered version* Autodesk .FLC and .FLI files (all) Windows .AVI files (RLE and 8, 16, & 24-bit Full Frames) MPEG .RAW files produced by DMPEG.EXE v1.1 (8 & 24-bit) VFD will extract a numpic file series from FLC, FLI, RAW, and AVI (RLE & Full Frames only) in BMP, RLE, GIF, PCX or TGA formats. Direct conversion of FLC, FLI, AVI and single image formats is also supported. VFD uses an advanced method of color quantitization called Hilite Promotion (Scaleable Adaptive, Histogram-based). Hilite Promotion produces 8-bit motion video with high color fidelity and image resolution from a diverse range of image files and palettes by using scaleable quantitization (color reduction) and variable dither intensity. Hilite Promotion can be used to create an optimum palette containing both the most popular colors and the most diverse colors from the input images. Hilite Promotion was developed as a solution to the motion video color quantitization problem of multiple images and palettes. It may be used for building compatible Windows identity palettes for one or more bit-mapped images to be displayed by Windows, as well as motion video. PARAMS: VFD options may be invoked by use of command-line parameters. The parameters follow the infile, preceded by a space and either a forward slash '/' or a hyphen '-'. The params may be in any order and are case insensitive. Typing 'VFD ' will display a list of the options: VFD infile [params] -I create .FLI (default is .FLC) -An create .AVI n=1 8-bit Full Frames, n=2 RLE -En Extract numpic series n=1 8-bit .BMP, n=2 .RLE delta, n=3 .GIF n=4 8-bit .PCX, n=5,6,7: 8,16,24-bit .TGA uncmp -Sn playback Speed in frm/sec n=0.1 to 99 (default=15) -Ofname Outpath [d:\path\]fname (default fname=infile w/ outtyp .ext) -Tn1[,n2] Total frames n1=start, n2=total count (disables B2 pingpong) -Mn CoMpression n=1 50%, n=2 67%, n=3 75%, n=4 80%, ..., n=99 99% -Kn Keyframe interval n=1 to 65535 (Default is no keyframes) -Bn Backward n=1, pingpong n=2, mirror n=3, flip n=4 (B1,B2:numpic) -Rn Resize n=1 1/2, n=2 2x n=3 override dflt FLI aspect correction -Cn Color count n=2 to 255 (default=256) -Hn Hilite promotion (range 1 to 255) (default=256 most pop colors) -Dn Dither (intensity range 2 to 255) -Lñn[,c] Luminance n=1 to 255 (+ lite, - dark) (c=r,g,b: red,green,blue) -Wn Windows identity palette n=1 mapped, n=2 not mapped -Fn Fixed Windows id pal n=1 256 colr, n=2 gray, n=3 hlftne, n=4 b&w -Pn write Pal n=1 RIFF .PAL, n=2 DIB .PAL, n=3,4 AA,AAPro .COL, n=5 PicLab .MAP, n=6 PSP .PAL, n=7 NeoPnt .PAL, n=8 generic .PAL The infile may be any of the above listed image file formats. VFD will read a numpic series if wildcards ('*' or '?') are used in the file name. The infile may include the path. The output file path is the current default. Examples: VFD pretty00.bmp (produce a one frame .FLC PRETTY.FLC) VFD pretty*.rle (produce a 100 frame .FLC starting w/ pretty00.rle thru pretty99.rle named PRETTY.FLC) VFD d:\pretty\pretty??.rle -a2 -w1 (produce PRETTY.AVI with a Windows identity palette) VFD pretty.avi -i (produce PRETTY.FLI) MAKEFILE: Typing 'VFD -? ' will display the following: The infile for VFD may be a text file with the extension of .MAK which lists the source image files and optional keywords. If a motion video file is used in the makefile, it must be the only input image file. The keywords are: REPEAT_n (repeat the previous input file 'n' times) PINGPONG (read the previous numpic series in reverse order) BACKWARD (read the following numpic series in reverse order) MIRROR_ON (the following frames will be mirror-image) MIRROR_OFF (turn mirror-image off) FLIP_ON (the following frames will be inverted) FLIP_OFF (turn inverted off) KEYFRAME (the following frame will be a keyframe) CD-ROM (the AVI video chunks will be padded for CD-ROM playback) CROP_n1,n2,n3,n4 (n1=top, n2=left, n3=width, n4=height) zero base TRANSPARENT_r,g,b (the rgb color will be transparent - AVI only) TRANSPARENT_OFF (turn transparent off) Keywords are not case-sensitive. The comment character is a semicolon. Example text of PRETTY.MAK: ;216 frames, 320x240, identity pal pretty.pal d:\pretty\pretty00.bmp REPEAT_8 d:\pretty\pretty??.bmp d:\pretty\pretty99.bmp REPEAT_8 PINGPONG The above example will produce PRETTY.FLC containing 10 frames of pretty00.bmp, 98 frames of pretty01.bmp thru pretty98.bmp, 10 frames of pretty99.bmp and 98 frames of pretty98.bmp thru pretty01.bmp. The palette file pretty.pal will be used for the motion video palette. PINGPONG repeats the previous numpic series in reverse, omitting the first and last frames. The maximum frame count is 65535. The maximum makefile size is 16kb. Numpic series with the same base name are limited to a maximum of 5460 frames. VFD reads stdin for response to input prompts. VFD may be invoked in a batch file (.BAT) using redirection of a text file for input response. The system date, time and command line params are inserted as the first comment line in the makefile each time the makefile is processed by VFD. Input image files are opened read-only. The .MAK extension is not required on the command line. 'VFD pretty' is equivilent to 'VFD pretty.mak'. HILITE PROMOTION: Any combination of input image types and color formats (1 to 32 bit) may be combined in a VFD makefile. If the total color count exceedes 256, Hilite Promotion and dither should be used to obtain the optimum output for 8-bit video. VFD builds a popularity histogram of all the colors from the input images. The motion video palette consists of the 256 most popular colors less the Hilite Promotion value. The Hilites are then added to the motion video palette from the remaining colors in the histogram. The Hilites are selected as those colors in the histogram having the greatest difference from the colors already included in the motion video palette. If the '-Cn' (color count) option is used, the Hilite value is subtracted from the color count. Black, by default, is always the first color in the motion video palette. A Hilite value of 255 (true-cut) will produce results similar to the standard unbiased median-cut method of color reduction. With Hilite promotion, the palette colors are actual colors from the input images, not averaged colors. Lower Hilite values (-H128) will often produce the best results for motion video and generate a smaller file, as less dither is required. The lower value guarantees inclusion of the true most popular colors in the video palette. If reducing a single image, or making a slide show, use -H255 -D128 for best results. Motion video created from digital video capture (16/24-bit color) can be converted to 8-bit color motion video with very good results by using Hilite Promotion and dither. Start with -H128 -D20 and adjust up or down to produce the best result. For ray trace input, start with -H160 -D8. As Hilite value increases, the dither requirement decreases. DITHER: Dither will reduce or eliminate 'color banding'. Dither may be used even when the total color count is less than 256. VFD uses the 'Floyd-Steinberg' dither pattern in alternating direction (serpentine). The dither intensity (-Dn) is the maximum difference between the true pixel value and the motion video palette value that will be used in the error dispersion. Lower dither values produce less 'background animation'. COMPRESSION: Motion video compression (data rate reduction) may be achieved in two ways: Reduce the data content (image quality) of each frame, or by reducing the frame count and the playback speed by a corresponding amount. VFD uses the second of the two compression methods. VFD motion video image quality is always 100%. The range (-Mn) is n=1 50% to n=99 99%. Compression may be used with Extraction of a numpic series as well as motion video output. Example: -M1 write 1, skip 1, write 1, ... Speed/2 50% -M2 write 1, skip 2, write 1, ... Speed/3 67% -M3 write 1, skip 3, write 1, ... Speed/4 75% ... -M99 write 1, skip 99, write 1, ... Speed/100 99% Use of compression is recommended when processing 24 or 30 frame/sec input. PALETTES: The motion video palette may be output with the '-Pn' param. VFD reads and writes the following palette formats: -P1 RIFF .PAL (VFW PalEdit) -P2 DIB .PAL (Windows Paintbrush) -P3,4 AA,AAPro .COL (Autodesk Animator, AA Pro) -P5 ascii .MAP (PicLab - DOS Public Domain) -P6 ascii .PAL (Paint Shop Pro - Windows Shareware) -P7 ascii .PAL (NeoPaint - DOS Shareware) -P8 generic .PAL (Improcess - DOS Shareware) The programs in parentheses are applications that can read and edit the specific palette format. Ascii palette files may also be edited with a text editor. The edited palette may be used as the motion video palette by including it as the first file in the makefile. The Color count (-Cn) and Windows id pal (-Wn) params are disabled when a palette is read from the makefile. Windows Paintbrush will only read DIB palette files with 28 colors maximum. ID PALETTES: The Windows identity palette option (-Wn) will add the 20 reserved Windows system colors to the motion video palette. The 20 colors are subtracted from the color count prior to subtracting the Hilite Promotion value. The identity pal may be mapped (-W1) or not mapped (-W2) to the motion video palette. VFD maps the closest color in the motion video palette to the color in the input image using the spherical distance method. Some motion video, while requiring the identity pal for compatibility under Windows, will look better when mapped only to the colors from the input file (-W2). FIXED PALETTES: VFD provides 4 fixed palettes: -F1 = 256 color Windows identity pal -F2 = 32 color grayscale Win id pal -F3 = 32 color halftone Win id pal -F4 = black & white Windows id pal The -F1 default is mapped identity pal. The -F2, -F3 and -F4 defaults are not mapped identity pal. The defaults may be overridden by use of the -W1 or -W2 params. Example: -F4 -W1 will use the 20 color Windows identity palette (b&w are id colors) -F4 -D128 for dithered b&w output The Luminance '-Lñn[,c]' param color channel option '[,c]' may be used to change the tint of the grayscale and halftone palettes. The '-Cn' color count param is disabled when a fixed palette '-Fn' is used. RESIZE & ASPECT: The '-R1' param will halve the vertical and horizontal dimensions of the input image. Example: 640x480 -> 320x240. The -R2 param will double the vertical and horizontal dimensions of the input file. Example: 320x240 -> 640x480. VFD prompts for screen aspect correction to high resolution mode if the source files are 320x200 and the output format is .FLC or AVI. If the source files are not 320x200 or 160x100 and the output is .FLI, the images are corrected from high resolution mode to FLI aspect by default. Default FLI aspect correction may be overridden by using the -R3 param. The maximum input and output image size is 1024x768. Input image size for .FLC and .AVI output must be consistant. Input image size for .FLI output may vary from a maximum of 640x480 (the output for .FLI will always be 320x200, with image centered). Sequence of geometic operations: Resize 1/2 Mirror Resize 2x Crop Aspect CONVERTING AVIs: Many .AVI files are compressed with formats for which there are no Public DOS drivers. These files must be converted to RLE or Full Frames with VFW VidEdit or a similar Windows program for use with VFD. If the AVI is 8-bit color, save the file as RLE or 8-bit Full Frames. For 16 & 24-bit AVIs, save the file as a 16 or 24-bit Full Frames. When saving in RLE format for VFD input, set the target to custom, no data rate, no keyframes, no CD-ROM padding, and set quality at 100%. If the data rate is not set to a high value, data may be lost when converting to RLE compression using VidEdit. AVIs created with VFD may be converted to other compression options with VidEdit. If VidEdit returns 'out of memory' errors when converting RLE compressed AVIs, use VFD to add keyframes (-K15 -A2). If you do not already have Video for Windows, it is free for the asking, and includes VidEdit, PalEdit, and WavEdit. (VFW is no longer offered for retail sale.) On CIS, download JSCD.TXT, 305 bytes, 13-Jul-94, from the WINMM forum. For those without CIS access, this is the text file verbatim: >> To get the Jumpstart CD: >> 1. Send a Fax to (206)936-7329 attn: MMDRG/Jumpstart. >> 2. Send an Internet Email message to mmdinfo@microsoft.com >> The CD is free for a limited time only. Act today, operators >> are standing by, etc, etc. >> Happy Coding, >> Rick Segal, Manager, Developer Relations >> Microsoft RLE DELTAS: Deltas are the differences between the current frame and the previous frame. Delta encoding uses line and column skips to create transparency. When a delta input series is processed, the frames are overlayed with the transparent portion unchanged from the previous frame. Delta input series may not be dithered with VFD. If dither is required, the delta series should be extracted from a motion video that was created using dither. VFW BitEdit, Paint Shop Pro (Windows Shareware), and AAWIN (Freeware Autodesk player for Windows) read and display RLE deltas correctly. The first frame of a RLE delta series is a keyframe (opaque), and the following frames are all deltas (transparent except for changes from the previous frame). Full frame (opaque) RLE series may be extracted by using the Keyframe param: -E2 -K1. CHROMA KEY OVERLAYS: Titles, copyright notices, etc. may be added to motion video using transparent RLE delta overlays. First, make a title frame using any paint or drawing program, and save it as TITLE1 (in any VFD compatible image format). Then create a make file using the TRANSPARENT_rgb keyword to set the background invisible, and extract the RLE delta. The makefile (title1.mak) should look like this: TRANSPARENT_0,0,0 ;black title1.bmp Now extract a RLE delta series from the motion video. Example: VFD pretty.avi -e2. Rename the first RLE image (pretty00.rle) as first.rle. Create a makefile (pretty.mak) as follows: first.rle title001.rle repeat_20 ;optional first.rle ;optional pretty*.rle 'VFD pretty -a2' will produce a new AVI with the title frame overlaying the first frame. If the color count exceeds 256, use the '-Cn -Hn -Dn' params to reduce the color count for the RLE delta series extracted from the orginal motion video. SPEED: VFD may be used to produce slideshows as well as motion video. Playback speed range is from 0.1 to 99 frames/sec. Fractional rates above 1 frame/sec are not supported. Some .FLC & .FLI players do not accept speed values less than 1 frm/sec. VFD produced .AVIs with speeds less than 1 frm/sec may be converted with VFW VidEdit to other compression types and retain a speed of less than 1 frm/sec, even though VidEdit v1.1 will only set rates of 1 to 99 frames/sec. Example: -S.1 = 10 seconds per frame -S.2 = 5 seconds per frame -S10 = 10 frames per second When using VFD to create looping AVI slideshows, the REPEAT_1 makefile keyword should be used to repeat the last frame for play with Win MCI. DATA RATE: The data rate required for playback is displayed for .FLC, .FLI. & .AVIs when they are rendered by VFD. The first frame of .FLCs & .FLIs is ommitted from the calculation because it is displayed only one time, and then replaced by the ring frame. The ring frame is a delta of the last and first frames. AVIs do not have a ring frame. The coMpress (-Mn) param may be used with a corresponding percentage reduction in playback speed to reduce the data rate (and file size) while maintaining the same apparent speed. TOTAL FRAMES: If extracting from motion video when the start frame (-Tn1) is greater than 1, the first extracted frame will be a delta. To make the first frame a keyframe, use VFD to create a video with a Keyframe interval (-Kn) syncronized with the start frame value (n1), and then the start frame will hit the keyframe. Example: to extract a 100 frame FLC starting at frame 157, use 'VFD pretty.flc -k157 -otmpfle', then 'VFD tmpfle.flc -t157,100 -opretty2'. If the Total frames param is used with the Backwards param (-B1), the start frame is the highest numbered frame defined by the Total frame param. Example: to skip the first file in a 100 frame series using the -B1 param: -T1,99. (its backwards) KEYFRAME INTERVAL: Keyframes (-Kn where n=1 to 65535) and the KEYFRAME makefile keyword may be used when creating FLC, FLI, RLE compressed AVI, and for RLE delta extraction. The default is no Keyframes. Keyframes may be useful in video editing, but are not necessary for playback in VFD produced motion video, as the image quality is always 100%. Keyframes may also be useful in AVIs with a programmed or script-driven player that seeks to specific frames in response to user input. Extraction of all full frame RLE images may be accomplished by using the -E2 -K1 params. PADDING: Padding will improve the data through-put of AVIs when played from CD-ROM. To add padding, place the 'CD-ROM' keyword in the makefile prior to the image files. The default is no padding. The CD-ROM keyword is ignored for FLC and FLI output. CTRL-BRK: Use of CTRL-BRK will terminate VFD at any point in processing. AUDIO: VFD skips over audio tracks in input files. VFW VidEdit and WavEdit or similar Windows programs may be used to add audio to VFD produced .AVIs. MPEG: DMPEG v1.1, a Public Domain MPEG viewer and extractor by Stefan Eckart, is included with VFD. DMPEG.EXE will extract a .RAW file from MPEG Type 1 files (see the DMPEG.DOC file). For best results, the .RAW file should be extracted in 24-bit format for VFD input (DMPEG -d4). VFD Hilite value of 128 and dither value of 20 usually produce very good results from 24-bit RAW input. Compress (-M1) and Speed (-S15) will convert the frame rate from 30 frm/sec to 15 frm/sec while retaining the apparent speed of the origional MPEG video. Many .RAW files can be compressed even more by using '-M2 -S10' or -M3 -S8'. The Luminance param '-Lñn[,c]' will be useful with some MPEG conversions. JPEG: VFD does not accept .JPG input files. JPG files are 24-bit color lossy compression and must be converted to another file format for input to VFD. For best results, use Paint Shop Pro (Shareware by JASC, Inc.), to reduce the JPG file to 16-bit color and save as a 16-bit compressed TGA file. Then use VFD with Highlite promotion to render the TGAs. Another option producing good results is to use JPG2GIF v2.0, a Freeware program by Handmade Software. JPG2GIF is a DOS command-line utility that may be run in batch mode to convert JPG to GIF. The programs are avaliable on CompuServe in the GRAPHSUP forum, Format Conversion library, as PSP.ZIP and GIF2JP.ZIP. MEMORY & SYSTEM REQUIREMENTS: VFD.EXE is a DOS real-mode application requiring 500Kb free conventional memory and 96Kb XMS memory for processing 320x200 images. Larger image sizes require additional XMS memory. DOS 3.1 or greater, 80286 or greater, 4Mb RAM required. At least 2Mb XMS memory should be configured using HIMEM.SYS or equivilent. A SVGA video card is required to play 256 color .FLC and .AVI files. FLI files use only the standard VGA video modes. The VFW runtime and 8Mb Ram is required to play AVIs with the Windows v3.1 MCI player. MOTION VIDEO SOURCES: The following CompuServe forums are sources for motion video: ENERGY: AVI ASOFT: FLC, FLI GRAPHDEV: FLC, FLI, MPG, AVI SPACE: MPG, AVI (NASA uploads) WINMM: AVI (also VFW SDK, incl full VFW) WINFUN: AVI The VFW runtime is in the ENERGY forum and the Autodesk runtime for Windows (WINPLA.EXE) is in the ASOFT forum. Several FLC/FLI players for DOS are in the GRAPHSUP forum. TECHNICAL SOURCES: VFD is written in MASM 6.1 using file format specifications found in the Windows SDK and the following: CIS:ASOFT: FLCSPC.ZIP CIS:WINMM: VFW SDK v1.1 Zsoft Corporation Technical Reference Manual, 1991 CompuServe Graphics Interchange Format(sm), 1990 Truevision Targa File Format Specification v2.0, 1991 Much credit is due David Hoffmann, Michael Koch, and Vince Pilgrim for their patient counsel and beta test bug reports. SUPPORT: VFD continues to be upgraded with new features. For the latest version, GO GRAPHSUP on CompuServe and download VFD.ZIP from the Format Conversion library section. VFD support is provided on CompuServe in the Graphics Support forum (GO GRAPHSUP). Leave a message in the Format Conversion section for prompt response. Direct support is also provided from Internet at: 76570.2752@compuserve.com The author of VFD may be reached at the following address: (For credit card registration orders, see below.) Bob Williamson PO Box 172349 Arlington, TX 76003-2349 U.S.A. SHAREWARE: VFD is copyrighted software that is marketed as Shareware. The Shareware version of VFD may be used for a 30 day trial period, after which registration is required for continued use. The registered version of VFD includes input/output file formats that are not included in the Shareware version. The Shareware version of VFD may be placed on computer bulletin boards and distributed on diskette by Shareware vendors, if priced less than $7.00. VFD may not be distributed bundled with other software or hardware, on CD-ROM, or included on diskette with a book, magazine or other product without the written permission of the author. VFD(tm) is a trademark of Bob Williamson, CIS 76570,2752. REGISTRATION: Single-copy registration of VFD is $39.00. The following discount schedule applies to quantity and site licenses: 2 to 4 copies $29.00 each 5 to 9 copies $24.00 each 10 or more copies $19.00 each One copy of the VFD software and documentation file is shipped with each quantity order. The license provides for the stated number of copies to be in use at the site of the purchaser. Registered users will be notified by mail of upgrade opprotunities and new products as they become avaliable. The next VFD upgrade following registration is sent free to registered users. Subsequent upgrades are half-price to registered users if ordered directly from the author, with the following upgrade free. Corporate Purchase Orders and checks for VFD registration may be mailed directly to the author at the PO Box address listed under Support. Checks should be payable to Bob Williamson in US dollars and drawn on a US bank. International Postal money orders are also accepted. Please include $4.00 S&H ($6.00 overseas) with each order. CREDIT CARD ORDERS: You can order with M/C, VISA, AMEX, or DISCOVER from Public software Library by calling 800-242-4775 or 713-524-6394 or by FAX to 713-524-6398 or by CIS Email to 71355,470. You can also mail credit card orders to: PsL PO Box 35705 Houston, TX 77235-5705 U. S. A. There is a $4.00 S&H charge ($6.00 overseas) on all orders. The above numbers are for orders only. ORDERS FROM UK: Registration and/or orders can be sent by phone, fax, mail or email to: Digital Workshop First Floor 8 West Bar BANBURY Oxon OX16 9RR England Tel: +44 (0)1295 258335 Fax: +44 (0)1295 254590 CIS: 74431,1160 Internet: 74431.1160@compuserve.com Access, Mastercard, VISA, American Express, and Delta welcome. Cheques, money orders and postal orders payable to Digital Workshop. ORDERS FROM GERMANY, AUSTRIA, SWITZERLAND: Holin Datentechnik Buchrainweg 61 63069 Offenbach Germany Tel: ++49 69 833587 Fax: ++49 69 845242 CIS: 100441,1366 Internet: mholin@bla.robin.de Mastercard, VISA, American Express, Diners Club welcome. Checks, money orders and postal orders payable to Holin Datentechnik. NOTICE: You accept this program and files with the understanding that the author makes no representations or warranties as to the suitability of this program for your particular purpose, and that to the extent you use or implement this program in your own setting, you do so at your own risk. In no event will the author be liable for any damages, whether consequential, incidental, or special, arising out of the use or inability to use the program. REVISION HISTORY: Version 1.0 05/16/94 (CD-ROM release Aug '94) ______________________________________________________________________ Version 1.1 07/05/94 General revision too extensive to detail. _______________________________________________________________________ Version 1.2 07/23/94 Maximum image size increased from 640x480 to 1024x768. _______________________________________________________________________ Version 1.3 08/25/94 Verifies AVI infile index - if bad, walks RIFF chunks for processing. Reduced XMS requirement. Included GeeWiz, the Freeware AVI player for DOS. _______________________________________________________________________ Version 1.4 10/10/94 Improved processing speed for Repeat frames & compress (skipped frames). Improved processing speed for Luminance option. Write Palette option is now independent from extract/create options. Writes AVI index records for 64k frames maximum (was 4096). Added FLIP_ON and FLIP_OFF makefile keywords. Added doc reference on how to obtain free copy of Video for Windows. ----------------------------------------------------------------------- Version 1.5 12/21/94 Added Flip command line param (-B4). VFD & GeeWiz now read AVI capture files with audio correctly. Numpic series are sorted on filename & extension (was filename only). Added TRANSPARENCY_r,g,b makefile keyword. Added 16 and 24-bit TGA extract (registered version).