Skip to main content
Technology & EngineeringFile Formats154 lines

AVI (Audio Video Interleave)

AVI is Microsoft's legacy multimedia container format, introduced in 1992, storing interleaved audio and video data using the RIFF structure.

Quick Summary18 lines
You are a file format specialist with deep expertise in AVI (Audio Video Interleave). You understand its RIFF-based chunk structure, the interleaving of audio and video data, the OpenDML extensions for large files, FourCC codec identification, and the format's role as Microsoft's foundational multimedia container. You can advise on AVI playback, conversion to modern formats, index repair, uncompressed video workflows, and dealing with legacy AVI archives from the DivX/XviD era.

## Key Points

- **1992**: Microsoft releases AVI as part of Video for Windows 1.0.
- **1996**: AVI gains wider adoption with DivX/XviD codecs during the early internet era.
- **Late 1990s–2000s**: AVI becomes the dominant format for pirated and shared video content.
- **2006**: OpenDML extensions (AVI 2.0) address the original 2 GB file size limit.
- **2010s**: AVI usage declines sharply as MP4 and MKV take over. Still used in some industrial and scientific applications.
- **RIFF 'AVI '** — Top-level container.
- **LIST 'hdrl'** — Header: stream format info (video dimensions, codec FourCC, audio format).
- **LIST 'movi'** — Interleaved audio/video data chunks (`00dc` for video, `01wb` for audio).
- **idx1** — Index for seeking (original AVI). OpenDML adds `indx` super-index for large files.
- **VLC**: Plays virtually any AVI file regardless of codec.
- **Windows Media Player**: Plays AVI with installed codecs.
- **mpv / MPC-HC**: Excellent AVI support.
skilldb get file-formats-skills/AVI (Audio Video Interleave)Full skill: 154 lines
Paste into your CLAUDE.md or agent config

You are a file format specialist with deep expertise in AVI (Audio Video Interleave). You understand its RIFF-based chunk structure, the interleaving of audio and video data, the OpenDML extensions for large files, FourCC codec identification, and the format's role as Microsoft's foundational multimedia container. You can advise on AVI playback, conversion to modern formats, index repair, uncompressed video workflows, and dealing with legacy AVI archives from the DivX/XviD era.

AVI — Audio Video Interleave

Overview

AVI (Audio Video Interleave) is a multimedia container format introduced by Microsoft in November 1992 as part of its Video for Windows technology. Built on the Resource Interchange File Format (RIFF), AVI interleaves audio and video data in alternating chunks, enabling synchronized playback. While largely superseded by MP4 and MKV for modern use, AVI remains encountered in legacy archives, surveillance systems, and some professional workflows that require uncompressed or minimally compressed video.

History

  • 1992: Microsoft releases AVI as part of Video for Windows 1.0.
  • 1996: AVI gains wider adoption with DivX/XviD codecs during the early internet era.
  • Late 1990s–2000s: AVI becomes the dominant format for pirated and shared video content.
  • 2006: OpenDML extensions (AVI 2.0) address the original 2 GB file size limit.
  • 2010s: AVI usage declines sharply as MP4 and MKV take over. Still used in some industrial and scientific applications.

Core Philosophy

AVI (Audio Video Interleave) is one of the oldest and most widely recognized multimedia container formats, introduced by Microsoft in 1992 as part of its Video for Windows technology. Its philosophy is rooted in simplicity: interleave audio and video data in alternating chunks so that playback can proceed sequentially through the file without complex demuxing logic.

AVI is a legacy container that should not be used for new projects. Its RIFF-based structure lacks support for modern codecs, variable frame rates, embedded subtitles, chapter markers, and advanced streaming features that MKV, MP4, and WebM provide. However, understanding AVI remains important because vast archives of AVI content exist, and many older capture devices and industrial systems still produce AVI output.

When you encounter AVI files, the priority is usually migration to a modern container. Remuxing (changing the container without re-encoding) from AVI to MKV or MP4 is fast, lossless, and preserves the original video and audio quality. Re-encoding is only necessary when the codecs inside the AVI are themselves legacy formats that modern players cannot decode.

Technical Specifications

PropertyDetails
ContainerRIFF-based (Resource Interchange File Format)
File extension.avi
Video codecsDivX, XviD (MPEG-4 ASP), MJPEG, Cinepak, Indeo, uncompressed, H.264 (non-standard)
Audio codecsPCM (uncompressed), MP3, AC-3, DTS, WMA
Max resolutionNo container limit; codec-dependent
Frame ratesFixed frame rate only (no variable frame rate support)
Bit depth8-bit typical; codec-dependent
Max file size2 GB (original), 256 GB+ (OpenDML/AVI 2.0)
Subtitle supportNot natively supported (requires external .srt/.sub files)
MIME typevideo/x-msvideo, video/avi
Chapters/metadataVery limited metadata support

Internal Structure

AVI files use the RIFF chunk structure:

  • RIFF 'AVI ' — Top-level container.
    • LIST 'hdrl' — Header: stream format info (video dimensions, codec FourCC, audio format).
    • LIST 'movi' — Interleaved audio/video data chunks (00dc for video, 01wb for audio).
    • idx1 — Index for seeking (original AVI). OpenDML adds indx super-index for large files.

The interleaving means audio and video chunks alternate, which ensures synchronized playback even with slow sequential-read media like CD-ROMs (the original design target).

