tinytag icon indicating copy to clipboard operation
tinytag copied to clipboard

TinyTag fails to parse large MP4 files where moov atom comes after media data

Open aw-was-here opened this issue 3 months ago • 1 comments

Describe the bug A user gave me an MP4 that was edited in Virtual DJ. Most of the metadata was in XMP format. But they added new metadata which Virtual DJ then slammed onto the end of the file and... TinyTag says there is no data in it.

After a bit of debugging, _traverse_atoms parses sequentially from file start but gets confused by media data section, never reaching the moov atom.

File structure is basically a standard MP4: ftyp, uuid (with the XMP data), free, [large media section], then moov with proper udta/meta/ilst hierarchy.

Suggested fix:

TinyTag should either:

  1. Skip/ignore media data atoms when parsing
  2. Search for moov atom independently of sequential parsing

Sample file If you need it, we'll have to arrange something because this is a commercial file and I obviously can't post it out in the open.

aw-was-here avatar Aug 26 '25 04:08 aw-was-here

You can use the TINYTAG_DEBUG=1 env variable to see what _traverse_atoms tries to do. Presumably it's reading some size incorrectly?

mathiascode avatar Aug 29 '25 16:08 mathiascode