AVI files use the AVI RIFF form. The AVI RIFF form is identified by the four-character code 'AVI' RIFF form type. All AVI files include two mandatory LIST chunks. These chunks define the format of the streams and stream data. AVI files generally include an index chunk. This optional chunk specifies the location of data chunks within the file. An AVI file with these components has the following form:
RIFF ('AVI' LIST ('hdrl' . . . ) LIST ('movi' . . . ) ['idx1'<AVI Index>] )
The LIST chunks and the index chunk are subchunks of the RIFF 'AVI' chunk. The 'AVI' chunk identifies the file as an AVI RIFF file. The LIST 'hdrl' chunk defines the format of the data and is the first required list chunk. The LIST 'movi' chunk contains the data for the AVI sequence and is the second required list chunk. The 'idx1' chunk is the optional index chunk. AVI files must keep these three components in the proper sequence.
The LIST 'hdrl' and LIST 'movi' chunks use subchunks for their data. The following example shows the AVI RIFF form expanded with the chunks needed to complete the LIST 'hdrl' and LIST 'movi' chunks:
RIFF ('AVI' LIST ('hdrl' 'avih'(<Main AVI Header>) LIST ('strl' 'strl'(<Stream header>) 'strf'(<Stream format>) 'strd'(additional header data) . . . . ) . . . ) LIST ('movi' {SubChunk | LIST ('rec' SubChunk1 SubChunk2 . . . ) . . . } . . . ) ['idx1'<AVIIndex>] )
The following sections describe the chunks contained in the LIST 'hdrl' and LIST 'movi' chunks as well as the 'idx1' chunk.