An AVI file is built on the avi riff format, which organizes everything into labeled chunks. Understanding the avi file structure tells you why a damaged index can stop seeking but not destroy your video data. Each major chunk matters: the RIFF wrapper, the header list (hdrl), the movie data (movi), and the index (idx1).

The RIFF Container and the AVI Form Type

Every AVI file starts with a RIFF header. The first four bytes are the characters "RIFF". Next comes a 4-byte size value, stored in little-endian format (the least significant byte first). That size covers the rest of the file after the size field itself. After the size, the next four bytes are the form type: "AVI " (note the trailing space). Everything else in the file sits inside this RIFF container. The avi riff format uses this simple structure to nest lists and data chunks, so you can locate parts of the file even if some sections are damaged.

LIST Hdrl the Header List

The first major subchunk inside the RIFF container is usually a LIST chunk with the ID "hdrl". This list holds all the headers that define the video and audio streams. Inside hdrl you will find:

  • avih: the main AVI header, which stores the total number of streams and the playback timing.
  • strh: a stream header for each stream (video stream 0, audio stream 1, etc.).
  • strf: the stream format chunk for each stream, describing codec or audio format details.

These headers tell a player how to interpret the data that follows. Without a valid avi header hdrl, the player may not know the video dimensions, frame rate, or audio sample rate.

LIST Movi the Movie Data

After the headers comes the LIST "movi". This is where the actual audio and video frames live. Each frame is stored as a separate data chunk. The chunk ID tells you which stream it belongs to and what kind of data it contains. For example:

  • 00dc 01wb chunks: The first two characters are the stream number (00 for stream 0, 01 for stream 1). The next two characters are the type: "dc" for compressed video, "wb" for audio.

Because each chunk carries its own label and size, a player or repair tool can read through the avi movi chunk list and find every frame, even if the index is missing. This is why the frames themselves survive when the index is lost.

The Idx1 Chunk the AVI 1.0 Index

At the very end of the file, after the movi list, you will find the avi idx1 index chunk. This chunk contains one entry for every data chunk in the movi list. Each entry records the chunk ID, the offset (position) of that chunk within the file, and its size. When a player opens the file, it reads this index first to know exactly where every frame is located.

If the idx1 chunk is missing or corrupted, the player cannot quickly jump to a specific frame. Seeking (skipping forward or backward) breaks because the player has no map. However, the frames themselves are still present in the avi movi chunk list. A repair tool can scan the entire movi section, read each chunk label and size, and rebuild a new idx1 index from scratch.

Why a Missing Index Does Not Destroy the Frames

Reading Chunks Without an Index

Each data chunk inside the movi list is self describing. It starts with a four character ID (like "00dc"), followed by a 4 byte little-endian size, then the actual frame data. This means a program can walk through the movi list sequentially without needing an index. It reads the chunk ID, reads the size, skips that many bytes to reach the next chunk, and repeats. The frames are all there.

Without the index, a player cannot randomly access a frame at a given time. It would have to read from the beginning every time, which is impractical for seeking. But the raw video and audio data remain intact. That is why a repair that rebuilds the avi idx1 index by scanning the movi list can restore full functionality.

How a Repair Tool Rebuilds the Index

Because the avi riff format stores each chunk with a label and size, rebuilding the index is a straightforward process. Follow these steps:

  1. Open the AVI file and locate the RIFF header.
  2. Skip past the hdrl list (or read it to confirm stream counts).
  3. Find the start of the LIST "movi" chunk.
  4. Read each data chunk inside movi: record its ID, its offset from the start of the file, and its size.
  5. After reaching the end of movi, write a new idx1 chunk at the end of the file, containing an entry for every chunk found.

This works even if the original idx1 is completely missing. The repaired file will then allow seeking and playback in any player that supports the AVI 1.0 index.

Practical Implications for Your AVI Files

When Seeking Fails

If you have an AVI file that plays but cannot seek, or that a player says is damaged, the problem is almost certainly the index. The video and audio data inside the avi movi chunk are likely fine. Tools that understand the avi file structure can scan the movi list and regenerate the index. One option is avi.repair, which offers an online service for recovering corrupted AVI files.

Sequential Playback Without an Index

Remember that the avi idx1 index is not required for sequential playback. If you only need to watch a file from start to finish, a missing index may not bother you. But for any kind of navigation, the index is essential. Understanding this structure helps you decide whether a file can be repaired or if the data is truly lost.