What Is an .AVI File?
Audio Video Interleave
AVI Video File (.avi)
Overview
AVI (Audio Video Interleave) is Microsoft's video container format from 1992, built on the RIFF structure it shares with WAV. An .avi file interleaves chunks of video and audio so a player can read both in one pass from a slow disk, which was the design goal on early-1990s hardware.
Like MKV and MP4, AVI is a container, not a codec. The same .avi extension covers files encoded with Cinepak in 1995, DivX in 2002, Xvid in 2008 and H.264 today, which is why some AVI files play everywhere and others need a codec the player does not have.
Technical Specifications
- MIME Type:
video/x-msvideo(alsovideo/avi) - File Extension:
.avi - Category: Video
- Container: RIFF (Resource Interchange File Format)
- Introduced: 1992, with Video for Windows
- Magic bytes:
52 49 46 46 ?? ?? ?? ?? 41 56 49 20(RIFF....AVI) - Successors: ASF/WMV (Microsoft), MP4, MKV
Identification
00000000 52 49 46 46 a4 3e 1b 04 41 56 49 20 4c 49 53 54 |RIFF.>..AVI LIST|
00000010 c0 11 00 00 68 64 72 6c 61 76 69 68 38 00 00 00 |....hdrlavih8...|
RIFF, a 4-byte size, then AVI with a trailing space. The hdrl list that follows holds the stream headers, where the strf chunk's FourCC (XVID, DIVX, H264, MJPG) names the video codec.
File Structure
RIFF 'AVI '
├── LIST 'hdrl' headers
│ ├── avih main header: frame rate, size, stream count
│ └── LIST 'strl' one per stream
│ ├── strh stream type (vids/auds), codec FourCC, rate
│ └── strf format details (BITMAPINFOHEADER or WAVEFORMATEX)
├── LIST 'INFO' optional metadata
├── LIST 'movi' the interleaved audio and video chunks
└── idx1 index of chunk offsets for seeking
The original format has a 2 GB limit because RIFF sizes are 32-bit. OpenDML (AVI 2.0, 1996) added RIFF AVIX extension lists so files can grow past it; most tools write OpenDML automatically when needed.
History and Development
AVI shipped with Video for Windows in 1992 as Microsoft's answer to QuickTime. It became the default container for the DivX and Xvid era of the early 2000s, when MPEG-4 Part 2 video in an AVI wrapper was how most films circulated. Microsoft itself moved to ASF/WMV in 1999 and the wider industry to MP4 and MKV, which support modern codecs, subtitles, chapters and variable frame rates that AVI handles poorly or not at all.
Common Use Cases
- Legacy video collections from the DivX/Xvid period
- Camera and capture output: some camcorders, dashcams and capture cards still write AVI, often as Motion JPEG
- Scientific and machine-vision recording, where uncompressed or MJPEG AVI is simple to parse
- Editing intermediates in older Windows workflows
- Game and application assets on Windows
How to Open an AVI File
Windows
- Media Player and Movies & TV open AVI natively, provided the codec inside is one Windows ships (MJPEG, H.264, MPEG-4). Older DivX files may need the codec installed or a different player.
- VLC plays every AVI regardless of codec. The dependable choice.
- MPC-HC, PotPlayer: lightweight alternatives with wide codec support.
macOS
- QuickTime Player opens only some AVI files (MJPEG and a few others) and refuses the rest.
- VLC or IINA play everything.
Linux
- VLC, mpv, Celluloid; GStreamer-based players need the
gst-plugins-uglyor-badpackages for older codecs.
iPhone, iPad and Android
- The built-in players usually will not open AVI. Install VLC (free on both platforms), or convert to MP4 first.
- Google Photos and Apple Photos do not import AVI; convert before adding to a library.
Inspecting the codec
ffprobe -hide_banner video.avi
# look at the Stream #0:0 line: Video: mpeg4 (XVID), h264, mjpeg ...
How to Convert an AVI File
To MP4 (the usual target)
If the AVI already contains H.264 video and AAC or MP3 audio, remuxing copies the streams unchanged in seconds:
ffmpeg -i input.avi -c copy output.mp4
Most AVI files hold older codecs (Xvid, DivX, MJPEG) that MP4 players cannot use, so they need re-encoding:
ffmpeg -i input.avi -c:v libx264 -crf 20 -preset medium -c:a aac -b:a 192k output.mp4
-crf 20 is visually lossless for most content; raise to 23 for smaller files.
To MKV
ffmpeg -i input.avi -c copy output.mkv
MKV accepts almost any codec, so remuxing works even for Xvid, and the player problem moves to the codec rather than the container.
Graphical tools
- HandBrake (free, all platforms): open the AVI, choose the Fast 1080p30 preset, start.
- VLC: Media, Convert / Save.
- Shutter Encoder, Avidemux: batch and cut-without-re-encode workflows.
Repairing a broken AVI
An AVI with a missing or damaged idx1 index will not seek and may not play. ffmpeg -i broken.avi -c copy fixed.avi rebuilds it; VLC offers to repair on open; DivFix++ is a dedicated tool.
Advantages
- Universally recognised: every player on Windows knows the container.
- Simple structure: easy to parse and to write, which is why capture hardware still uses it.
- Lossless and uncompressed storage are straightforward.
Limitations
- No modern features: no chapters, no soft subtitles, poor support for variable frame rate and B-frames.
- 2 GB limit without OpenDML extensions.
- Large files: the container has more overhead than MP4 or MKV.
- Codec dependency: the file plays only if the player has the right codec, and the extension does not say which.
- No streaming support: the index sits at the end, so a partial download is unplayable without repair.
Related Formats
How to identify .AVI files from the bytes
Audio Video Interleave files carry a fixed byte pattern, the file signature or magic number, that identifies them regardless of the extension. This is what our detector reads.
| Offset | Hex | ASCII |
|---|---|---|
| 0 | 52 49 46 46 ?? ?? ?? ?? 41 56 49 20 | RIFF....AVI |
Check a file yourself: xxd -l 16 file.avi on macOS and Linux, or Format-Hex file.avi | Select-Object -First 1 in PowerShell.Full AVI signature reference
File Information
Audio Video Interleave
Video
.avi
video/x-msvideo
Related File Types
Other file types in the Video category you might also need:
Start Analyzing AVI Files Now
Use our free AI-powered tool to detect and analyze Audio Video Interleave files instantly with Google's Magika technology.
⚡Try File Detection Tool