AVI file format : inconsistent interpretation of size fields

I started again a kind of AVI Riff format viewer for Macintosh. Because Mac is used a lot in video industry and handling AVI file formats is very crucial. So, it would be nice if we have such a program for the Macintosh. Although there is a command line interface version of RIFF viewer, GUI version seems not to exist.

Anyway, while I was parsing the RIFF format, I found something inconsistent and which was not documented well. Let’s take a look at basic format which is related to what I describe.
Difference in size fields for movi and idx1 chunk

The value of size field in movi chunk means the size of data. For example, for 01dc block, the size field contains value for the size of its following data.

On the other hand, the idx1 chunk has its own 01dc chunks and each 01dc chunk has its own size field. The size field means the whole 01dc chunk size, i.e its fcc type ( 01dc), the size field, and a data field. So, the whole 01dc chunk size is 16 bytes, not the one indicated by the size field, while that of movi chunk is the actual data size.

So, be careful in parsing the RIFF format.
I’m checking if each field is parsed OK. Most are not documented.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: