Description of the Bink File Format by Mike Melanson (mike at multimedia.cx) v0.3: August 9, 2003 ======================================================================= NOTE: The information in this document is now maintained in Wiki format at: http://wiki.multimedia.cx/index.php?title=Bink_File_Format ======================================================================= Copyright (c) 2002-2003 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 * File Format * References * Acknowledgements * Changelog * GNU Free Documentation License Introduction ------------ Bink files are multimedia files used in a variety of video games, both on personal computers platforms and video game consoles. The files act as containers for data compressed with the proprietary Bink video and audio codecs. Bink multimedia files are known to bear the .bik extension. This document is based on empirical observations (hex dumps) of sample Bink media and should be regarded as "preliminary". File Format ----------- All multi-byte numbers are stored in little endian format. Bink files appear to start with a 56-byte header which is laid out as follows: bytes 0-2 file signature ('BIK') byte 3 possibly a file version number (e.g., 0x68, 0x69) bytes 4-7 file size not including the first 8 bytes bytes 8-11 number of frames bytes 12-15 largest frame size in bytes bytes 16-19 number of frames again? bytes 20-23 video width bytes 24-27 video height bytes 28-31 video frames per second bytes 32-35 image format bytes 36-39 unknown bytes 40-43 audio flag: if 0, header ends; if 1, header continues; bytes 44-45 audio channels (1 or 2) bytes 46-47 unknown bytes 48-49 audio sample rate bytes 50-55 unknown Following the header is a sample offset table. The number of entries in the table is equal to the number of samples specified in the header. Each entry consists of a 32-bit absolute offset for that sample. There is no length information, so the length of a sample is implicitly the difference between sample offsets. One frame contains both audio and video data (if both are present it the file). Bytes 12-15 (largest frame size) probably exist to provide the playback application with the largest single buffer it will have to allocate. References ---------- RAD GameTools, home of Bink Video: http://radgametools.com Acknowledgements ---------------- Thanks to Sean Kasun for further investigation into the format. Changelog --------- v0.3: August 9, 2003 - expanded header information v0.2: March 13, 2003 - licensed under GNU Free Documentation License v0.1: July 7, 2002 - initial release GNU Free Documentation License ------------------------------ see http://www.gnu.org/licenses/fdl.html