TinyTag fails to parse large MP4 files where moov atom comes after media data
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:
- Skip/ignore media data atoms when parsing
- Search for
moovatom 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.
You can use the TINYTAG_DEBUG=1 env variable to see what _traverse_atoms tries to do. Presumably it's reading some size incorrectly?