Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: AAC tagging (Read 18019 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

AAC tagging

I've noticed that the AAC/MP4 tagging function in fb2k doesn't seem to respect the field-types that already exist on music files.

In particular, "COMPILATION" and "COVER" are fields used by itunes, and they are not text fields.  As far as I can tell, text fields are of type 0x01, while binary fields are of type 0x15.  I may have this slightly wrong--I am going by a brief examination of the files earlier this week, but I know it is true of at least CPIL (COMPILATION) field.

Is it possible to fix the tagging support (including Masstagger) so that binary fields could be added, and if a field is already binary, it is left so.

I am not sure if iTunes usage of these fields, among others, is de jure standard, but I think we have to accept that iTunes is the de facto standard.  With the iPod Photo out this week its now increasingly important that image attachment work similarly.

+Reardon

AAC tagging

Reply #1
Interesting. I use iTunes to rip my CDs as well. I never use the album cover feature, but my work-around for the compilation thing was always to mark something as a compilation in iTunes before playing back in foobar. I actually use this instead of using a VARIOUS ARTISTS field. I just use an $if string to identify if the compilation field has data and it's always worked. Not ideal, though.

I don't know enough about code and such to say how difficult it would be to implement the difference in those fields. Also, Peter may not want to muck about with it. If not, maybe a third-party would be interested, or perhaps the Special Info Box plugin could be modified to read these.

AAC tagging

Reply #2
iTunes makes use of a number of different tag types. I have so far identified the following:

0x00 Integers
0x01 Text
0x0d Picture
0x15 Bytes

Their interpretation depends on the tag.

Below is an overview over the most commenly used tags along with their names in different tagging systems:

Code: [Select]
FLAC       |FORMAT             |MP3          |AAC     |iTunes      |TGF                      |Used by

Required tags:
ARTIST     |<string>           |TPE1         |ART     |Artist      |Artist                   |EFIO|1
ALBUM      |<string>           |TALB         |alb     |Album       |Album                    |EFIO|
TITLE      |<string>           |TIT2         |nam     |Name        |Title                    |EFI |

Important tags:
TRACKNUMBER|<integer>          |TRCK         |trkn    |Track Number|Track                    |EFIO|
TRACKNUMBER|<integer>/<integer>|TRCK         |trkn    |Total Count |Track                    |EFIO|
DISCNUMBER |<integer>          |TPOS         |disk    |Disk Number |DISCNUMBER               |IO  |2
DISCNUMBER |<integer>/<integer>|TPOS         |disk    |Disk Count  |DISCNUMBER               |IO  |
COMPOSER   |<string>           |TCOM         |wrt     |Composer    |Composer                 |IO  |
GENRE      |<string>           |TCON         |gen/gnre|Genre       |Genre                    |EFIO|
DATE       |<string>           |TYER         |day     |Year        |Year                     |EFIO|
ENCODER    |<string>           |TENC         |too     |Tool        |Encoded by               |EI  |
           |<picture>          |APIC         |covr    |            |Picture                  |IO  |3
GROUPING   |<string>           |TIT1         |grp     |Grouping    |Content Group Description|IO  |
COMPILATION|<integer>          |TCMP         |cpil    |Compilation |                         |IO  |

Additional tags:
COMMENT    |<text>             |COMM         |cmt     |Comments    |Comment                  |IO  |
LYRICS     |<text>             |USLT         |lyr     |            |Lyrics                   |    |4
RATING     |<integer>          |TXXX-RATING  |rtng    |Rating      |Rating                   |O   |5
CRC        |<text>             |             |        |            |                         |E   |

Unused tags:
PLAYCOUNT  |<integer>          |PCNT         |        |Play Count  |                         |O   |6
PLAYDATE   |<date>             |TXXX-PLAYDATE|        |Play Date   |                         |O   |6
TEMPO      |<integer>          |TBPM         |tmpo    |Tempo       |BPM                      |OI   |
ISRC       |<string>           |TSRC         |        |            |                         |    |4,6
PERFORMER  |<string>           |TPE3         |        |            |                         |    |4
USER       |<string>           |USER         |apid    |            |                         |    |

Used by: E = EAC, F = freedb, I = iTunes add file, O = can be set through OLE

Notes:
1.    iTunes use TPE2 before TPE1. TGF update only TPE1 and leaves TPE2 unchanged.
2.    TGF: DISCNUMBER is a user|defined tag.
3.    When several pictures are stored they have different tags. MP3: APIC, APIC01, APIC02 etc.
4.    Not visible in iTunes.
5.    rtng tag only in m4p.
6.    Not visible in TGF.


The above list is not complete and the interpretation of iTunes aac tags will vary for tool and genre between m4p and m4a.

You can read the tags of an m4a / m4p file using metaaac:

metaaac

AAC tagging

Reply #3
Quote
iTunes makes use of a number of different tag types. I have so far identified the following:

0x00 Integers
0x01 Text
0x0d Picture
0x15 Bytes


Thanks. Any chance you could modify to include the field type, and to deduct the length of the 'name' etc prefixes from the length of the fields?

Also, you should probably add COVER (the itunes name), with an AAC atom name of "covr". Also note that when tagging only in ID3v2, iTunes seems to use the fieldname "WRITER" instead of "COMPOSER", though COMPOSER is used in the iTunes ui.

"cpil" (COMPILATON) is not an integer as you suggest, but rather bytes (0x15).

"covr" (COVER) is, in fact, 0x0D, so its a picture not simply bytes, as you correctly suggested.

Any idea what it means when the AAC field signifier starts with the byte 0xA9? Fields like "too" (tool) seem to have this byte. Does it just mean a builtin field like cpil or covr?

+Reardon

AAC tagging

Reply #4
iTunes does make use of the BPM tags, BTW. It'll read and write TBPM from MP3/ID3v2 tags, and will also read/write it from AAC/M4A files (whatever the tag name happens to be).

AAC tagging

Reply #5
Quote
Also note that when tagging only in ID3v2, iTunes seems to use the fieldname "WRITER" instead of "COMPOSER", though COMPOSER is used in the iTunes ui.
[a href="index.php?act=findpost&pid=251701"][{POST_SNAPBACK}][/a]

When I rip my classical stuff using iTunes' AAC, the field that iTunes calls Composer always shows as WRITER in foobar2000, but that wouldn't be an ID3 tag, would it?

AAC tagging

Reply #6
Here is the tags treated by metaaac:

Code: [Select]
%atom = (
 # container atoms
 ALB  => { CONTAINER => 1, TAG => ALBUM, FORMAT => TEXT },
 ART  => { CONTAINER => 1, TAG => ARTIST, FORMAT => TEXT },
 CLIP => { CONTAINER => 1},
 CMT  => { CONTAINER => 1, TAG => COMMENT, FORMAT => TEXT },
 COVR => { CONTAINER => 1, },
 CPIL => { CONTAINER => 1, TAG => COMPILATION, FORMAT => INTEGER },
 DAY  => { CONTAINER => 1, TAG => DATE, FORMAT => YEAR },
 DINF => { CONTAINER => 1},
 DISK => { CONTAINER => 1, TAG => DISCNUMBER, FORMAT => INTEGERS },
 DRMS => { CONTAINER => 1},
 EDTS => { CONTAINER => 1},
 GRP  => { CONTAINER => 1, TAG => GROUPING, FORMAT => TEXT },
 ILST => { CONTAINER => 1},
 LYR  => { CONTAINER => 1, TAG => LYRICS, FORMAT => TEXT },
 MATT => { CONTAINER => 1},
 MDIA => { CONTAINER => 1},
 MINF => { CONTAINER => 1},
 MOOV => { CONTAINER => 1},
 NAM  => { CONTAINER => 1, TAG => TITLE, FORMAT => TEXT },
 RTNG => { CONTAINER => 1, TAG => RATING, FORMAT => INTEGER },
 SCHI => { CONTAINER => 1},
 SINF => { CONTAINER => 1},
 STBL => { CONTAINER => 1},
 TMPO => { CONTAINER => 1, TAG => TEMPO, FORMAT => INTEGER },
 TOO  => { CONTAINER => 1, TAG => ENCODER, FORMAT => TEXT },
 TRAK => { CONTAINER => 1, SKIP => 1},
 TRKN => { CONTAINER => 1, TAG => TRACKNUMBER, FORMAT => INTEGERS },
 UDTA => { CONTAINER => 1},
 WRT  => { CONTAINER => 1, TAG => COMPOSER, FORMAT => TEXT },

 APID => { CONTAINER => 1, TAG => USER, FORMAT => TEXT},
 PLID => { CONTAINER => 1},
 AART => { CONTAINER => 1, TAG => ARTIST, FORMAT => TEXT},
 GEID => { CONTAINER => 1},
 AKID => { CONTAINER => 1},
 ATID => { CONTAINER => 1},
 CPRT => { CONTAINER => 1, TAG => COPYRIGHT, FORMAT => TEXT },
 "----" => { CONTAINER => 1, TAG => ITUNES, FORMAT => ITUNES},
 GEN  => { CONTAINER => 1, TAG => GENRE, FORMAT => GENRE },
 GNRE => { CONTAINER => 1, TAG => GENRE, FORMAT => GENRE },


As you can see a number of the tags are not currently mapped into a tag and therefore only appears when using the --verbose option of metaaac.