Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mutagen appears to munge hex tags inside of mp4 container #103

Closed
lazka opened this issue Jul 4, 2014 · 8 comments
Closed

mutagen appears to munge hex tags inside of mp4 container #103

lazka opened this issue Jul 4, 2014 · 8 comments
Labels
bug

Comments

@lazka
Copy link
Member

@lazka lazka commented Jul 4, 2014

Originally reported by: Christoph Reiter (Bitbucket: lazka, GitHub: lazka)


From teh.awes...@gmail.com on December 23, 2011 03:32:21

(This issue was surfaced via the beets tagger's use of mutagen, reference : https://code.google.com/p/beets/issues/detail?id=209 )

The following pastebin : http://pastebin.com/diff.php?i=LmZphea0 shows that, according to AtomicParsley, the "Encoding Params" atom got munged somehow :

before
------
Atom "----" [Encoding Params] contains: hex 0x76657273 00000001 61636266 00000001 62726174 0001F400 63646376 00010504 

after
-----
Atom "----" [Encoding Params] contains: vers

Adrian Sampson, author of beets, contributes some additional detail :

" This seems to be an incompatibility in the ways that AtomicParsley and Mutagen look at MPEG-4 atoms. Just opening and saving an AAC file with Mutagen causes AtomicParsley to lose the hex data in that field (although Mutagen can still see it). "

This may or may not be a bug in Mutagen. This bug submission hopes to cover the case where it is. :D

Original issue: http://code.google.com/p/mutagen/issues/detail?id=103


@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From lalinsky on December 29, 2011 00:29:58

Can you please upload the file somewhere or send it to me via email lalinsky@gmail.com?
@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From dsu...@gmail.com on February 02, 2012 06:41:00

I'm also seeing this when writing to MP4 files. Should be categorized as a bug, not an enhancement.

Somehow unicode objects aren't being encoded properly.
@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From teh.awes...@gmail.com on December 29, 2011 08:31:08

I sent you the file via email. :)
@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From reiter.christoph@gmail.com on July 25, 2012 10:45:54

OK, it throws away the version and flags of the freeform data and in this case "Encoding Params" is binary and not text.

One thing that seems odd, is that it catches all exceptions during loading and simply throws away all tags if parsing one of them fails.

Attached patch prevents loading such files, but this is not a solution.

Possible Solution: Introduce a Freeform class that holds those flags (subclass from string to stay compatible). Rework exceptions to not throw away tags if loading fails.

Ideas welcome.

( So I don't have to search for it again: http://web.archive.org/web/20091024221536/http://geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt )

Status: Accepted
Labels: -Type-Enhancement -Priority-Low Type-Defect Priority-High

Attachment: 103-error.patch

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From dsu...@gmail.com on March 04, 2012 07:29:56

I was able to work around this by encoding to utf-8. For example:

tags[atomid] = value.encode('utf-8')
@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From reiter.christoph@gmail.com on October 19, 2012 04:24:09

Attached is a possible fix: Introduces MP4FreeForm which saves the format flags similar to MP4Cover.

Also attached: The file used in the report above.

Attachment: mutagen-103-v2.patch mutagen-103.m4a

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From adrian.sampson on October 20, 2012 09:51:33

Amazing. Thanks, Christoph.
@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From reiter.christoph@gmail.com on October 20, 2012 06:04:15

This issue was closed by revision r135 .

Status: Fixed

@lazka lazka added trivial bug labels Apr 7, 2016
@lazka lazka closed this Apr 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.