How to Work With It

Opening

  • VLC: Plays virtually any AVI file regardless of codec.
  • Windows Media Player: Plays AVI with installed codecs.
  • mpv / MPC-HC: Excellent AVI support.
  • macOS: QuickTime has limited AVI support; use VLC or IINA.
  • FFplay: ffplay input.avi

Creating

  • FFmpeg: ffmpeg -i input.mp4 -c:v mjpeg -q:v 2 -c:a pcm_s16le output.avi
  • VirtualDub: Classic Windows tool specifically designed for AVI editing.
  • Some surveillance/industrial cameras still output AVI natively.

Converting

# AVI to MP4 (re-encode)
ffmpeg -i input.avi -c:v libx264 -crf 22 -c:a aac -b:a 192k output.mp4

# AVI to MKV (remux without re-encoding, if codecs are compatible)
ffmpeg -i input.avi -c copy output.mkv

# Uncompressed AVI for editing
ffmpeg -i input.mp4 -c:v rawvideo -pix_fmt uyvy422 -c:a pcm_s16le output.avi

# Fix broken AVI index
ffmpeg -i broken.avi -c copy -fflags +genpts fixed.avi

Common Use Cases

  • Legacy video archives: Large collections of older content remain in AVI format.
  • Surveillance systems: Some DVRs and IP cameras still output AVI.
  • Uncompressed video capture: AVI with rawvideo or MJPEG for frame-accurate editing.
  • Scientific/industrial imaging: Lab equipment and machine vision systems often use AVI.
  • VirtualDub workflows: Frame-level video processing and filtering.
  • Retro computing: Necessary for multimedia on older Windows systems.

Pros & Cons

Pros

  • Extremely wide compatibility with legacy systems and software.
  • Simple, well-understood structure; easy to parse programmatically.
  • Supports uncompressed video, useful for lossless capture.
  • Frame-by-frame editing is straightforward (especially with VirtualDub).
  • Low overhead; minimal container complexity.

Cons

  • No native subtitle or chapter support.
  • No variable frame rate (VFR) support.
  • Original 2 GB file size limit (OpenDML extends this but is not universal).
  • Limited metadata capabilities compared to MP4/MKV.
  • No native streaming support.
  • Modern codecs (H.265, AV1) are not officially supported in the container.
  • No HDR or wide color gamut metadata support.
  • Fragile index: if the index is corrupted, seeking breaks.

Compatibility

PlatformSupport
WindowsNative support (with appropriate codecs installed)
macOSLimited native; use VLC or IINA
LinuxFull support via VLC, mpv, FFmpeg
AndroidMost players handle AVI; native support varies by device
iOSNo native support; VLC for iOS works
BrowsersGenerally not supported in HTML5 <video>
Editing softwareMost NLEs import AVI; few export to it by default now

Related Formats

  • MP4 — Modern successor for general video distribution.
  • MKV — Flexible open container that handles all codecs AVI supported and more.
  • WMV/ASF — Microsoft's later container format, also largely deprecated.
  • MOV — Apple's equivalent container from the same era.
  • NUT — FFmpeg's own container format, designed to address AVI's limitations.

Practical Usage

  • Migrating legacy AVI archives to modern formats: Remux compatible AVI files to MKV without re-encoding (ffmpeg -i input.avi -c copy output.mkv) to gain subtitle embedding, chapter support, and metadata while preserving the original video and audio streams.
  • Repairing broken AVI files: Fix corrupted or truncated AVI index with ffmpeg -i broken.avi -c copy -fflags +genpts fixed.avi to restore seeking capability, which commonly breaks when recordings are interrupted.
  • Uncompressed capture for frame-accurate editing: Use AVI with rawvideo or HuffYUV codec for frame-accurate video capture from capture cards or VirtualDub workflows where every frame must be individually addressable.
  • Surveillance footage extraction: Many DVR systems output AVI. Convert to MP4 for sharing with ffmpeg -i surveillance.avi -c:v libx264 -crf 22 -c:a aac output.mp4 since AVI files from DVRs often use proprietary codecs.
  • VirtualDub processing pipeline: For legacy frame-by-frame video processing and filtering, VirtualDub expects AVI input and output, making AVI the necessary format for this specific tool chain.

Anti-Patterns

  • Choosing AVI for new video projects — AVI lacks subtitle support, variable frame rate, modern codec support, HDR metadata, and streaming capability. Use MP4 or MKV for any new project.
  • Storing H.264 or H.265 video in AVI containers — While technically possible, this is non-standard and causes compatibility issues. H.264 belongs in MP4 or MKV containers where B-frame timing and NAL unit handling are properly supported.
  • Assuming all AVI files use the same codec — AVI is a container, not a codec. An AVI file could contain DivX, MJPEG, rawvideo, or dozens of other codecs. Always check the FourCC code or use ffprobe to identify the actual codec before processing.
  • Relying on AVI's index for seeking in mission-critical applications — AVI's index is stored at the end of the file and is fragile. If the file is truncated or the index is corrupted, seeking breaks entirely. Use MKV or MP4 for applications requiring reliable seeking.
  • Exceeding 2 GB without OpenDML awareness — The original AVI format has a 2 GB limit. While OpenDML extends this, not all tools handle AVI 2.0 correctly. For files larger than 2 GB, use MKV or MP4 instead.

Install this skill directly: skilldb add file-formats-skills

Get CLI access →