Metal Gear Solid VP3

From MultimediaWiki
Jump to navigation Jump to search

The GameCube version of Konami's Metal Gear Solid: The Twin Snakes, developed by Silicon Knights, uses video files that contain VP3 video data. The files are packed in large game resource archive formats. Be advised that the file format described here explains files as extracted by Extractor-GTK.

File Format

All multi-byte numbers are big-endian.

The files are comprised of a series of chunks. Each chunk has the following layout:

bytes 0-3    0x0000000E
bytes 4-7    total length of the chunk
bytes 8-11   unknown; might be reserved and set to 0
bytes 12-15  length of the payload
bytes 16..   payload

Note that the chunks are 0-padded to 16-byte boundaries. Thus, the length of the payload + 16 does not necessarily equal the total length of the chunk.

The first chunk contains header information which has the following format:

bytes 0-3    close to the total size of the file, but not exact and should not be used
bytes 4-11   unknown
bytes 12-15  frame rate, expressed as a 32-bit IEEE floating point number
bytes 16-19  total number of video frames
bytes 20-23  video width in pixels
bytes 24-27  video height in pixels
bytes 28-39  unknown
bytes 40-43  video codec FourCC ('13PV', VP31 spelled backwards)
bytes 44-63  unknown

The remainder of the chunks contain video data compressed with the VP3 video codec.

The frame rate is stored as a 32-bit IEEE floating point number. A common value is 0x41F00000 which represents 30.0 frames per second.