The AVI File Header

The AVI File Header

AVI file format is based on the Resource Interchange File Format (RIFF). RIFF is a versatile format used for WAV files (and several other file formats) in addition to AVI files. Every RIFF file begins with a four-character code or FOURCC, a series of four byte-wide character values that spells out RIFF. This code is followed by a 32-bit value indicating the length of the file excluding the RIFF header and length value, so really, it s the length of the rest of the file. In earlier versions of AVI files, the file size was limited to 4 gigabytes (GB), which is the maximum file size on Windows operating systems earlier than Windows 2000. Given that an hour of DV-encoded video runs to 13.5 GB, it was necessary to extend the AVI file format to work with very large files. To this end, the latest version of the AVI file format allows multiple RIFF headers to be concatenated sequentially. Each of these RIFF files-within-a-file can be up to 4 GB in length. The extended AVI file format looks like Figure 14-1.

figure 14-1 second-generation avi file format, which handles file sizes much longer than 4 gb

Figure 14-1. Second-generation AVI file format, which handles file sizes much longer than 4 GB

Following the 32-bit length-of-file value, another FOURCC value defines the type of the RIFF file. In the case of AVI files, the value is AVI . (Note that a trailing space is necessary to pad the value to four characters.) If the RIFF file had PCM audio data inside, the FOURCC type would be WAV , a WAV file.



Programming Microsoft DirectShow for Digital Video and Television
Programming Microsoft DirectShow for Digital Video and Television (Pro-Developer)
ISBN: 0735618216
EAN: 2147483647
Year: 2002
Pages: 108
Authors: Mark D. Pesce

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net