Many of the video compression and decompression messages rely on information embedded in the AVI RIFF file. Drivers do not typically access this information directly. They rely on the client-application to read and write the AVI file and maintain the RIFF file structure. While your driver should not have to manipulate an AVI file, understanding its structure helps identify the purpose of the information your driver will supply and receive.
AVI files have the following general structure:
RIFF('AVI'
LIST('hdrl'
avih(<<MainAVIHeader>>)
LIST ('strl'
strh(<<Stream header>>)
strf(<<Stream format>>)
strd(<<Stream data>>)
strn(<<Stream name>>)
)
)
LIST('movi'
'00??'(<<driver Data>>)
.
.
.
'00??'(<<driver Data>>)
)
' idx1'(<<AVIIndex>>)
)
The following table summarizes the entries in the AVI file:
RIFF Chunk | Description |
---|---|
RIFF 'AVI ' | Identifies the file as AVI RIFF file. |
LIST 'hdrl' | Identifies a chunk containing subchunks that define the format of the data. |
'avih' | Identifies a chunk containing general information about the file. This includes the number of streams and the width and height of the AVI sequence. |
LIST 'strl' | Identifies a chunk containing subchunks that describe the streams in a file. This chunk exists for each stream. |
'strh' | Identifies a chunk containing a stream header. This includes the type of stream. |
'strf' | Identifies a chunk describing the format of the data in the stream. For video streams, the information in this chunk is a BITMAPINFO structure. It includes palette information if appropriate. |
'strd' | Identifies a chunk containing information used by compressor and decompressors. For video compressors and decompressors, this includes the state formation. |
'strn' | Identifies a chunk containing a zero-terminated string specifying the name of the stream. |
LIST 'movi ' | Identifies a chunk containing subchunks used for the audio and video data. |
'00??' | Identifies a chunk containing the audio or video data. For this example, both the zeros (00) and the question marks (??) are used as place holders. The zeros are replaced by stream numbers. The question marks are replaced by codes indicating the type of data in the chunk. For example, a stream for a compressed DIB might use '01dc'. |
'idx1' | Identifies a chunk containing the file index. |
Video compression and decompression drivers operate on the information in the 'strf', 'strd', and 'oo??' chunks.