.AVI Audio Video Interleave
.avi

Audio Video Interleave

AVI (Audio Video Interleave) is Microsoft's 1992 video format — released with Video for Windows, nine years before MP4. The outer 12 bytes haven't changed since: a 1995 AVI and a 2010 AVI open identically. The video compression four bytes deeper has changed five times.

Container structure
RIFF
hdrl
movi
VideoAudioLossyMetadata1992

Common questions

How do I convert AVI to MP4?

FileDex converts AVI to MP4 directly in your browser — drop the file into the converter above. If the video inside the AVI is already compatible with MP4 (later H.264 files), the conversion finishes in seconds because the video doesn't have to be rebuilt in a new format. Older AVI files take longer: the video gets re-encoded — rebuilt in the modern format every device plays.

What is an AVI file?

AVI (Audio Video Interleave) is Microsoft's video format, released in 1992 with Video for Windows. Audio and video chunks alternate at fixed positions inside the file, with the video compression identified by a 4-letter codec tag four bytes from the start. The same wrapper has held five generations of video compression without changing.

Why won't my iPhone or Apple TV play AVI files?

iOS Safari and Apple TV refuse AVI containers entirely — Apple stopped supporting Microsoft's legacy video formats years ago. The fix is conversion to MP4 with H.264 video and AAC audio, the universal Apple-compatible target. FileDex handles the conversion locally in your browser; install VLC for iOS as a per-device fallback if conversion is impractical.

Is AVI better than MP4?

No — for almost every modern use, MP4 wins. MP4 plays on every device made in the last decade, lets a video start playing while it's still downloading, and pairs well with the newer compression formats phones now ship hardware support for. AVI wins in exactly one scenario: screen-recorder workflows where a crash-tolerant container matters more than compression efficiency.

Why does my old AVI file stop playing at 30 minutes?

That's the 1996 OpenDML compatibility break. AVI files bigger than about 1 GB are split into chained pieces under the OpenDML extension — but players written before 1996 read only the first piece, then stop. Re-exporting the file as MP4 or MKV fixes it permanently. Both formats handle large files without splitting, and FileDex rebuilds the container locally in seconds.

What makes .AVI special

One container, five codec eras
The AVI wrapper has held five codec generations since 1992.
Open any AVI from 1995 and any AVI from 2010 in a hex viewer. The first 12 bytes are identical — the same RIFF marker Microsoft chose in 1992. Four bytes deeper, a 4-letter tag identifies the video compression: Cinepak in the old file, H.264 in the new one. The container outlived its codecs without changing a byte of its outer shell.
Crash-tolerant by accident
Partial AVI writes still play. Partial MP4 writes often do not.
AVI alternates audio and video chunks at fixed positions inside its data section. If a recorder crashes mid-write, the file remains playable up to the last completed pair. MP4 puts its index — the table of every frame's location — at the END of the file. A crashed MP4 is unreadable until a recovery tool rebuilds it.
The 30-minute freeze
Old AVI players stop reading at the 1 GB boundary.
Original AVI files maxed out around 2 gigabytes because of how 1990s code did the math on file sizes. In 1996, a fix called OpenDML let AVI break past the limit by splitting the file into smaller pieces. But players written before 1996 read only the first piece, then stopped — which is exactly what happened to a generation of DVD-rip viewers around minute thirty of every long movie.
Searched as a problem, not a thing
"Convert AVI to MP4" beats "what is AVI" by an order of magnitude.
Every format eventually gets searched as a problem instead of a thing. For AVI, that crossover happened around 2015, when iOS and tvOS stopped supporting Microsoft's legacy containers. AVI's 1992 design choices fit the desktop-decoder world they were built for — not the hardware-decoded mobile world that replaced it.

One Container. Five Codec Eras. Zero Outer-Format Changes.

