What Is an AVI File? A Box for Video, and the Box Is Not the Video
An AVI file is a video container from Microsoft. Jump to your question below, or read it through in order.
An AVI file is a video container from Microsoft. Jump to your question below, or read it through in order.
An AVI file is a box that holds video and audio together. It is a multimedia container, Microsoft built it in 1992 and AVI stands for Audio Video Interleave.
The box does not compress anything. Something else inside it did that, and which something decides whether your player can show the video at all. That one idea answers most questions people bring to this page.
Microsoft released AVI on 10 November 1992 alongside Video for Windows, back when playing video on your PC was itself the achievement. It is one of the oldest video formats still in normal use.
That name describes the layout. Audio and video are interleaved: a slice of picture, then its sound, then the next slice. Read front to back and sound always arrives with the right frame. That mattered enormously when video streamed off a CD-ROM at walking pace.
AVI is the container. It carries video and audio; it does not produce them. Every question about quality, size and playback is really about what somebody put inside.
.avi52 49 46 46, then AVI at byte 8This page used to print four header fields that do not exist. It listed a “time scale”, a “data rate”, a “starting time” and a “size of AVI data chunk” at bytes 40 to 52 of the main header.
Those sixteen bytes are dwReserved. Microsoft's reference describes them in five words: “Reserved. Set this array to zero.” The corrected table is in section 11.
Camcorder tape captured to your computer. Screen recorders, old video editors, security cameras. Or downloads from the days when everything came as an AVI. Modern phones and cameras write MP4 instead.
That history matters, because an AVI from 2004 and an AVI from a preservation lab last week have almost nothing in common apart from the wrapper.
RIFF is a family, and AVI has relatives. A WAV audio file and a WebP image use the same outer structure. All three begin with the letters RIFF, and the four bytes at offset 8 are the form type that says which one you are holding. RIFF itself dates to 1991, a year before AVI.
Containers hold video. Codecs make it. AVI is the container, and DivX, Xvid, MJPEG or plain uncompressed video is the codec. Containers never touch video quality.
Search for AVI and you will be told it stores high quality video, that it compresses less than other formats and that it makes large files. All three describe the codec and give the credit to the container.
“The AVI video format can store high-quality video and audio and typically uses less compression than other similar video formats such as .MPEG and .MOV.”
Containers have no compression setting. Put Xvid video in an AVI and in an MP4 and picture data comes out byte for byte identical. MP4 runs a few megabytes smaller over a feature film because its bookkeeping is leaner, and that is the entire difference.
AVI, MP4, MKV. Decides how tracks are packed, indexed and labelled. Holds the streams, the timing and the index a player seeks with.
H.264, Xvid, DivX, MJPEG. Decides how big the video is and how it looks. Every frame you see came out of it, not out of the container.
AVI names its codec with a FourCC, four characters written into the stream header. XVID, DIVX, MJPG, DX50. From the 1990s you meet CVID for Cinepak or IV50 for Indeo. Microsoft calls the field fccHandler. Those letters say what made the video. The container does not supply it.
That is why an AVI can refuse to play while another opens fine. Your player read the FourCC, looked for that decoder and found nothing. The file is not broken, and section 5 covers what to do.
So why are AVI files big? Because of what people put in them. AVI carried uncompressed and DV footage for years, and both are enormous by design. A modern codec in an AVI gives a modern file size.
Three parts. hdrl describes the streams, movi holds the actual audio and video, then idx1 indexes it so a player can jump to the middle.
RIFF stores everything in labelled blocks called chunks. Every chunk begins with four characters naming it and four bytes giving its length, so a reader that meets something unfamiliar can step over it and carry on.
| Chunk | What it holds |
|---|---|
hdrl | The description. Width, height, frame timing, how many streams and which codec every one uses |
movi | The data. Slices of video and audio alternating, which is the interleaving in the name |
idx1 | The map. Where every slice sits, so a player can seek. Optional, and its absence is why some files will not scrub |
Inside hdrl sits avih, the main header, plus one strl list per stream. Every strl carries strh to say what kind of stream it is, then strf to describe its format.
Inside movi, every piece is named by two digits for the stream number and two letters for the kind. Microsoft documents four kinds.
| Code | Meaning | Example |
|---|---|---|
dc | Compressed video frame | 00dc is video on stream 0 |
db | Uncompressed video frame | 00db on the same stream |
wb | Audio data | 01wb is audio on stream 1 |
pc | Palette change | Rare, and only in old 256-color files |
You will also meet chunks labelled JUNK. Those are padding, put there so real data lands on tidy boundaries for the disk. Microsoft is direct about them: applications “should ignore the contents of a ‘JUNK’ chunk”.
The index is why a damaged AVI often still plays. Lose idx1 and a player can usually still read movi from the start. You lose seeking, not the video. Tools that repair AVI files mostly just rebuild that index.
Install VLC. It carries its own decoders, so it plays the old DivX and Xvid files that built-in players choke on, and it is free on every system including phones.
Built-in players open AVI files fine. Where they fall down is the codec, because Microsoft Windows and macOS ship with a short list and most AVI files in the world were made with something outside it.
| Software | Cost | What to expect |
|---|---|---|
| VLC media player | Free, open source | The reliable answer. Brings its own decoders, runs on Windows, macOS, Linux, Android and iOS |
| Media Player, Films & TV | Built in to Windows | Opens most AVI files. Gives audio only when the codec is not installed |
| QuickTime on macOS | Built in | Handles simple AVI files and refuses most DivX and Xvid ones |
| mpv, IINA | Free, open source | Light and fast. IINA is the Mac-native face of mpv |
| Kodi | Free | Built for a library of files on a television rather than one file on a desk |
| FFmpeg | Free, open source | Not a player. The engine underneath most of the above, and the tool for converting |
Phones have no built-in answer. Neither iOS nor Android opens AVI files reliably on its own. VLC for Android and VLC for iOS are both free.
Never install a codec pack a website tells you to install. A page that will not play a video and offers a download to fix it is running the oldest trick on the internet.
VLC and FFmpeg need nothing extra, ever. If VLC cannot play it, another codec pack will not help either. The download will not be a codec.
Handling other video on the same machine? MP4 video files and MKV video files are what most of your library will be, and the same players cover all three.
Sound but no picture. Picture but no sound. Or flat refusal. All three usually mean the codec is missing, and all three usually end the moment you open your file in VLC.
An AVI fails in oddly specific ways, and the way it fails tells you which half is missing. Players that open the container but lack the video decoder show you a black rectangle with perfect sound.
| What you see | What it usually means | Start with |
|---|---|---|
| Audio only, no video, black or green picture | The video codec is not installed | VLC, which brings its own |
| Picture plays, no sound | The audio codec is missing | VLC again. Often an old AC-3 track |
| Player refuses the file outright | Codec not installed, or a damaged header | VLC, then a rebuild if it still fails |
| Plays but will not scrub or seek | The idx1 index is missing or wrong | Let it play through, or rebuild the index |
| Sound drifts out of sync as it runs | Variable bitrate audio in a container built for constant | Convert it, which fixes the timing |
| Stops partway, every time, same spot | A truncated download or a bad copy | The source file, before anything else |
Real AVI files are messier than the specification. The reference that free software is built from says of the header flags: “Ignore it. Really. It's broken in too many files.” Index tables disagree with chunk headers, and sizes are often wrong. Players cope by not trusting the file, which is also why VLC succeeds where stricter software gives up.
Original AVI stops near 2GB, and a hard ceiling sits at 4GB. OpenDML, informally AVI 2.0, gets past both by chaining extra RIFF chunks tagged AVIX.
Capture an hour of video to AVI on old software and it stops. Not with an error you can act on, just a file that ends. This caught everybody digitising tape, and it has two separate causes.
| Ceiling | Where it comes from | Who hits it |
|---|---|---|
| About 2GB | The FAT16 filesystem, plus software reading the size field as signed | Old capture software, old drives |
| 4 GB | The format itself. Sizes and index offsets are 32-bit | Anything writing plain AVI, even today |
| Whatever the disk allows | OpenDML, by chaining more RIFF chunks | Modern software, which writes this by default |
The Library of Congress puts the original problem plainly. AVI had “an effective limit in a FAT16 filesystem of 2 GB, small for a high resolution video file”.
A group tied to Matrox Electronic Systems published extensions that stop any file being one RIFF chunk. Extra chunks tagged AVIX chain on behind it. The index moves from idx1 to a larger indx which, as the Library of Congress notes, identifies “the locations of video fields as well as frames”.
Version 1.02 arrived in 1997. People call this AVI 2.0 and the original AVI 1.0, though neither name is official. In practice your ceiling becomes the filesystem, and one specialist put NTFS at 32 terabytes.
Digitising tape, or capturing long footage? Your software almost certainly writes OpenDML now and the old limit will not bite. Software old enough to hit it is old enough that the 2GB stop is the least of its problems.
An AVI over 4GB is still an AVI. Nothing about the extension or the opening bytes changes, so players that do not understand AVIX read the first chunk, play it and stop early with no error. That is a rare fault now, and a baffling one when it happens.
No subtitles, no chapters, no fonts, no alpha. Add trouble with modern video and variable bitrate audio, and you have the reason MP4 and MKV took over.
AVI was designed before most of what we now expect from video existed. It holds streams next to one another and nothing else, which was the right answer in 1992 and is a short list of gaps now.
| What is missing | What it means for you |
|---|---|
| Subtitles | No attachments at all, so subtitles ride along as a separate SRT file or get burned into the picture |
| Chapters and menus | No way to mark scenes. MP4 and MKV both have them |
| B-frames | AVI was never meant to hold video that refers to frames ahead of itself, which is how modern codecs save space |
| Variable bitrate audio | VBR is unreliable here, and the classic result is sound drifting out of sync over a long file |
| Aspect ratio | Absent from the original spec, so widescreen video can play squashed. OpenDML added a method |
| Alpha channel | No transparency, which rules AVI out for a lot of graphics work |
| Real metadata | Almost nothing. No proper title, date or camera fields |
Modern video codecs save space by letting frames refer to frames that come later. AVI has nowhere to record that, because it assumes every chunk is one frame shown in order.
DivX and Xvid wanted those frames anyway, so they invented packed bitstream: stuff more than one frame into every chunk and let the decoder sort it out. Built as a hack to get B-frames through Video for Windows, it worked. It also left thousands of files that some players count wrong.
There is also a quiet tax. An AVI carrying a standard-definition feature film gives up roughly 5MB an hour in overhead, because every chunk carries its own header.
Four things AVI is not. It is not a codec. It is not MP4. It is not compressed by the container, whatever you read elsewhere. It is not streaming, because it was built to read off a disk. And it is not one thing, because what sits inside changes everything.
None of this makes AVI broken. It is a 1992 answer to a 1992 question, still doing that job. The formats that replaced it did not fix AVI; they were designed once the problems were known.
HandBrake for clicking, FFmpeg for typing. Convert AVI to MP4 and it plays everywhere, and if the video inside is already modern you can remux in seconds and lose nothing.
There are two genuinely different operations here, and knowing which one you need saves both time and picture quality.
Swap the box, keep the video. Seconds, and nothing is lost. Works when the codec inside is one MP4 accepts, which usually means H.264.
Rebuild the video. Minutes or hours, and quality drops a little. Needed for Xvid, DivX and anything uncompressed.
Try the fast one first. If FFmpeg accepts the copy, you are finished in seconds with an identical picture.
HandBrake is free and runs on Windows, macOS and Linux. Its Fast 1080p30 preset is a sensible answer for almost any old AVI. Drop the file in, choose MP4, start.
Think twice before using an online converter on anything private. Your video is uploaded to somebody else's server, sits there, then stays out of your hands.
HandBrake and FFmpeg run on your own machine and cost nothing. For holiday footage it hardly matters. For anything from a camera in your home it does.
Deciding where to send it? What an MP4 file is covers where most of it should end up, and the MKV container holds subtitles and multiple audio tracks that AVI cannot. Pulling out just the sound gives you an MP3 audio file.
The US National Archives wraps its uncompressed video masters in AVI. This format lost on sharing and won on archiving, for exactly one reason: it barely touches your data.
Every guide tells you AVI is dead. The people whose job is keeping video readable in fifty years disagree, and they are not being sentimental.
“Currently, the Video Preservation Lab creates uncompressed video streams in an AVI (Audio Video Interleaved) wrapper for the SD preservation master product option.”
The reasoning inverts every complaint on this page. AVI has no chapters, no subtitle tracks, no metadata scheme and no clever compression, so there is almost nothing in it to misread later.
Paired with a lossless or uncompressed codec, what goes in comes back out. It is simple, it is documented and free software has read it correctly for thirty years.
Formats that do very little make poor delivery and good storage. That is the entire argument, and it is why AVI has outlived formats that beat it comfortably on every feature list.
Digitising family tape? Capture to AVI if your software offers it, keep that file untouched and convert a copy to MP4 for watching. The big file is the negative and the small one is the print.
This is the opposite of the usual advice, and both are right. For sending video to somebody, use MP4 and do not think about it. For the only copy of something that cannot be recaptured, simple and boring beats clever.
DV AVI holds footage captured off a digital camcorder. Type 1 keeps audio and video as one stream. Type 2 splits them, stores the audio twice and works with older software.
Capture MiniDV tape to your computer and what lands is a DV AVI, an ordinary AVI wrapped around the DV format the camera recorded. One hour fills about 13GB, which is why the 2GB limit hurt so many people.
DV puts audio and video into one interleaved stream on the tape. That left Microsoft choosing how to store it in a container built around separate streams, and rather than choose, it allowed both.
| Layout | How it stores the audio | Trade-off |
|---|---|---|
| Type 1 | One stream, exactly as the tape recorded it | Nothing duplicated, so files are smaller. Video for Windows cannot read it |
| Type 2 | Two streams, with the audio also left inside the video | The audio is stored twice, so files are larger. Older software reads it |
Microsoft is blunt about the catch in Type 1: “the type-1 format is not compatible with Microsoft Video for Windows”. In Type 2, audio still sits inside the video stream as well, and, in Microsoft's words, “the audio is simply hidden by labeling the stream as video”.
Microsoft supplies both directions. A Type 2 file becomes Type 1 through the DV Muxer filter, and a Type 1 file becomes Type 2 through the DV Splitter filter. Older software that wants VFW compatibility needs Type 2.
Sitting on old camcorder captures? Either type converts to the other, and either one converts to MP4. Keep the original DV file if the tape is gone, because it is the closest thing left to the recording.
DV AVI is one of the good reasons a large AVI exists. Around 13GB an hour is not the container being wasteful. DV records a fixed amount per second by design, which is exactly why it survives generations of editing without falling apart.
Documented by Microsoft, open to read and never registered with IANA. The main header is 56 bytes, and the last sixteen of them are reserved.
You do not need this section to play anything. It is here for two reasons. The old version of this page got part of it wrong for years. And AVI is unusual among the formats on this site, because it is closed in no way at all.
| Property | Value |
|---|---|
| Published specification | Yes. Microsoft documents it publicly |
| Media type | None registered with IANA. No AVI type appears in the registry |
| Quoted in the wild | MIME video/x-msvideo, unregistered. The x- prefix marks a type nobody registered |
| Container family | RIFF, shared with WAV and WebP |
| Byte order | Little-endian |
| Signature | 52 49 46 46 at offset 0, then AVI at offset 8 |
| Main header | avih, 56 bytes of data |
| Codec named by | A FourCC in the stream header |
| Index | idx1, or indx under OpenDML |
Note the trailing space in AVI . A FourCC is always four characters, so a three-letter name is padded. Code that tests for the three letters alone will match things that are not AVI files.
This is where the old page invented fields. Real layout comes from Microsoft's own reference, and those last four entries are the correction.
| Offset | Field | What it holds |
|---|---|---|
| 0 | dwMicroSecPerFrame | Microseconds between frames, which is the frame rate upside down |
| 4 | dwMaxBytesPerSec | Roughly the highest data rate in the file |
| 8 | dwPaddingGranularity | What to pad data out to, in bytes |
| 12 | dwFlags | Option bits. Widely wrong in real files |
| 16 | dwTotalFrames | How many frames there are |
| 20 | dwInitialFrames | Zero, except in some interleaved files |
| 24 | dwStreams | How many streams. Not limited to two |
| 28 | dwSuggestedBufferSize | A hint for the reader |
| 32 | dwWidth | Width in pixels |
| 36 | dwHeight | Height in pixels |
| 40 to 52 | dwReserved[4] | Reserved. Microsoft: “Set this array to zero” |
Sixteen bytes of nothing, and the old version of this page gave all four of them names and meanings. Any table of AVI header fields listing a time scale or a starting time at those offsets came from the same wrong source.
AVI is the rare open one here. Most formats on this site were reverse-engineered because nobody published anything. Microsoft published this. The trouble with AVI was never secrecy. The specification left too much optional, and thirty years of software filled the gaps differently.
Two questions sort out most of what is left. Answer them in order.
Do that first. It is free, it brings its own decoders and it ends most AVI problems on its own. See section 4.
Then convert and keep the copy. An MP4 plays on everything, and section 8 has the one command that does it.
Sorting out a folder of mixed video? The MP4 file format is where most of it belongs. MKV files hold subtitles and several audio tracks, and FLV video files are the other format from that era you will find.
Only after the sound? MP3 audio files are what an extraction gives you, and WMA audio is the Windows equivalent from the same years.
Working with the pictures instead? The TGA image format and PCX picture files come from the same era of PC graphics, and DDS texture files are where uncompressed frames ended up in games.
Stuck on your player rather than your file? Our Windows fixes and macOS guides cover the system side.
New to all of this? What a file format is covers the ground underneath, and our file format guides list the rest.
Found something here that does not match your own file? Send us the exact wording on screen and we will check it against Microsoft's reference.