AVI Container
Audio Video Interleave stores audio and video chunks in a RIFF-based file structure with stream headers and optional indexes.
An AVI reader first learns the streams, then reads alternating chunks of their data. Audio Video Interleave uses the RIFF chunk structure, with AVI as its file type.
A RIFF chunk contains a four-character ID, a size, and data. LIST chunks group child chunks. The size lets a reader advance over a section instead of interpreting every byte as media; alignment rules can add a padding byte for odd-sized data.
| AVI structure | Information used by the reader |
|---|---|
| hdrl list | File and stream descriptions |
| Stream header/format descriptions | Track timing conventions and codec setup |
| movi list | Media chunks assigned to the streams |
| idx1 or OpenDML indexes | Media locations and information used for navigation |
Chunk IDs connect payloads to stream descriptions
A media chunk's ID associates it with a stream and a data kind. The reader uses that stream's header and format description to interpret the payload, then passes compressed video to its decoder. AVI can therefore hold different codecs, including MPEG-4 Part 2 or DV, without AVI itself defining their compression.
The timing model also comes from the stream description and chunk sequence. It predates the flexible per-sample composition conventions of some newer formats. Writers and readers have developed extensions and conventions to accommodate different encoded arrangements; those details matter when handling an unusual legacy file.
The same opening, two different seeks
A reader can scan a readable movi list sequentially. To jump into a long movie, a useful index gives it the corresponding chunk locations and restart information. If navigation is absent or damaged, the opening can still play while the reader spends much longer finding a later location.
OpenDML extensions provide additional indexing and larger-file arrangements using RIFF/AVIX structures. A large AVI is therefore not simply a classic small AVI with more bytes; the reader must follow the applicable extended organization.
A remux of intact streams can write different indexes in a new package. It need not reconstruct pictures to improve navigation. If a particular media chunk is damaged, rebuilding the index only supplies a better route to that damaged data.
For an Emby file comparison, distinguish a sequential-read result from a seek result and record the detected codec and legacy format properties. The source's age does not name a failure stage; chunk interpretation, navigation, and decoding do.