In 1992, Microsoft's video team made a deliberate trade-off. They designed AVI to be codec-agnostic — the file format wrapper would stay frozen while the video compression inside it changed freely. Five codec generations later, the trade-off has held. Drop any AVI from 1995 and any AVI from 2010 into a hex viewer: the first twelve bytes glow identical — the same chunk-based file structure (called RIFF) that Microsoft and IBM published in 1991, plus the four letters that mark the file as AVI. Four bytes deeper, the codec name appears as readable text inside the binary: the 1995 file says cvid (an early-1990s video compression called Cinepak), the 2010 file says H264 (the H.264 compression most phones decode in hardware). Same outer wrapper. Different decade. Different video compression.

Continue reading — full technical deep dive

That same 4-letter slot has hosted five generations of video compression in the AVI container. Cinepak came first in 1992. Intel's Indeo took over for the mid-1990s. DivX arrived in 1999 — the codec that powered the early-2000s pirated-movie boom. Xvid followed in 2001 as the open-source alternative. H.264 took over from the mid-2000s onward. The outer container never changed across any of them. The codec identity moves; the wrapper does not. The container that hosted all of that had one stubborn limit — and the year it broke is the year half the players in the world stopped working.

Why a Generation of Movies Froze at Minute 30

A 2005-era DVD rip plays for thirty minutes, then freezes mid-shot. The seek bar reads 30:12 / unknown duration. The audio cuts. The player reports nothing wrong; the file is over but pretending it isn't. That's not a corrupt file. That's 1990s arithmetic catching up with a 2005 file.

Matroska exists because of this exact failure mode. The team that founded MKV in 2002 explicitly cited "AVI's limitations" — and the limitation they meant was the freeze a 2005 viewer was hitting at minute 30 of every long movie. Original AVI files maxed out around 2 gigabytes because of how 1990s code did the math on file sizes. The chunk-size field in the AVI header was 32 bits, but most early reader code parsed it as a signed integer — which broke at 2 GB instead of 4 GB. Many production tools enforced an even tighter 1 GB cap to ensure interoperability with the lowest common denominator. In 1996, a fix called OpenDML let AVI break past the limit by splitting the file into smaller pieces and chaining them together. The catch: any player written before 1996 read only the first piece, then stopped. That is what happened to a generation of DVD-rip viewers around minute thirty of every long movie. Files that survived the OpenDML break ran into a different problem two decades later — the devices people actually own.

The Black Box on the iPhone

A 2007 wedding video sits on someone's old hard drive — a .avi file recorded on a camcorder, never converted. They AirDrop it to their iPhone. The Files app shows the file. They tap to play. Black box. No error message, no codec-installer prompt, no path forward — just silence.

iOS Safari refuses the AVI container as a matter of policy. Not the codec inside — the wrapper itself. Apple stopped supporting Microsoft's legacy video formats years ago and has not reversed course. Smart TVs, modern Android, even Microsoft's own Clipchamp follow the same pattern: AVI is treated as a format that exists for backward compatibility, not for new content. "Convert AVI to MP4" became the dominant AVI search query of the 2020s for that exact reason. Which is the part everyone sees. The part nobody talks about is why AVI is still being written today, on purpose, in 2026.

Why Screen Recorders Still Choose AVI in 2026

OBS crashes mid-recording. Windows force-restarts. The streamer reboots, expects a useless half-file, opens the .avi anyway. It plays — every minute up to the second the recorder died, then the file ends. The MP4 from a different session on the same desktop, recorded by a different program, won't open at all.

That gap is why a class of recording tools — OBS in some configurations, older Bandicam, many security-camera DVRs, a long tail of industrial-capture systems — still defaults to AVI in 2026. AVI alternates audio and video chunks at fixed positions inside its data block. If the writer stops mid-stream, what is on disk through the last completed pair plays back. MP4 puts its index — the table that tells a player where every frame lives — at the end of the file. A half-written MP4 has no index. Without the index, the file is unreadable until a separate recovery tool reconstructs one from the partial bytes. AVI never needed that step because its index was redundant from the start: every chunk's location is implicit in the alternating layout.

.AVI compared to alternatives

