Image Chunks

The actual image frames are stored after the "movi" string in the AMF header. If the image compression type is LZC, LZG, LZIV, or LZ8, then timing information is inserted between image data. Timing chunks are stored as JUNK chunks, consisting of the following:

  • The string "JUNK".
  • A four-byte value indicating the length of this chunk, stored least significant byte (LSB) first. AMF version 1.0 files have length values of 4, versions 2.0 and 3.0 files have length values of 8.
  • A four-byte value. In a version 1.0 file, this is a floating point number indicating the time at this frame. On UNIX platforms using version 1.0, this value must be byte swapped after reading. In version 2.0 and 3.0 files, this is an integer, stored LSB first, indicating the number identifier of this frame.
  • A four-byte floating point number indicating the time at this frame (version 2.0 and higher only).
Image data follows the timing chunk. The data varies depending on what compression method is used. As of version 3.0, the following types are supported:
  • LZC: Lempel-Ziv compression on a 24 bit color image.
  • LZIV or LZG: Lempel-Ziv compression on a grayscale image.
  • JPEG: JPEG compression.
  • LZ8: Lempel-Ziv compression on an 8 bit (256 color) image.
Below is a HEX dump of a frame chunk for an LZC encoded file. The LZVI, LZG, and LZ8 compressions follow a similar format:
Figure 1.


Legend

Light Green
Size of the JUNK chunk used for timing info. This is a 4-byte long integer value stored least significant byte (LSB) first.
Royal Blue
The time value for this frame. This value is only read in version 1.0 files. It is present but ignored in version 2.0 or higher, as the timing value for those versions comes from the AMF footer structure elsewhere in the file.
Purple
Frame number. A 4-byte integer stored LSB first.
Cyan
The string value "00db".
Red
The size of the image chunk, in bytes, as stored in this file. A four-byte value stored LSB first.
Yellow
The compressed size of the image data. A four-byte value stored LSB first.
Dark Blue
The uncompressed size of the image data. A four-byte value stored LSB first.
Dark Green
Denotes the beginning of the image data.
A JPEG compressed AMF does not use timing JUNK chunks, as this compression type was added for version 2.0 when timing information was already available from the AMF footer structure. Following is a HEX dump of a frame chunk for a JPEG encoded file:
Figure 2.


Legend

Cyan
The string value "00db".
Red
The size of the image chunk, in bytes, as stored in this file. A four-byte value stored LSB first.
Yellow
Denotes the beginning of the image data.