The MJPEG chunk file contains 5 chunks:
The type of this chunk is:
The data in the chunk is:
The media field specifies a general type of media. For mjpeg files, this is:
The format field specifies a specific format. For mjpeg files, this is:
The device field specifies the original recording device. This field isn't really used for anything but is set to one of the following:
The version field specifies what version of the cmplayer is being used. This is currently set to:
The num_frames field contains how many frames of data are in the file.
The length_s field indicates how long the clip is in seconds.
The length_ns field indicates how many nanoseconds in addition to the previously indicated number of seconds the clip contains. Thus, the length of the clipfile can be found as (length_s + (length_ns * ONE_BILLION)).
The type of this chunk is:
The data in this chunk is:
Width and height are the width and height in pixels of the mjpeg data.
Device is an echo of the device specified in the Media Independent Chunk.
Subformat is one of the following:
VID_FRAME_CODE specifies that the frames consist of data without any Huffman or quantization tables. This is data generally produced by the Parallax board.
JFIF_FRAME_CODE specifies that each frame is a complete JFIF jpeg frame.
JFIF_NO_HUFFMAN_FRAME_CODE specifies that each frame is a JFIF frame without the Huffman tables.
Qfactor is a heuristic guess at the Parallax qfactor associated with this data. This is used for display onto Parallax boards and other boards that utilize one number to generate quantization tables.
The type of this chunk is:
The data of this chunk consistes of (number_of_frames + 1) entries of the following form:
The start time of the nth frame is the nth entry of the above form. Again the actual time is found as:
The end time of the nth frame is the start time of the n+1 frame. Thus, the Frame Time Table contains one more time entry than number of frames in order to specify the end time of the last frame.
The type of this chunk is:
The data of this chunk consists of number_of_frames entries of the following form:
Offset refers to the byte offset from the beginning of the data segment where the frame's data begins.
Length refers to the length of the frame's data.
Each frame's offset and length are specified requiring number_of_frames entries of this form.
The type of this chunck is:
The data of this chunk is the mjpeg data itself.
The frame offset table is specified relative to the beginning of this chunk.