Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Bink video (BIK, KB2)

From ReverseEngineering.wiki
Format
Developer RAD Game Tools (Epic Games)
Magic BIK? or KB2? (4th byte = revision letter)
Extensions .bik, .bk2, .bik.ps3, .xmv, .vid
Endianness little
License proprietary; readers: FFmpeg, vgmstream
On this wiki Facts · Code · Notes · Topics

RAD Game Tools' video container and codec (.bik Bink 1, .bk2 Bink 2): magic BIK or KB2 plus a revision letter, a header with frame count, size, frame rate and audio track table, an index of frame offsets and frames holding one audio packet per track plus the video packet.

Identification

  • Bytes 0-2 BIK (Bink 1) or KB2 (Bink 2), byte 3 is the revision letter: Bink 1 b, d, f, g, h, i, k (no j; i and later were used after 2000, earlier ones around 1999); Bink 2 a, d, f, g, h, i, j, k, m, n (no l). Players accepted 1: f-k and 2: f-n in the reference binkplay at the time vgmstream's author checked.
  • Extensions .bik, .bk2; seen renamed .xmv (Reflections), .bik.ps3, .bik.xen, .vid (various Neversoft/Etrange Libellules titles).
  • Header (all little-endian): 0x04 file size minus 8, 0x08 frame count, 0x0C largest frame, 0x10 frame count again, 0x14 width, 0x18 height, 0x1C and 0x20 frame-rate dividend and divider (2997/100 = 29.97), 0x24 video flags, 0x28 number of audio tracks. Then (from 0x2C) extra words depending on the revision and flags, per track: max packet size, sample rate with flags, stream id; then one 32-bit offset per frame (bit 0 = keyframe) and a last entry equal to the file size. See Fact:Bink video (BIK, KB2)/struct/Bink header.
  • Audio flags: bit 13 stereo, bit 12 transform (1 DCT, 0 DFT); DFT was used mainly in 1999-2004 files. A frame starts with, for every audio track, a 32-bit packet size and then the audio data (its first 32 bits are the decoded byte count), followed by the video packet.
  • Video flags: bits 28-31 scaling (doubled, interlaced), bit 20 alpha plane, bit 17 grayscale.

Detecting the library in a game

The runtime is binkw32.dll (Bink 1, 32-bit) or bink2w64.dll (Bink 2, 64-bit) next to the executable, or statically linked; binkw64.dll and bink2w32.dll are reported but not confirmed in the code checked. Imports of the 32-bit DLL are stdcall decorated: _BinkOpen@8, _BinkDoFrame@4, _BinkNextFrame@4, _BinkClose@4; the 64-bit DLL exports undecorated BinkOpen, BinkDoFrame... See Library:Bink Video for the export list and call sequence.

Related

Technique:Game audio and video middleware, Format:CRI USM.

Code & repositories

  • https://github.com/vgmstream/vgmstream @ db77f98f405a45ad08df98aa444cae3848f95e6c · license: ISC (declared by the contributor; GitHub's detector did not recognize COPYING)
    vgmstream (ISC): reads FSB1-5, FMOD banks, Wwise WEM/BNK, Bink audio, CRI ADX/HCA/AWB/CPK/USM; the parsers in src/meta document the formats.
    Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-10-16; Note: the latest release ships binaries; the wiki links only the source, never the binaries

Evidence & references

  • vgmstream commit db77f98f405a45ad08df98aa444cae3848f95e6c (ISC): src/meta/bik.c lines 4-215 (header fields, revisions, flags). Format reference quoted by that file: multimedia.cx Bink Container wiki.