FCEUX
The all in one NES/Famicom Emulator
Home Download Documentation Versions Contact Links

FM2 Movie file format

FM2 is the movie capture format of FCEUX

FM2 file format description

FCEUX uses a new movie file format - .fm2

This differs from the previous FCE Ultra movie format (.fcm) in the following ways:

Format

FM2 is ASCII plain text. It consists of several key-value pairs followed by an inputlog section.

The inputlog section can be identified by its starting with a | (pipe). The inputlog section terminates at eof. Newlines may be \r\n or \n

Key-value pairs consist of a key identifier, followed by a space separator, followed by the value text. Value text is always terminated by a newline, which the value text will not include. The value text is parsed differently depending on the type of the key. The key-value pairs may be in any order, except that the first key must be version.

Integer keys (also used for Booleans, with a 1 or 0) will have a value that is a simple integer not to exceed 32bits

Header

String keys have values that consist of the remainder of the key-value pair line. As a consequence, string values cannot contain newlines.

Hex string keys (used for binary blobs) will have a value that is like 0x0123456789ABCDEF...

GUID keys have a value which is in the standard GUID format: 452DE2C3-EF43-2FA9-77AC-0677FC51543B

Inputlog

The inputlog section consists of lines beginning and ending with a | (pipe). The fields are as follows, except as noted in note C.

c port0 port1 port2

Field c is a variable length decimal integer which is a bitfield corresponding to miscellaneous input states which are valid at the start of the frame. Current values for this are

The format of port0, port1, port2 depends on which types of devices were attached.

SI_GAMEPAD

SI_ZAPPER

SIFC_NONE

Notes

There is no key-value pair that indicates the length of the movie. This must be read by scanning the inputlog and counting the number of lines.

All movies start from power-on, unless a savestate key-value is present

If a fourscore is used, then port0 and port1 are irrelevant and ignored

If fourscore, the input types must all be gamepads

{player1 player2 player3 player4}
c RLDUTSBA RLDUTSBA RLDUTSBA RLDUTSBA port2

If fourscore is not used, then port0 and port1 are required

Emulator framerate constants

FCEUX uses these framerate constants: