View Page Source

Revision (current)
Last Updated by feos on 10/19/2023 4:53 PM
Back to Page

This page documents the .bk2 file format for the [BizHawk] Emulator.  This format is a replacement to the [BizHawk/BkmFormat|.bkm] format that was originally released with the emulator and used up to the 1.7.2 release.

!!! Zip archive
.bk2 is an archive file that contains movie data broken into various files.  It is a zip format and can be opened with any unzip tool, such as 7z.
!! Archived files

! Header

A text file in UTF-8 encoding that contains key-value pairs for various aspects of the movie such as
* MovieVersion
* rerecordCount
* Author
* emuVersion
* Platform
* GameName
* SHA1 (NB: contains either CRC32, MD5, or SHA1, hex-encoded, unprefixed)
* BoardName
* Core
* StartsFromSavestate

Note that the StartsFromSavestate is a convenience property.  The existence of a CoreState object is what makes a movie savestate-anchored.  Even if this property was false, that file will still be checked and loaded if it exists.

! Input Log

A text file in UTF-8 encoding that contains the input log of the movie.
Input frames are represented by lines that begin with "|".
(The frame count can be determined by counting the number of lines that start with "|".)

The first line of the input log file is a Log Key.  This shows the button names, in order, that are used for this input.  Currently this is only for convenience and is not read by BizHawk when loading a movie.  Altering the Log Key has no effect.

All lines that start with a pipe (|) represent a frame of input.  All boolean input is represented by a single character when on, and a "." when off.  The actual character used matters only for readability, BizHawk will interpret any character other than "." as on.  

Analog controls are represented by a 5 digit number (left padded with spaces) followed by a comma.

Pipes (|) can be present anywhere in the input log and serve as logical separators, typically to separate distinct controllers (but only by convention).

Actual buttons and orders vary per platform and controller configuration.

! Comments

Simply a text file of comments by the author.

! Subtitles

The subtitle file consists of a number of lines in the following format:
{{subtitle frame x y length color text}}

* {{subtitle}} is just the string "subtitle", to indicate the line is a subtitle (artifact from old format).
* {{frame}} is the first frame on which the subtitle should appear.
* {{x}} is the x position of the top-left of the subtitle (emulator screen space).
* {{y}} is the y position of the top-left of the subtitle (emulator screen space).
* {{length}} is the number of frames the subtitle should remain visible.
* {{color}} indicates the color of the subtitles in hexadecimal ARGB.
* {{text}} is the text to display and is simply the rest of the line.

For example, to display "Hello, world!" (without the quotes) on screen from
frame 78568 to 78628 (60 frames) at position (200, 100) in green, you would use:
{{subtitle 78568 200 100 60 FF00FF00 Hello, world!}}

! SyncSettings

A JSON blob of all core settings required for sync.  These will be automatically loaded and applied by the emulator when the movie is loaded.

! CoreState

If this file exists, it is a savestate-anchored movie.  This state will be loaded when the movie is loaded.