FMF File Format

Sergio Baldoví

Fuse can save movies with sound in a specific file format (FMF - Fuse Movie File). This recording is very fast, and has a moderate size, but you need to use the fmfconv program in fuse-utils to convert into regular video and/or audio files.

A typical file will have some interspersed blocks:

  • File Header
  • Screen area
  • Sound chunk
  • New frame
  • End of recording

File Header

OFFSET LENGTH DATA DESCRIPTION
0 4 "FMF_" Magic number
4 2 "V1" Version
6 1 <e,E> Endianness (e: little endian, E: big endian)
7 1 <U,Z> Compression (U: uncompressed, Z: compressed)
8 1 # Frame rate ( 1:# ) (1:1 is 50 frames/sec)
9 1 <$,R,C,X> Screen type (standard, HiRes, HiColor, Timex standard)
10 1 <A,B,C,D,E> Frame timing code (see New Frame block)
11 1 <P,U,A> Sound encoding (P: 16bit signed PCM, U: u-Law, A: A-Law)
12 2 # Sound freq in Hz
14 1 <S,M> Sound channels (S: stereo, M: mono)
15 1 0x0A Padding (new line)

Example:
FMF_V1eZ\001$AU\000\175M
little endian, compressed, standard screen, 48k timing, u-Law mono 32000Hz sound

If compression is enabled, all blocks (except File Header) are compressed by zlib.

After the File Header there should be a slice with full screen area to begin with drawings.

Screen area (slice)

OFFSET LENGTH DATA DESCRIPTION
0 1 "$" Block ID / Data chunk type
1 1 # X coord (0-39)
2 2 # Y coord (0-239)
4 1 # Width (1-40)
5 2 # Height (1-240)
7 ? # Run-length encoded data

Run-length encoded data for non-HiRes screen types ($/C/X):

  • bitmap
  • attributes

Run-length encoded data for HiRes screen type (R):

  • bitmap1
  • bitmap2
  • attributes

Run-length encoding method:

  • Two identical bytes plus length (upto 255).
  • abcc#defg -> "cc#" means cc string + "# times" c char.

New frame

OFFSET LENGTH DATA DESCRIPTION
0 1 "N" Block ID / Data chunk type
1 1 # Frame rate ( 1:# ) (1:1 is 50 frames/sec)
2 1 <$,R,C,X> Screen type (standard, HiRes, HiColor, Timex standard)
3 1 <A,B,C,D,E> Frame timing code

Screen type:

  • $ - Standard screen,
  • R - HiRes,
  • C - HiColor,
  • X - Standard screen on Timex (double size)

Frame timing code:

  • A - 16, 48, TC2048, TC2068, Scorpion, SE
  • B - 128, +2, +2A, +3, +3E
  • C - TS2068
  • D - Pentagon
  • E - 48 NTSC

In a frame there are zero, one or several screen areas (slices), changed from the previous frame.

Sound chunk

OFFSET LENGTH DATA DESCRIPTION
0 1 "S" Block ID / Data chunk type
1 1 <P,U,A> Sound encoding (P: 16bit signed PCM, U: u-Law, A: A-Law)
2 2 # Sound freq in Hz
4 1 <S,M> Sound channels (S: stereo, M: mono)
5 2 # Length in frames - 1 (0-65535 means 1-65536 sound frames)
7 ? # Sound frames data (length * frame size)

Sound frame size:

  • A-Law mono: 1 byte.
  • A-Law stereo: 2 bytes.
  • PCM mono: 2 bytes.
  • PCM stereo: 4 bytes.

End of recording

OFFSET LENGTH DATA DESCRIPTION
0 1 "X" Block ID / Data chunk type

There is no additional data. This block mark the end of the last frame. So we can concatenate several FMF files without problem.


Related

Wiki: Home