The second required list is LIST movi. It holds the frames and audio as
chunks, either directly or grouped into rec lists. A
rec list groups chunks that should be read from disk in one go, which
was meant for files interleaved to play from CD-ROM.
Data chunk IDs
The FOURCC of a data chunk is two ASCII digits giving the stream number, then two characters giving the kind of data.
| Code | Contents |
|---|---|
db | Uncompressed video frame |
dc | Compressed video frame |
pc | Palette change |
wb | Audio data |
So if stream 0 is audio and stream 1 is compressed video, the chunks are
00wb and 01dc. Text streams may use any two characters.
Chunks are padded to an even length, as in all RIFF files.
An OpenDML file also has index chunks named nnix among the data;
see OpenDML extensions.
Palette changes
A nnpc chunk updates the palette of a video stream during
playback. The stream’s header then has the AVISF_VIDEO_PALCHANGES flag. Its
data is the AVIPALCHANGE structure:
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 1 | BYTE | bFirstEntry | Index of the first palette entry to change. |
| 1 | 1 | BYTE | bNumEntries | Number of entries to change; zero means all 256. |
| 2 | 2 | WORD | wFlags | Reserved. |
| 4 | 4 × n | PALETTEENTRY[] | peNew | The new entries: red, green, blue and flags, one byte each. |
Worked example
A compressed video frame of 1,024 bytes in stream 0 is stored as:
| Bytes | Meaning |
|---|---|
30 30 64 63 | Chunk ID 00dc |
00 04 00 00 | Size 1,024, little-endian |
| 1,024 bytes | The frame, with no pad byte because the size is even |