Introduction
AVI is the video container Microsoft introduced with Video for Windows in 1992. It interleaves video and audio in one file so they can be read from disk together. AVI was the standard video file on Windows for many years and is still common for older video, capture devices and uncompressed footage.
The original format is limited to files of about 1 GB to 4 GB. The OpenDML extension, sometimes called AVI 2.0, adds further RIFF sections and a two-level index so files can be much larger.
Structure
An AVI file is a RIFF file with the form type AVI (with a trailing
space). RIFF chunks are a four-letter ID, a 32-bit little-endian size and the data,
padded to an even length. LIST chunks group other chunks under a type of
their own.
The hdrl list comes first. It holds the
main header avih, with the
frame rate, frame size and number of streams, and one strl list per stream,
each with a stream header
strh and a format strf that names the codec. The
movi list holds the data
chunks, whose IDs give the stream number and the kind of data: 00dc is
compressed video for stream 0, and 01wb is audio for stream 1. The
idx1 index chunk at the end
indexes every data chunk for seeking. Files too large for this layout use the
OpenDML extensions.
0RIFF chunk ID, size, form typeAVI12 bytes12LIST hdrl the main header and onestrlper streamvaries…LIST movi the video and audio chunks, interleavedvaries…idx1 an index entry for every data chunkvaries
Not described
Known, not yet covered
- Reference: the layouts of the OpenDML
dmlhheader (dwGrandFramesand its reserved space) and of thevprpvideo properties header were written from memory ofaviriff.hand the OpenDML document, which is a PDF that was not opened; the pages say so where they list them. - Viewer: there is no AVI viewer plugin yet; the explorer shows the file as bytes.
Links
Software
- VLC media player – free media player that plays AVI with most codecs (Windows, macOS, Linux, mobile)
- mpv – free, minimal media player (Windows, macOS, Linux)
- VirtualDub – classic free tool for capturing, cutting and filtering AVI files (Windows)
- Avidemux – free video editor for simple cuts and re-encoding of AVI (Windows, macOS, Linux)
- HandBrake – free video converter that reads AVI (Windows, macOS, Linux)
- FFmpeg – command-line tools that read, write and convert AVI (Windows, macOS, Linux)
- Adobe Premiere Pro – Adobe’s video editor, which imports and exports AVI (Windows, macOS)
Developers
- libavformat – FFmpeg’s container library, which reads and writes AVI (C)
Reference
- AVI RIFF file reference – Microsoft’s description of the AVI chunks and headers