.AVI compared to alternative formats
Formats Criteria Winner
.AVI vs .MP4
Modern device compatibility and streaming support
MP4 plays on every modern device — iPhone, Android, Apple TV, smart TVs, every browser. AVI plays only on desktop media players like VLC and mpv; iOS Safari, Apple TV, and most streaming devices refuse it. MP4 also starts playing while it's still downloading; AVI doesn't. For any phone, TV, or browser made after about 2015, MP4 is the answer.
MP4 wins
.AVI vs .MKV
Container flexibility and modern feature support
MKV is open, IETF-standardized as RFC 9559 in October 2024, and supports unlimited subtitle tracks, font attachments, chapter markers, and codec metadata that AVI cannot represent. AVI predates MKV by ten years and was designed before B-frames, variable frame rates, and modern audio codecs were common. MKV is the modern open-container choice; AVI persists where its 1992-era structural simplicity is a feature.
MKV wins
.AVI vs .WMV
Microsoft video container family heritage
Both are Microsoft video containers from different generations. AVI (1992) was designed to be codec-agnostic — its 4-letter codec tag has hosted five different video compression formats over thirty years. WMV (1999) is locked to Microsoft's own video codec family. AVI has broader tooling and codec flexibility; WMV had better compression for the 2000s-era. Neither is recommended for new content today — MP4 or MKV is the modern answer.
Draw

Technical reference

MIME Type
video/x-msvideo
Magic Bytes
52 49 46 46 xx xx xx xx 41 56 49 20 RIFF header followed by AVI signature at bytes 8-11.
Developer
Microsoft
Year Introduced
1992
Open Standard
No
0000000052494646XXXXXXXX41564920 RIFF....AVI

RIFF header followed by AVI signature at bytes 8-11.

Binary Structure

AVI files are RIFF containers — the Resource Interchange File Format that Microsoft and IBM jointly published in 1991 as a generic chunk-based binary wrapper. Every AVI file begins with the same twelve bytes: `52 49 46 46` ('RIFF') at offset 0, a 4-byte little-endian total file size at offset 4, and `41 56 49 20` ('AVI ' with a trailing space) at offset 8. The 'AVI ' FOURCC distinguishes AVI from other RIFF-based formats like WAV ('WAVE') and AVI's own big-endian sibling RIFX. Following the 12-byte header, a nested LIST chunk named `hdrl` (header list) contains the main AVI header (`avih`) plus one stream list (`strl`) per video or audio track. Each stream list contains a stream header (`strh`) — the chunk that holds the codec FOURCC tag (`DIVX`, `XVID`, `H264`, `cvid`, `MJPG`, etc.) — and a stream format chunk (`strf`) carrying codec-specific configuration. The `movi` LIST chunk holds the actual interleaved audio + video sample data; an optional `idx1` flat index at the file end maps every chunk's offset and length for fast seeking. OpenDML AVI 2.0 (1996) replaces the single `RIFF('AVI ')` chunk with multiple `RIFF('AVI ')` and `RIFF('AVIX')` chunks chained inline, breaking the original 1 GB / 2 GB / 4 GB ceilings.

