![]() |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
The main header is followed by one or more 'strl' chunks. (A 'strl' chunk is required for each data stream.) These chunks contain information about the streams in the file. Each 'strl' chunk must contain a stream header and stream format chunk. Stream header chunks are identified by the FOURCC (four-character code) 'strh' and the stream format chunks are identified by the FOURCC 'strf'. In addition to the stream header and stream format chunks, the 'strl' chunk might also contain a stream-header data chunk and a stream name chunk. Stream-header data chunks are identified by the FOURCC 'strd'. Stream name chunks are identified by the FOURCC 'strn'.
The stream header structure contains header information for a single stream of a file.
typedef struct { FOURCC fccType ; FOURCC fccHandler ; DWORD dwFlags ; DWORD dwPriority ; DWORD dwInitialFrames ; DWORD dwScale ; DWORD dwRate ; DWORD dwStart ; DWORD dwLength ; DWORD dwSuggestedBufferSize ; DWORD dwQuality ; DWORD dwSampleSize ; RECT rcFrame ; } AVIStreamHeader;
The stream header specifies the type of data the stream contains, such as audio or video, by means of a FOURCC.
Value | Definition |
---|---|
'vids' | Indicates the stream contains video data. The stream format chunk contains a BITMAPINFO structure that can include palette information. |
'auds' | Indicates the stream contains audio data. The stream format chunk contains a WAVEFORMATEX or PCWAVEFORMAT structure. |
'txts' | Indicates the stream contains text data. |
Flag | Definition |
---|---|
AVISF_DISABLED | Indicates this stream should not be enabled by default. |
AVISF_VIDEO_PALCHANGES | Indicates this video stream contains palette changes. This flag warns the playback software that it will need to animate the palette. |
The last eight members describe the playback characteristics of the stream. These factors include the playback rate ( dwScaleand dwRate), the starting time of the sequence ( dwStart), the length of the sequence ( dwLength), the size of the playback buffer ( dwSuggestedBuffer), an indicator of the data quality ( dwQuality), and the sample size ( dwSampleSize).
Some of the members in the stream header structure are also present in the main header structure. The data in the main header applies to the whole file, while the data in the stream header structure applies only to a stream.
A stream format ('strf') chunk must follow a stream header ('strh') chunk. The stream format chunk describes the format of the data in the stream. For video streams, the information in this chunk is a BITMAPINFOstructure (including palette information if appropriate). For audio streams, the information in this chunk is a WAVEFORMATEXor PCMWAVEFORMATstructure. (The WAVEFORMATEXstructure is an extended version of the WAVEFORMATstructure.) For more information about this structure and other stream types, see the New Multimedia Data Types and Data Techniques Standards Update.
The 'strl' chunk might also contain an additional stream-header data ('strd') chunk. If used, this chunk follows the stream format chunk. The format and content of this chunk is defined by installable compression or decompression drivers. Typically, drivers use this information for configuration. Applications that read and write RIFF files do not need to decode this information. They transfer this data to and from a driver as a memory block.
The optional 'strn' stream name chunk provides a zero-terminated text string describing the stream. (The AVI file functions can use this chunk to let applications identify the streams they want to access by their names.)
An AVI player associates the stream headers in the LIST 'hdrl' chunk with the stream data in the LIST 'movi' chunk by using the order of the 'strl' chunks. The first 'strl' chunk applies to stream 0, the second applies to stream 1, and so forth.
For example, if the first 'strl' chunk describes the wave audio data, the wave audio data is contained in stream 0. Similarly, if the second 'strl' chunk describes video data, then the video data is contained in stream 1.
Last updated on Tuesday, May 18, 2004