"1-Hit Wonder" Multimedia File Formats by Mike Melanson (mike at multimedia.cx) v1.2: December 3, 2004 ======================================================================= NOTE: The information in this document is now maintained in Wiki format at: http://wiki.multimedia.cx/index.php?title=MUX http://wiki.multimedia.cx/index.php?title=Novastorm_Media http://wiki.multimedia.cx/index.php?title=DFA http://wiki.multimedia.cx/index.php?title=BFI http://wiki.multimedia.cx/index.php?title=BRP http://wiki.multimedia.cx/index.php?title=PMM http://wiki.multimedia.cx/index.php?title=VID http://wiki.multimedia.cx/index.php?title=SIFF ======================================================================= Copyright (c) 2004 Mike Melanson Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". Contents -------- * Introduction * Chaos Control MUX * Novastorm Media * Chronomaster DFA * Tsunami BFI * Argonaut BRP * Krazy Ivan PMM * Bram Stoker's Dracula VID * Lost Vikings 2 SIFF * References * Acknowledgements * Changelog * GNU Free Documentation License Introduction ------------ Many games use their own custom multimedia transport formats for full-motion video (FMV). Many of these formats follow certain patterns that are easily dissected through visual inspection of the format. These games were generally published at the earlier part of the FMV genre (mid- to late-1990s) and were designed to work under MS-DOS on computers equipped with with VGA 256-color monitors and original Sound Blaster audio cards. One of the most common patterns is the FOURCC/size chunk format. Other visual clues include looking for common resolutions encoded close to the start of the file (e.g., 320x200, 320x240, 640x480), common audio sampling rates (e.g., 11025, 16000, 22050, 44100, as well as the common Sound Blaster frequencies such as 11127 and 22254), VGA palettes, and chunks of silent, unsigned, 8-bit PCM audio (lots of 0x80 values +- 1..3). This document is an effort to document a variety of multimedia file formats that were typically only found on one game, hence the title, "1-Hit Wonder" Multimedia File Formats. Chaos Control MUX ----------------- In 1995, Philips/Infogrames/I-Motion published a game called Chaos Control. Its CD-ROM contains 4 files: A game executable, an installation executable, a readme.txt file, and a 200 MB chaos.gb resource file which contains the game's data. Some of the data files have the extension .mux. These are apparently FMV files. All multi-byte number are little endian. The file format is laid out as follows: bytes 0-27 unknown bytes 28-29 video width bytes 30-31 video height bytes 32-16383 frame offset table Each frame offset is 32 bits. There is enough space in the chunk offset table for 4087 media chunks. The top 2 bits of each offset always appear to be 1 (so the top byte of the chunk is always 0xC0), so these are probably flags of some sort. The last entry in the table is all 1s (0xFFFFFFFF) and the remainder of the table is all 0s. Frames contain 1 or more chunks, each of which are formatted in a manner that is reminiscent of the Autodesk FLIC format: bytes 0-1 chunk type bytes 2-5 chunk size, not including this 6-byte header bytes 6.. chunk payload Known chunk types appear to include: 0007 unsigned, 8-bit PCM audio 0070 apparently a palette chunk, 0x300 (768) bytes, and each component is 8 bits (not 6 bits, like VGA palettes are normally stored) 006F video chunk 0005 frame count: 2-byte payload contains frame number The video coding format is presently unknown. Novastorm Media --------------- Novastorm is a 1994 DOS-based game from Psygnosis. The disc contains many multimedia files with a variety of extensions, most commonly .fa or .flm. The files share a combination of fourcc types and there is no one right way to assemble the files. Different files use the components they need. All multi-byte numbers are little endian. The fourcc chunk format used in these files is: bytes 0-3 chunk type bytes 4-7 chunk size, not including 8-byte preamble bytes 8.. chunk payload Observed fourcc types include: * SHED: Sound HEaDer, 8-byte payload: byte 0 probably a Sound Blaster frequency byte bytes 1-3 unknown bytes 4-5 size of an audio frame (SAMP chunk) bytes 6-7 unknown * PCFM: Video header? 6-byte payload: bytes 0-1 number of frames in file bytes 2-5 unknown * SPAL: VGA palette: bytes 0-3 chunk size, including this size field bytes 4.. RGB triplets, 6-bit palette components * SAMP: audio SAMPle: bytes 0.. unsigned, 8-bit PCM audio data * FRAM: video FRAMe: bytes 0.. compressed video frame * EOFL: End Of FiLe (empty chunk) * HMSK: unknown Some files contain only a SAMP chunk and are audio-only. Some files are only meant to be animation files and carry PCFM, SPAL, and a series of FRAM chunks, but no audio information. More commonly, a file with both audio and video will begin with a SHED chunk followed by a PCFM chunk and a SPAL chunk. Then, any number of SAMP and FRAM chunks will be interleaved until the EOFL chunk is encountered. Note that there is speculation regarding the fraemrate calculation. Many of the files appear to have a 0xC1 byte in byte 0 of the SHED payload. According to the Sound Blaster frequency formula: sample rate = 256 - (1000000 / (signed) divisor byte) 0xC1 = -63 sample rate = 256 - (1000000 / -63) = 16129 Hz In the same files, the length of an individual SAMP chunk is usually 1133 bytes. 16129 / 1133 = ~14.2 It is possible that these files are meant to be played at 14-15 fps. The details of the video coding format are presently unknown. Chronomaster DFA ---------------- A DOS-based game called Chronomaster includes files with the extension .dfa which appear to be animation files. All multi-byte numbers are little endian. These files are comprised of chunks with 12-byte preambles: bytes 0-3 chunk type bytes 4-7 chunk size, not including 12-byte preamble bytes 8-11 unknown bytes 12.. chunk payload A DFA file begins with a 128- (0x80-)byte header: bytes 0-3 file signature: 'DFIA' bytes 4-127 unknown (mostly 0s) Chunk types include: PAL1 768-byte chunk containing a VGA 6-bit palette TSW1 video frame? DSW1 video frame? EOFR end of frame, empty chunk Based on the relative occurrence frequencies of the TSW1 and DSW1 frame, T-frames may be intracoded while D-frames are intercoded. The details of the video coding format are unknown. Tsunami BFI ----------- Blue Force by Tsunami is at least one game that uses a multimedia format with the extension .bfi. All multi-byte numbers are little endian. The general fourcc chunk format is as follows: bytes 0-3 chunk type bytes 4-7 chunk size, including 8-byte preamble bytes 8.. chunk payload A BFI file begins with the following header: bytes 0-3 file signature: 'BF&I' bytes 4-7 total file size bytes 8-11 total header size bytes 12-15 frame count bytes 16-43 unknown bytes 44-47 video width bytes 48-51 video height bytes 52-55 framerate bytes 56-59 number of valid palette entries (?) bytes 60-827 256 RGB triplets (6-bit VGA palette values) bytes 828-831 audio sample rate bytes 832-835 audio channels (?) bytes 836-959 unknown The media frames follow the header. Each frame is packaged inside a chunk with the fourcc 'IVAS' (possibly Interleaved Video and Sound). A IVAS chunk has the following payload: bytes 0-11 unknown bytes 12-15 size of audio data bytes 16..n unsigned, 8-bit PCM audio data bytes n.. encoded video data The details of the video coding are presently unknown. Argonaut BRP ------------ At least 2 games use an animation format with the extension .brp: F/X Fighter and Alien Odyssey, both by Argonaut. The general container formats used in both games are similar, but differing fourccs inside may indicate that the games used different video coding algorithms (which are presently unknown). All multi-byte numbers are little endian. The fourcc chunk format is as follows: bytes 0-3 chunk size, not including 12-byte preamble bytes 4-7 chunk type bytes 8-11 unknown bytes 12.. chunk payload A BRP file begins with the following header: bytes 0-3 file signature: 'BRPP' bytes 4-7 version number bytes 8-11 unknown, but always seems to be 307200 in decimal which, for trivia, is the product of 640 * 480 bytes 12-15 fourcc: 'BVID', possibly a file sub-type bytes 16-31 unknown bytes 32-35 total number of video frames in file bytes 36-39 video width bytes 40-43 video height bytes 44-47 possibly video depth (8-bit, palettized video) There are 2 known versions: 1 and 2. The version 1 file proceeds as follows: bytes 48-55 unknown A version 2 file header proceeds with a BASF chunk which appears to have an unknown 8-byte payload. This is followed by a 'ASF\0' chunk which has an 0x18-byte payload. Bytes 8-15 of this payload appear to be the 8 bytes of the DOS base filename (e.g., file 'foo.brp' would contain 'foo' with 5 0s after). The rest of the payload is unknown. The next 4 bytes of a v2 header contains the length of the remainder of the header, minus 12 bytes. An audio sample rate sits occupies 2 bytes in the space 16 bytes after these four bytes. The rest of the header is unknown. However, the presence of what looks like an audio sampling rate strongly indicates that these files carry audio data. Following the header is a 'PAL8' chunk (presumably, this would only occur in a 8-bit file if other bit depth files exist). This chunk contains full 8-bit RGB palette triplets. The video frames follow the header and palette chunk. In F/X Fighter, there are 2 frame types: AVCF and ALCD. Based on their relative occurrence frequencies, AVCF frames may be intracoded while ALCD frames are intercoded. In Alien Odyssey, only the fourcc MAD1 is used to indicate a video frame. Krazy Ivan PMM -------------- The game Krazy Ivan uses multimedia files with the extension .pmm. All multi-byte numbers are little endian. The general fourcc chunk format is as follows: bytes 0-3 chunk type bytes 4-7 chunk size, not including 8-byte preamble bytes 8.. chunk payload A PMM file begins with the following header: bytes 0-3 file signature: 'PIFF' bytes 4-7 total file size, not including first 8 bytes bytes 8-11 fourcc: 'PXMT' bytes 12-15 fourcc: 'PXMH' bytes 16-19 size of header bytes 20-39 unknown bytes 40-71 apparently a freeform, NULL-terminated string that desribes certain video properties, e.g., "Windows 15Hz X2"; this example gives away the framerate and, given that the video resolution does not appear to be encoded anywhere else, may present some special coding for the width and height with 'X2' bytes 72-73 audio sample rate byte 74 audio channels (?) byte 75 audio bytes/sample (?) bytes 76-83 unknown Following the header is a CPAL chunk (provided that the file has 8-bit video). This contains a number (not necessarily 256) of RGB palette entries, 8-bit range. Afterwards, there are a number of audio and video chunks. The first chunk appears to be a MPAL chunk which is quite large. Following that are a series of AUDO chunks which contain PCM audio, and BODY chunks which presumably carry encoded video. Details of the video coding method are unknown. Bram Stoker's Dracula VID ------------------------- Bram Stoker's Dracula for the Sega CD video game console, developed by Psygnosis and published by Sony, uses a custom FMV format with the extension .vid. All multi-byte numbers are big-endian. The general fourcc chunk format is as follows: bytes 0-3 chunk type bytes 4-7 chunk size (not including 8-byte chunk preamble) bytes 8.. chunk payload A VID file starts with the following 12-byte ASCII signature: 'FORMPSYGxxxx'. Following the signature is a SANM chunk. This chunk has a 0x46-byte payload, the contents of which are all unknown. The next chunk is a SPAL chunk which is most likely a palette chunk. This always seems to have a 0x82-byte payload. The remaining chunk types are SAUD, SBIT, and SMAP. A SAUD chunk contains a block of sign-magnitude 8-bit PCM audio. Video frames apparently consist of a SBIT chunk followed by a SMAP chunk. SMAP chunks are always the same size throughout a given file. SBIT chunks are variable size and are probably Sega Genesis tile maps in some format, while SMAP chunks define how to put the video data together. Lost Vikings 2 SIFF ------------------- In 1996, Beam Software developed a games called The Lost Vikings II (a.k.a. Norse By Norse West: The Return of the Lost Vikings). The PC version of this game uses a multimedia format with the file signature 'SIFF'. The format can transport audio and video (which are .vb files) or just audio (which are .son files). The general fourcc chunk format is as follows: bytes 0-3 chunk type bytes 4-7 chunk size (not including 8-byte chunk preamble) bytes 8.. chunk payload It is important to note that in the fourcc chunk preamble, the size field is big-endian. However, all other multi-byte numbers in the file are little-endian. A VB file begins with a 'SIFF' file signature, followed by the total length of the file, minus 8 bytes. Bytes 8-11 contain the version fourcc, e.g. 'VBV1'. Then comes the header, which is laid out as follows: bytes 0-3 header fourcc ('VBHD') bytes 4-7 header length (should be 32 == 0x20) bytes 8-9 unknown, but might be header version bytes 10-11 video width bytes 12-13 video height References ---------- Sample files for many of these formats can be found here: http://mplayerhq.hu/MPlayer/samples/game-formats/ Acknowledgements ---------------- Thanks to Jim Leonard (trixter at oldskool.org) for suggestions and corrections. Changelog --------- v1.2: December 3, 2004 - Lost Vikings 2 SIFF v1.1: April 10, 2004 - Bram Stoker's Dracula VID v1.0: March 24, 2004 - initial release GNU Free Documentation License ------------------------------ see http://www.gnu.org/licenses/fdl.html