OffsetLengthFieldExampleDescription
0x00 4 bytes RIFF FOURCC 52 49 46 46 ASCII 'RIFF'. Marks this file as a Resource Interchange File Format container. Identical opening bytes in WAV, WebP, and other Microsoft RIFF formats.
0x04 4 bytes File size (little-endian) EC 1C 05 00 32-bit unsigned size of the rest of the file. Original AVI 1.0 readers parsed this as signed int32, breaking at 2 GB. OpenDML (1996) chains multiple RIFF chunks to span the limit.
0x08 4 bytes Format FOURCC ('AVI ') 41 56 49 20 ASCII 'AVI ' with trailing space. Distinguishes AVI from sibling RIFF formats (WAV uses 'WAVE', WebP uses 'WEBP'). The trailing space is part of the FOURCC.
0x0C 4 bytes LIST chunk header 4C 49 53 54 ASCII 'LIST'. Marks the start of the first nested LIST chunk — typically the 'hdrl' (header list) holding the AVI main header and per-stream descriptors.
0x10 4 bytes LIST size (little-endian) 7E 02 00 00 32-bit unsigned size of the LIST chunk's payload. The 'hdrl' LIST is fixed-size for a given track count; 'movi' LIST holds variable interleaved sample data.
0x14 4 bytes LIST type FOURCC ('hdrl') 68 64 72 6C ASCII 'hdrl' — the header list type marker. Other LIST types in AVI: 'strl' (stream list), 'movi' (movie data), 'INFO' (metadata).
0x18 4 bytes Main AVI header chunk ('avih') 61 76 69 68 ASCII 'avih'. Marks the start of the main AVI header chunk — 56 bytes containing microseconds-per-frame, max bytes-per-second, total frames, stream count, suggested buffer size, width, and height.
1991RIFF (Resource Interchange File Format) base specification published by Microsoft and IBM as part of the Multimedia Programming Interface and Data Specification 1.0. RIFF defines the chunk-based container framework AVI is built on.November 1992AVI 1.0 released as part of Microsoft Video for Windows 1.0. Designed as the RIFF-based answer to Apple QuickTime (.mov, 1991). Codec identification via 4-byte FOURCC tag in the per-stream header.February 1996OpenDML AVI File Format Extensions 1.02 published by Matrox and the OpenDML Consortium. Adds segmented RIFF chunks to break the 1 GB / 2 GB / 4 GB ceiling. Pre-1996 players cannot read past the first chunk.1999DivX 3.11 released — MPEG-4 ASP video inside AVI containers. Becomes the dominant pirated-movie format of the early 2000s, paired with MP3 audio inside the same AVI wrapper.2001Xvid open-source MPEG-4 ASP codec released as a DivX alternative. Keeps AVI dominant in open-source video distribution through the mid-2000s.2003H.264 / MPEG-4 AVC standardized. Encoders inside AVI (`H264` FOURCC) appear, but MP4 becomes the preferred container for H.264 because of MP4's better B-frame and timing handling. AVI begins its long decline.2017Microsoft discontinues Windows Movie Maker — the last consumer-grade Microsoft tool that defaulted to AVI output. Modern Microsoft creator tools (Clipchamp, the new Photos app) write MP4 by default.June 2024VLC 3.0.21 released. AVI playback and demuxing remain first-class features; no deprecation signal from the dominant AVI consumer. AVI persists in legacy archives, screen-recorder workflows, and security-camera DVRs.
Inspect AVI container and codec FOURCC ffmpeg
ffprobe -v quiet -print_format json -show_streams -show_format input.avi

Dumps every stream's codec, FOURCC tag, resolution, frame rate, audio sample rate, and container metadata as structured JSON. Reveals which video codec the AVI carries — the answer determines whether MP4 conversion is a stream copy or a full transcode.

Stream copy AVI into MKV (lossless, instant) ffmpeg
ffmpeg -i input.avi -c copy -y output.mkv

Copies the video and audio streams bit-for-bit into an MKV container with no re-encoding. Works for any AVI codec MKV can hold (most modern codecs including H.264, MPEG-4, MJPEG). Fails for Cinepak and a few obscure FOURCC variants where MKV demands a re-encode.

Convert AVI to MP4 with H.264 + AAC + faststart ffmpeg
ffmpeg -i input.avi -c:v libx264 -c:a aac -movflags +faststart -y output.mp4

Re-encodes the video to H.264 and audio to AAC inside an MP4 container — the universal compatibility target for iOS, Apple TV, smart TVs, and HTML5 video. The `+faststart` flag moves the MP4 moov atom to the file head so the file plays without waiting for the full download.

