Custom Tags in M4A

Locked
mneimeyer
User
Posts: 2
Joined: Tue Jul 03, 2012 6:22 pm
Are you a spambot?: no

Custom Tags in M4A

Post by mneimeyer » Tue Jul 03, 2012 6:40 pm

I'm using Foobar2000 (if that matters) and I have been tagging my music for Source (ripped from CD, downloaded from WEB, etc) and for Play Count (using foo_playback_custom). Using getid3 I can read those tags in my FLAC and MP3 files just fine. However in an M4A file that I originally ripped using iTunes (and which will not rip cleanly again for some reason) I cannot read those tags. In the quicktime array, I can trace down through the various parts of the subatom array until I get to this...

Code: Select all

 [4] => Array
     (
         [hierarchy] => ----
         [name] => MEDIATYPE
         [size] => 75
         [offset] => 92348
         [mean] => com.apple.iTunes
         [version] => 0
         [flags_raw] => 1
         [data] => CD
     )

 [5] => Array
     (
         [hierarchy] => ----
         [name] => PLAY_COUNTER
         [size] => 77
         [offset] => 92423
         [mean] => com.apple.iTunes
         [version] => 0
         [flags_raw] => 1
         [data] => 1
     )
It looks like getid3 is just ignoring those (which since they're custom I can understand) but is there any easy way to get those out. I don't need to write to those tags if that makes it easier. I'm also not afraid of PHP I just can't seem to find the place to add those to the list of known tags (or whatever it is that I need to do).

Thanks in advance!

Matt

P.S. I posted a more complete array dump at http://pastebin.com/U3H6MjTS

James Heinrich
getID3() v1 developer
Posts: 1475
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: Custom Tags in M4A

Post by James Heinrich » Tue Jul 03, 2012 11:11 pm

A sample file would be useful. Please email file to info@getid3.org if <10MB, or email a link if file is larger than 10MB.

James Heinrich
getID3() v1 developer
Posts: 1475
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: Custom Tags in M4A

Post by James Heinrich » Wed Jul 04, 2012 2:14 am

Thanks for the sample file.

If I understand you correctly, you'd like to see those values appear in (for example) [tags][quicktime][play_counter] and/or [comments][play_counter] rather than having to walk the returned data and find them in ugly locations like [quicktime][moov][subatoms][2][subatoms][0][subatoms][1][subatoms][4][data], correct?

If so, just add a couple lines to CopyToAppropriateCommentsSection() -- around line 2090 in module.audio-video.quicktime.php (anywhere in the block of similar definitions is fine). For v1.9.4 I'll include these two entries, assuming they're semi-standard entries (as in: created by Foobar2000 and not made up by you -- please confirm?)

Code: Select all

			$handyatomtranslatorarray['PLAY_COUNTER']                = 'play_counter';
			$handyatomtranslatorarray['MEDIATYPE']                   = 'mediatype';

mneimeyer
User
Posts: 2
Joined: Tue Jul 03, 2012 6:22 pm
Are you a spambot?: no

Re: Custom Tags in M4A

Post by mneimeyer » Wed Jul 04, 2012 6:28 am

Actually... It's a little of both... They aren't standard Foobar tags... but I also didn't pick them out of the air.

I used the chart at http://age.hobba.nl/audio/tag_frame_reference.html to determine what was closest to my needs even if it wasn't officially supported by all the tagging standards. That said, in looking at the chart now I think I mixed up some of the columns... <sigh> I meant to use the values from the ID3 column and it looks like play_counter should be playcounter and on top of that I don't know that Foobar2000 would know to translate that to the PCNT frame and wouldn't just stick it in a PRIV frame anyways. (assuming that's the right lingo)

Thanks for taking the time to let me know how to work those in though!

Matt

James Heinrich
getID3() v1 developer
Posts: 1475
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: Custom Tags in M4A

Post by James Heinrich » Wed Jul 04, 2012 9:25 pm

I've taken a more generic approach now:

In function CopyToAppropriateCommentsSection(), around line 2090 of module.audio-video.quicktime.php, I've commented out all the "boxname" $handyatomtranslatorarray entries and changed the code below it to this:

Code: Select all

		$comment_key = '';
		if ($boxname && ($boxname != $keyname)) {
			$comment_key = (isset($handyatomtranslatorarray[$boxname]) ? $handyatomtranslatorarray[$boxname] : $boxname);
		} elseif (isset($handyatomtranslatorarray[$keyname])) {
			$comment_key = $handyatomtranslatorarray[$keyname];
		}
All the previously-defined boxname were returning themselves anyway, so now any custom boxname will appear in the comments section as itself, exactly as my previous suggestion (except in uppercase) but will work for known and unknown custom box names.

Locked