
AVI format: how an AVI format is composed

There are at least two sub-blocks in the avi file: header and data. The title contains general information about the movie: image resolution, frame rate, audio format, etc.
![]()
In the header, 32 bits are allocated to record the length of the file. This means that the maximum possible file size is approximately 4 GB. In fact, the actual length of a standard format avi file that editing programs can work with does not exceed 2GB. At the time of the appearance of the format, this seemed to be sufficient, as FAT 16 did not allow disk partitions larger than 2GB, and the length of the file, of course, cannot exceed the size of the logical disk. With the advent of FAT 32, the upper limit of the partition size has moved significantly.
The data sub-block is organized in the form of sequences of records, each of which consists of a frame and a corresponding soundtrack. For video, the division into frames is completely natural, but the sound is a continuous stream, artificially superimposed on the fragments corresponding to the frames. If a video capture device is used to record both video and sound, problems generally do not arise. If the sound is written through a sound card, there is no exact synchronization of the picture and sound, and the sound may “come out of the picture”.
The AVI image supports a wide variety of palettes. They are listed below:
8 bit (256 grayscale);
9-bit YUV (luminance and difference of two colors);
12-bit YUV, 4: 1: 1 (here, 4: 1: 1 is the signal sampling, which is calculated for a specific channel as the product of the base digital encoding frequency by the corresponding ratio: 4 for the channel Y and 1 for color difference channels);
16-bit YUY2, 4: 2: 2;
8-bit color (RGB);
15-bit RGB (16-bit with the most significant bit set to 0, 5 for red, 5 for green, and 5 for blue);
16-bit RGB (5 bits for red, 6 for green, and 5 for blue);
24-bit RGB (standard RGB palette);
32-bit RGB (for informational content, it is completely equal to 24-bit: most significant byte is set to 0, 1 byte is allocated to encode each of the three colors). 32-bit color rendering does not increase color accuracy. The most informative palette is 24-bit RGB
AVI recording can be unzipped or compressed. The most widely used compression algorithm is Motion JPEG. Compression formats are also supported: Microsoft Video 1 (the format works only with 8 and 16 bit color), Microsoft RLE (8 bit color only), Indeo, Cinepak Editable MPEG, which uses only I-frames.
Recently, the DivX compression format has become more and more popular. The codec used for compression is a decrypted version of Microsoft’s MPEG-4 video codec.
AVI data can be exported in various formats.