AVI MP4 transcode near-lossless MP4 plays on every modern device — iPhone, Apple TV, smart TVs, browsers. FileDex re-encodes the AVI to MP4's preferred compression and moves the file's index to the front so it plays while still downloading. Older AVI source codecs require a full rebuild; H.264-in-AVI files convert near-instantly.
AVI MKV remux lossless Copies the AVI's video and audio into an MKV container without re-encoding — fast, lossless, finishes in seconds. Use this when you want a modern container (subtitle tracks, chapter markers, no file-size cap) but don't need to change the actual compression.
AVI MOV transcode near-lossless MOV is the format Apple's pro video tools (Final Cut Pro, Motion) expect for clean import. FileDex re-encodes the AVI to MP4-compatible video and audio inside the MOV wrapper — a good fit when the next step is Apple's editing software.
AVI WEBM transcode lossy WebM uses open-source video and audio compression that produces smaller files than MP4's compression at the same visual quality. Every Chromium-based browser, Firefox, and recent Safari plays WebM. Pick this for web pages on bandwidth-constrained connections where every kilobyte matters.
AVI MP3 export lossless Pulls the audio track out of the AVI as a standalone MP3 file — instant when the AVI's audio is already MP3 (most 2000s-era videos), since FileDex copies it without re-encoding. Use this to recover audio from an old video recording.
AVI WAV transcode lossless Extracts the AVI's audio as uncompressed WAV — the format editing tools like Audacity and Adobe Audition prefer for clean import. Preserves the full original audio quality without re-encoding.
MEDIUM

Attack Vectors

  • Demuxer parsing bugs in older FFmpeg / libavformat — CVE-2017-9990 (heap overflow via crafted index chunks in AVI) and CVE-2014-9602 (out-of-bounds read in `avi_read_header`). Patched in current FFmpeg, but legacy media players that bundle older FFmpeg / MPlayer / VLC remain exposed.
  • Codec-renderer exploitation via crafted FOURCC dispatch — historical exploits in Indeo (Intel) and Cinepak decoders shipped with Windows Media Player. Microsoft has disabled most legacy codec auto-installation since Windows 10, but pre-2015 systems and Server installations may still load attacker-controlled codecs through the FOURCC registry lookup.
  • DLL hijacking via missing-codec prompts — the deprecated Windows Media Player "Codec missing — search online?" dialog historically loaded attacker-supplied DLLs from a now-defunct codec registry. Mostly theoretical post-2018 but documented as a vector for older Windows systems.
  • Subtitle and metadata renderer crashes — AVI does not natively support modern subtitle tracks, but third-party tools sometimes side-load `.idx`/`.sub` (VobSub) alongside an AVI; renderer bugs in those external subtitle tools have triggered crashes and OOB reads.

Mitigation: FileDex decodes AVI via FFmpeg compiled to WebAssembly inside the browser sandbox. The WASM sandbox confines any demuxer or codec exploit to the browser's isolated WASM memory — no host-system code execution, no DLL loading, no FOURCC-triggered binary side-loading. Microsoft's legacy codec-renderer chain is bypassed entirely; FileDex uses the FFmpeg-bundled software decoders only. A malformed AVI crashes the worker, contained to the browser tab. No file uploads.

The universal AVI player — handles every FOURCC variant including obscure 1990s codecs (Cinepak, Indeo). VLC 3.0.21 released June 2024; 4.0 in active development. First-class AVI support across Windows, macOS, Linux, iOS, and Android.
FFmpeg tool
Read, write, and transcode every AVI variant via `libavformat/avidec.c` and `avienc.c`. The reference implementation for AVI handling — most software AVI support in the wild ultimately uses libavformat. Active development; ffmpeg 7.x current.
Reads AVI for muxing into MKV containers — the standard "modernize" path for legacy AVI archives. Maintained by Moritz Bunkus, also a co-author of RFC 9559 (Matroska standard).
Windows-native AVI editor. Active fork of the original VirtualDub (2000-2013) by Avery Lee — still the canonical Windows tool for frame-accurate AVI cuts, filters, and codec swaps. Last release Q1 2025.
HandBrake tool
Cross-platform GUI converter that reads AVI and writes MP4 / MKV with H.264 / H.265 / AV1. The standard non-CLI tool for batch-converting old AVI archives to modern containers.
Avidemux tool
Open-source GUI AVI editor for Linux, macOS, and Windows. Handles cuts, joins, and filter chains — the spiritual successor to VirtualDub on Linux. Active maintenance through 2024.