tags:

views:

118

answers:

1

I'm in the very early stages of working on a tag editor for mp4 files and more specifically iTunes AAC ones. After doing some snooping around it seems that the file's structure is not as complicated as I first thought and is built in a sort of tree like the following

4 Bytes [Atom Length]  4 Bytes [Atom Name]  X Bytes [Atom Data]

An atom's data is as large as the length and can contain either Data(information) or another atom. What I am trying to work out is how one determines if the data is information or an actual atom. Any insight would be much appreciated.

A: 

After a lot of snooping around it seems the only way to determine if a node leads to data or another node is by knowing the data structure. As I am only interested in the tags contained the structure is pretty easy to figure out. All the tags are contained in the following hierarchy:

moov.udta.meta.ilst

When delving into the ilst node each tag is represented as a child atom who's name determines what data it contains. As for the actual data, each child atom carries a child of its own which contains the actual information and a flag as to what sort of information it is e.g text or numbers, so all in all it looks something like this:

moov.udta.meta.ilst.[atom size][atom name].[data]

Of course this still leaves the issue with self made tags stored in the uuid atom node which companies like Sony use to add more information to the file. I would imagine that each child in the uuid stores its children in the same way ilst does but I can't be sure.

DeanMc