Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(windows) command line m4a tagger?
20-11-2017, 19:16
Post: #1
(windows) command line m4a tagger?
I'm trying to devise a suitable scheme for tagging m4a files. Some of the very useful facilities that MinimServer offers depend on multiple tags, e.g. for performer or artist. As far as I can tell these are expected to be in the format that mp3tag chooses.

In the past, I've used AtomicParsley as a command line tagger, but its developers take the view that multiple tags are disallowed except in the "reverse DNS" format, and even then the com.apple.iTunes "domain" (which is where custom tags are created by mp3tag) is specifically excluded from multiple values. It's clear that there's little agreement about m4a tagging, so I shouldn't be surprised.

I did try hacking the AtomicParsley executable so that the exclusion didn't occur. This leaves AtomicParsley clear that I've created multiple tags, but it does this by putting the different data atoms under the same atom path. mp3tag creates a complete atom path hierarchy for each value, which seems to be what MinimServer expects. So each sees only one of the separate performer tags. Confusingly mp3tag reads through to the last one whereas MinimServer only reads the first one. (At least I think that's what happens.)

I know that my negligible C++ programming skills mean that I won't be fixing AtomicParsley, so I need another tool. The lack of agreement about the (finer) points of the standard confirms me in the view that I should prepare the tagging information in a simple text file and script the application to the m4a files. If I do this, I would be able to abandon m4a files and transcode everything to flac and then retag everything with a suitable script to drive a flac tagging program. This is a last resort, which I'd like to avoid

So, does anybody have any suggestions as to a suitable program?
Find all posts by this user
Quote this message in a reply
20-11-2017, 21:30
Post: #2
RE: (windows) command line m4a tagger?
Which platform are you using to run your tagging program?
Find all posts by this user
Quote this message in a reply
21-11-2017, 02:21
Post: #3
RE: (windows) command line m4a tagger?
(20-11-2017 21:30)simoncn Wrote:  Which platform are you using to run your tagging program?

Windows 10. I'd expect to use powershell for scripting. I would probably use mp3tag for those times when a GUI is convenient. I don't anticipate moving to GNU/linux for interactive computing, although I do have an old HP microserver that essentially acts as a NAS, and is running Ubuntu 16.04. I has a minimal lxde and X2Go, so I can run interactive sessions on it. e.g. I could use that to investigate the python mutagen library, before trying to figure out the best way of using this on windows if that's the only feasible route.

For clarity, I'm not using the AtomicParsley from the old soureceforge site, but the fork from http://bitbucket.org/wez/atomicparsley, for which the windows builds come from: https://bitbucket.org/jonhedgerows/atomi...downloads/

The only odd thing about the tagging I do, is that I use the unsynced lyrics tag to provide extra textual information. I set minimserver to use that as the comment tag, and BubbleUpnp will happily show that on my ageing tablet as part of the metadata. All the tagging programs that I've seen have @lyr (Lyrics) as the only standard tag which can contain a significant amount of text.
Find all posts by this user
Quote this message in a reply
21-11-2017, 09:10
Post: #4
RE: (windows) command line m4a tagger?
What exactly do you mean by "putting the different data atoms under the same atom path"?
Find all posts by this user
Quote this message in a reply
21-11-2017, 11:29 (This post was last modified: 21-11-2017 11:30 by paultaylor.)
Post: #5
RE: (windows) command line m4a tagger?
(20-11-2017 19:16)skeptic Mike Wrote:  I know that my negligible C++ programming skills mean that I won't be fixing AtomicParsley, so I need another tool. The lack of agreement about the (finer) points of the standard confirms me in the view that I should prepare the tagging information in a simple text file and script the application to the m4a files. If I do this, I would be able to abandon m4a files and transcode everything to flac and then retag everything with a suitable script to drive a flac tagging program. This is a last resort, which I'd like to avoid

So, does anybody have any suggestions as to a suitable program?
Hi Mike, since you know C++ I guess you probably know Java as well. So how about my opensrc java jaudiotagger lib - https://bitbucket.org/ijabz/jaudiotagger. This provides a consistent way of tagging all the audio formats it supports (and does support multiple values for com.apple.iTunes reverse dns fields).It is the library used not only by SongKong/Jaikoz but also Bliss tagger, Beatunes and a host of other tools.

These are the fields supported for all formats - https://bitbucket.org/ijabz/jaudiotagger...ew-default
Visit this user's website Find all posts by this user
Quote this message in a reply
21-11-2017, 14:04
Post: #6
RE: (windows) command line m4a tagger?
(21-11-2017 09:10)simoncn Wrote:  What exactly do you mean by "putting the different data atoms under the same atom path"?

using AtomicParsley with -T option to dump the information. First this is three PERFORMERS as written by AtomicParsley:

Atom ---- @ 1355513 of size: 147, ends @ 1355660
Atom mean @ 1355521 of size: 28, ends @ 1355549
Atom name @ 1355549 of size: 21, ends @ 1355570
Atom data @ 1355570 of size: 27, ends @ 1355597
Atom data @ 1355597 of size: 34, ends @ 1355631
Atom data @ 1355631 of size: 29, ends @ 1355660

This is the same as written by mp3Tag:

Atom ---- @ 1361620 of size: 87, ends @ 1361707
Atom mean @ 1361628 of size: 28, ends @ 1361656
Atom name @ 1361656 of size: 21, ends @ 1361677
Atom data @ 1361677 of size: 30, ends @ 1361707
Atom ---- @ 1361707 of size: 86, ends @ 1361793
Atom mean @ 1361715 of size: 28, ends @ 1361743
Atom name @ 1361743 of size: 21, ends @ 1361764
Atom data @ 1361764 of size: 29, ends @ 1361793
Atom ---- @ 1361793 of size: 84, ends @ 1361877
Atom mean @ 1361801 of size: 28, ends @ 1361829
Atom name @ 1361829 of size: 21, ends @ 1361850
Atom data @ 1361850 of size: 27, ends @ 1361877

so, each tag has it's own hierarchy of atoms for one data atom (i.e. actual Performer name). Logically the AtomicParsley version conveys the same information by putting all the data atoms in the same hierarchy.

Presumably Paul Taylor will know how he handles this in his java library. My guess would be the same way that mp3Tag does. It's possible that the mp4 standard would tell which is more formally "correct".
Find all posts by this user
Quote this message in a reply
21-11-2017, 16:03 (This post was last modified: 21-11-2017 16:06 by paultaylor.)
Post: #7
RE: (windows) command line m4a tagger?
(21-11-2017 14:04)skeptic Mike Wrote:  Presumably Paul Taylor will know how he handles this in his java library. My guess would be the same way that mp3Tag does. It's possible that the mp4 standard would tell which is more formally "correct".
Yes, it is the same as MP3Tag, separate reversedns atoms (each containing mean, name & data) for each performer.

AtomicParsley has not been updated for years (even this fork), I use it myself sometimes for reading data and comparing with jaudiotagger but I have never used it for writing data.
Visit this user's website Find all posts by this user
Quote this message in a reply
21-11-2017, 16:20
Post: #8
RE: (windows) command line m4a tagger?
I have found something in the iTunes Metadata Format Specification document that implies that the Atomic Parsley encoding is valid.

Code:
The value of the metadata item is currently expressed only as immediate in-line data, in a data atom
'data'. All data atoms start with two common fields: a type indicator, and a locale indicator. Each
of these fields is four bytes long. There may be multiple value entries; see below for the required
ordering.

aligned(8) class MetaItemAtom extends Atom(meaning) {
    if (meaning='----') {
        MeaningAtom extended_meaning;
        NameAtom the_name; // optional
    }
    DataAtom the_value; // 1 or more of these
}

aligned(8) class DataAtom extends Atom('data') {
    type_indicator the_type;
    unsigned int(32) the_locale = 0; // reserved to be 0
    unsigned int(8) value[]; // to fill the atom
}

I think it is clear from this that it is OK to have multiple 'data' atoms representing multiple values.

It shouldn't be difficult for me to update MinimServer to accept this format. Please upload a test file containing multiple 'data' atoms for the same 'mean' atom to my FTP server so that I can test the new code. I will PM you the server details.
Find all posts by this user
Quote this message in a reply
21-11-2017, 22:44
Post: #9
RE: (windows) command line m4a tagger?
(21-11-2017 16:20)simoncn Wrote:  I have found something in the iTunes Metadata Format Specification document that implies that the Atomic Parsley encoding is valid.

Code:
The value of the metadata item is currently expressed only as immediate in-line data, in a data atom
'data'. All data atoms start with two common fields: a type indicator, and a locale indicator. Each
of these fields is four bytes long. There may be multiple value entries; see below for the required
ordering.

aligned(8) class MetaItemAtom extends Atom(meaning) {
    if (meaning='----') {
        MeaningAtom extended_meaning;
        NameAtom the_name; // optional
    }
    DataAtom the_value; // 1 or more of these
}

aligned(8) class DataAtom extends Atom('data') {
    type_indicator the_type;
    unsigned int(32) the_locale = 0; // reserved to be 0
    unsigned int(8) value[]; // to fill the atom
}

I think it is clear from this that it is OK to have multiple 'data' atoms representing multiple values.

It shouldn't be difficult for me to update MinimServer to accept this format. Please upload a test file containing multiple 'data' atoms for the same 'mean' atom to my FTP server so that I can test the new code. I will PM you the server details.

Thanks for looking at that. It is interesting. I'll prepare a sample file. I don't know how useful it will be if no available taggers do this.

So far, I've only found that mp3tag will actually create multi valued tags that MinimServer supports. And presumably Paul's tagging library. the documentation for the mutagen library suggests that it might support multi value tags. The source code comments in https://github.com/quodlibet/mutagen/blo..._init__.py suggest the same understanding, and also comments:

# don't write atoms back if we have added a new one with
# the same name, this excludes freeform which can have
# multiple atoms with the same key (most parsers seem to be able
# to handle that)

Although when I tried to use Ex Falso (the tagger from quodlibet which supplies the mutagen library) it refused to create multiple values claiming that the m4a format doesn't allow this!

Other taggers that I've tried seem to either not support multiple values (for m4a files), or think that they are to be represented by a single value with a delimiter character. e.g. Windows 10 Explorer which uses forward slash as the separator, or the .Net library taglib-sharp that uses a semicolon.

So far, I've only looked at the freeform tags, the iTunes "standard" tags can also be duplicated by mp3tag, so I'm wondering how those are implemented by mp3tag. I wonder if anyone else has looked at the mutagen python library. I might try, but I've no experience of python.

If all available programs make multiple atoms, then it may be better to do nothing. I don't know for sure, but I have the impression that mp3tag is likely the most popular tagger with working multi value support. Perhaps Paul knows more about this, as he must have to rewrite broken tags.
Find all posts by this user
Quote this message in a reply
21-11-2017, 22:51
Post: #10
RE: (windows) command line m4a tagger?
(21-11-2017 22:44)skeptic Mike Wrote:  If all available programs make multiple atoms, then it may be better to do nothing. I don't know for sure, but I have the impression that mp3tag is likely the most popular tagger with working multi value support. Perhaps Paul knows more about this, as he must have to rewrite broken tags.
I would agree with Mike that other than for completeness there does not seem to be much point in supporting the way AtomicParsley does things since I don't know of any other applications that support this way so even if MinimServer understands it if you want to use another tool like Mp3Tag to edit your tags it will not support it. Unsuprisngly my own taggers (SongKong/Jaikoz) do multiple values the same way that MP3Tag does them.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)