Help - Search - Members - Calendar
Full Version: MP4 tagging
Hydrogenaudio Forums > Lossy Audio Compression > AAC > AAC - General
Pages: 1, 2
menno
Hello,

Lately I've been looking at adding some form of tagging into the MP4 file format. Currently I have all the basic stuff working and the time is now right to define the format, for which your help is needed.
The idea is to post this code back to the mpeg4ip project and create a good definition of the format, hopefully then other companies will start using it.

Basically we can put in about everything we want, size is not really a limit.
The different property types are the following:
8 bit number
16 bit number
24 bit number
32 bit number
64 bit number
32 bit floating point number
text string
byte data

What I need to know from you is what kind of fields are needed. I need to know a 4 byte name for this field in uppercase (for example "TITL"), a generic name of the field (for example "title") and of course the data type (as mentioned above).

Menno
menno
Let me add some more info.
Tags can be added/assigned to seperate tracks (so could be for video, audio, images) as well as to a whole file.

Menno
Sachankara
This is all I need:

Album
Album artist
Catalogue number
Comments (\n as line break could be useful so people who like to add additional track/album information can do just that in this tag)
Encoded by
Encodec with (encoder/settings)
Genre
Produced by/publisher
Release date (yyyy-mm-dd) [no wierd American dates]
Track artist
Track number
Track title

Of course, everything has to be unicode/UTF-8 compatible... B)

The question though is what names those tags should have...(?) I'll have to think about it unless someone can come up with something smart that doesn't sound to wierd... tongue.gif

Edit: Added "Produced by/publisher"... It could be useful if you already add catalogue numbers...
Peter
4-byte codes for all fields ? what kind of shit is this ? you must be kidding... some people i know will start using APEv2 tags with mp4, and some *cough* other people will make player that reads them. you are asking for your format to be bastardized.
kritip
zZzZzZz,

i hardly think the 4 byte code will "basterdize" the tagging format, this will not reallly be apparent to the user. The can have a tag title as long as they like, and this may contain all of the information they like, that's what i guess anyway, the 4 byte code will just be internal.

Please don't put me down if i am wrong though, i know u develop and code plugin's etc. and so probably have a lot more of an idea than myself. wink.gif


On the other hand a vilid point was raised. With Monkeys audio and MPC using APE or APEv2, and also FLAC and Ogg Vorbis using vorbis comments, why not adopt one of these two sytems? is it due to restrictions within the mp4 spec?

Kristian
hans-jürgen
QUOTE(menno @ Dec 12 2002 - 08:53 PM)
Lately I've been looking at adding some form of tagging into the MP4 file format. Currently I have all the basic stuff working and the time is now right to define the format, for which your help is needed.

Great news!

QUOTE
The idea is to post this code back to the mpeg4ip project and create a good definition of the format, hopefully then other companies will start using it.


As far as I know, Musepack uses the tagging method from Monkey's Audio for some good reasons, but I can't recall them right now... wink.gif

QUOTE
What I need to know from you is what kind of fields are needed. I need to know a 4 byte name for this field in uppercase (for example "TITL"), a generic name of the field (for example "title") and of course the data type (as mentioned above).


I think I will have a look at the MPEG-7 standard before I would answer to this in more details. Isn't this supposed to be the standard that deals with all file info/content questions and so on? And hasn't MPEG-4 something to offer on this topic already? Hmm...
menno
This tagging format will not break any mp4 file reader compatibility, the mp4 file format is highly extensible using so called atoms.

Each field in the tag will be an atom, which holds a property, which holds the data. Each atom is desribed by a 4 byte string in the file. Open up a MP4 file in a text editor and you'll find those 4 byte strings easily.

Any mp4 file parser that comes along an atom that it does not recognise will simply skip it.

Menno
menno
So atom name (4 bytes) is purely internal, long name is the name of the property, which will also be used externally.

kritip: I could simply copy one of the known tags to one atom, but I think it's better to do it in a clean way as intended in the mp4 format, and hope for other companies to adopt it.

Menno
rehgf
Déjà Vu... last time we discussed this I suggested conformance with the QT format, since the mp4 container actually is a modification of the QT container. Of course you can choose not to, if the added value of QT conformance can be considered non-existent.

Page 317:
http://mediaxw.sourceforge.net/files/doc/Q...le%20Format.pdf
Peter
4-byte field codes dont "bastardize" the format, but they mean copying id3v2 stupidity and preventing people from using any fields they want. you are simply creating inferior tagging standard, and therefore asking people to rape your mp4 format with other (superior) tag types (eg. APEv2). the idea of storing "field ID atoms" instead of full field names is simply dumb, and is limiting functionality of your "tagging standard".
menno
Yes, I thought about the same atoms as QT's old format uses (QT6 doesn't do this, it doesn't seem to support any user data at all even):
http://developer.apple.com/techpubs/quickt...tml#pgfId-11035

But that doesn't really seem sufficient to me. Or do all of you disagree and find this more than enough?

Otherwise if the ape tag version 2 is good for all of you, I could just copy the fields of that.

Menno
Peter
geez, am i talking to a wall ? DON'T STORE FIELD IDS, and DON'T HARDCODE FIELD TYPES. just store FULL FIELD NAMES and let people enter whatever fields they want, like with Vorbis or APEv2.
menno
Hmm, ok, that's a good idea. I'll have to check how to do that and if it's possible at all in the current mpeg4ip library.

Menno
menno
Ok, just checked and I think all atoms or properties must be known upfront to be able to find them back in the file.

Menno
rehgf
If QT have tossed their old specs, and there still is no mp4 standardised tag, then you are indeed free to do it your way. Most of the code can probably be copied from Vorbis-comment or APEv2:
http://www.xiph.org/ogg/vorbis/doc/v-comment.html
http://141.35.2.84/~pfk/mpp/sv8/apetag.html
ErikS
What about this then?

tag count atom
id: 'tags'
type: int32
Contains the number of tagitems. Maybe redundant information.


tag item atom
id: 'tagi'
type: utf-8 string
Holds one tag item on the form "key=value". One atom per key-value pair.

Just a suggestion...
Peter
QUOTE(ErikS @ Dec 13 2002 - 12:17 AM)
What about this then?

tag count atom
id: 'tags'
type: int32
Contains the number of tagitems. Maybe redundant information.


tag item atom
id: 'tagi'
type: utf-8 string
Holds one tag item on the form "key=value". One atom per key-value pair.

Just a suggestion...

my thoughts exactly.
also, don't allow different text encoding types (like id3v2 does), force UTF-8; that will simplify tag reading/writing software and prevent potential software conflicts (eg. there are lots of broken id3v2 readers out there just because of that).
menno
Thanks for your suggestions. I'll have to check if that can work.

Unicode and utf8 writing is build into the MP4 file format, so that won't be a problem. Problem is that there are already a lot of buggy mp4 file readers/writers smile.gif

Menno
ciber-fred
ok, good news about mp4 file format.
if we add 'atom' like menno said. it's just adding informations that could not be handle across streaming readers.

so is it really necessary ? it's just info that stream server could handle. i think it's not really necessary to add these 'field'
but can we add this ? mp4 is it finished or this will be a newer format ?
grbmusic
Good News
The APE v.2 it just good for me, I love APE tags biggrin.gif
h
If APE v2 tags are going to be used, why not just create a string atom with the id 'ape2', containing a "field=value" string. Hijacking 'tags' seems a bit mean.

And yes, UTF-8 rocks.

-h
menno
I think I'll have some initial tagging support in a few days.
Does anyone need properties other than strings? or should strings be enough? It would keep it a lot simpler.
Thanks,

Menno
ChristianHJW
QUOTE(rehgf @ Dec 12 2002 - 10:25 PM)
Déjà Vu... last time we discussed this I suggested conformance with the QT format.....
Page 317:
http://mediaxw.sourceforge.net/files/doc/Q...le%20Format.pdf

Hehehe .... Ingo Ralf Blums MediaXW project .... i didnt think anybody would remember it ... a pitty it had come to halt ..... sory for being OT ..
ciber-fred
hum.. is it possible to have source code and an small explanation on you API.
it's just to add this support to the xmms plugin.
menno
This code will be added to the mpeg4ip project.

Menno
sam
As I understand, I dot think ReplayGain has made it to AAC/MP4 yet, but could the tags be put in place for it? It would seem a good idea to do it now for the future smile.gif
grbmusic
One question:
When are finished the id tags for mp4 - aac???
menno
QUOTE(grbmusic @ Dec 26 2002 - 05:09 AM)
When are finished the id tags for mp4 - aac???

They are finished. I just have one bug left for which I need some help from the Cisco developers (and they deserve some christmas holiday I guess smile.gif ).
After that I'll have to write some documentation, so that others could implement it in the same way as well (and I mean Apple laugh.gif ).

Menno
Sachankara
I hope you'll make a command line tagger so various home made batch shells and similar can be written for it... smile.gif
menno
QUOTE(Sachankara @ Jan 3 2003 - 05:25 PM)
I hope you'll make a command line tagger so various home made batch shells and similar can be written for it... smile.gif

Working on that smile.gif

Menno
GodHead
So I've ignored this thread long enough. Any progress on tagging support? Do we have to wait for new Nero version to get the tagging support?
There gonna be an easy way to go back and tag our existing MP4's by maybe using a smart filename parser?
JEN
You can tag and replaygain mp4 files with foobar2000. Although Its not 100% perfect yet!
hans-jürgen
QUOTE(GodHead @ Feb 21 2003 - 08:57 AM)
So I've ignored this thread long enough. Any progress on tagging support? Do we have to wait for new Nero version to get the tagging support?
There gonna be an easy way to go back and tag our existing MP4's by maybe using a smart filename parser?

Like Jenny wrote, with foobar2000 and its foo_mp4.dll you're able to define your own tags with the "file info" window. You can use the dropdown list for the standard tag fields (ARTIST, TITLE etc.) or create new ones, since there are no predefined names yet.

You can also use the mass-tagging option of foobar to do this for all MP4 files that you previously selected. Right-click on a file name, choose "edit tags", then click on the "add" button and select the appropriate action(s) from the dropdown list, e.g. "guess values from file name". But be careful, because no one seems to have tested this yet with MP4 files, so make a backup of the untagged file and try it with only one file first.
Sachankara
QUOTE(hans-jürgen @ Feb 21 2003 - 01:13 PM)
QUOTE(GodHead @ Feb 21 2003 - 08:57 AM)
So I've ignored this thread long enough. Any progress on tagging support? Do we have to wait for new Nero version to get the tagging support?
There gonna be an easy way to go back and tag our existing MP4's by maybe using a smart filename parser?

Like Jenny wrote, with foobar2000 and its foo_mp4.dll you're able to define your own tags with the "file info" window. You can use the dropdown list for the standard tag fields (ARTIST, TITLE etc.) or create new ones, since there are no predefined names yet.

You can also use the mass-tagging option of foobar to do this for all MP4 files that you previously selected. Right-click on a file name, choose "edit tags", then click on the "add" button and select the appropriate action(s) from the dropdown list, e.g. "guess values from file name". But be careful, because no one seems to have tested this yet with MP4 files, so make a backup of the untagged file and try it with only one file first.

No one has tested? Ehh, I have and it works just fine. tongue.gif But still, it's too slow and the annoyance factor is huge when you're tagging more than ~1-3 albums. We do need an external command line based tagger. Preferably UTF-8 compatible so strings are more easily sent between the programs (and of course the tag program will convert UTF-8 into Unicode). At least if you ask me... happy.gif
JEN
I have been tagging mp4 files for a few days now. Can anyone please tell me the limits of aac/mp4 tagging as some of the files which I tagged can no longer be opened in foobar due to errors. I can not even remove the tags from these files as the same error keeps getting displayed and then crashed foobar!

So, what are the limits/restrictions of mp4 tagging (mpeg4 standard restrictions?) e.g. are there certain characters you should not use, is there a limit to the tag length etc etc.

Help please!
hans-jürgen
QUOTE(Sachankara @ Feb 21 2003 - 01:20 PM)
QUOTE(hans-jürgen @ Feb 21 2003 - 01:13 PM)
But be careful, because no one seems to have tested this yet with MP4 files, so make a backup of the untagged file and try it with only one file first.

No one has tested? Ehh, I have and it works just fine. tongue.gif

Good to know... wink.gif With how many files until now, and no playback problems after tagging them? Which AAC codec with what settings do you normally use?

Did you also try the Replay Gain support that Jenny mentioned perhaps?

QUOTE
But still, it's too slow and the annoyance factor is huge when you're tagging more than ~1-3 albums. We do need an external command line based tagger.


I think Menno wrote a while ago that he plans something like this, because he wants to substitute the older ID3v2 tagger from Audiocoding.com with it.
ak
QUOTE(hans-jurgen @ Feb 21 2003 - 03:05 PM)
Did you also try the Replay Gain support that Jenny mentioned perhaps?

I did, it worked fine.
Tagged / replaygained couple of old albums (aacenc 2.15) back in .43 days. Haven't check them recently, but I think I'm going to do this soon...

QUOTE(jenny @ Feb 21 2003 - 03:00 PM)
Can anyone please tell me the limits of aac/mp4 tagging as some of the files which I tagged can no longer be opened in foobar due to errors.

How about in_mp4 or aacdecdrop, do they crash as well on these files?
JEN
QUOTE(ak @ Feb 21 2003 - 02:48 PM)
How about in_mp4 or aacdecdrop, do they crash as well on these files?

I dunno as I have never tried that!

Anyway,

My tagging experience with mp4 and foobar

Codec - aacenc.exe (PsyTEL® MPEG-4 AAC Encoder V2.15 build Mar 2 2002)
quality settings -normal, -archive
foobar v0.5

# of files tested 78
# of files @ -normal 26
# of files @ -archive 52

The following report is for the 26 tracks encoded with "-normal" using foobars masstagger.

--------------------------------------------------------------------------
No Tagging No ReplayGain report:

No problems so far smile.gif

--------------------------------------------------------------------------
ReplayGain report:
use scan selection as album

No problems so far smile.gif

--------------------------------------------------------------------------
Tagging report:

error "The instruction at "0x77fcb317" referenced memory at "0x0044005c". The memory could not be "written""

Tags used:

Artist: Jo Jo Man
Album: Jo Jo Mania
Title: Covert Opts
Year: 2003
Genre: Speech
Comment: www.jojo.com (Ripped with EAC, Encoded with aacenc.exe (PsyTEL® MPEG-4 AAC Encoder V2.15 build Mar 2 2002), quality settings -normal)

Before I did this, the comment tag was "www.jojo.com", this works perfectly

This has lead me to believe that mp4 tags are either limited to a certain maximum tag character length, or certain characters can not be used!

--------------------------------------------------------------------------
ReplayGain and Tagging
ReplayGain = use scan selection as album

Tagging = :

Artist: Jo Jo Man
Album: Jo Jo Mania
Title: Covert Opts
Year: 2003
Genre: Speech
Comment: www.jojo.com

No errors occured smile.gif

--------------------------------------------------------------------------
ReplayGain and Tagging
To test if same error occurs with long comment tag

Comment tag changed to: Comment: www.jojo.com (Ripped with EAC, Encoded with aacenc.exe (PsyTEL® MPEG-4 AAC Encoder V2.15 build Mar 2 2002), quality settings -normal)

The same error occurs as before

error "The instruction at "0x77fcb317" referenced memory at "0x0044005c". The memory could not be "written""

--------------------------------------------------------------------------

When this error occurs, the tags are not removable, which renders the mp4 files unusable!

This is why I think there has to be some sort of restriction with the mp4 tagging or certain character restrictions?

Please advise
hans-jürgen
QUOTE(jenny @ Feb 21 2003 - 03:17 PM)
ReplayGain report:
use scan selection as album

No problems so far smile.gif

Hi jenny, thanks for your comprehensive report. I think Menno can draw some valuable informations from it, even if my next guess will be wrong. wink.gif OK, so ReplayGain really seems to work with foobar and MP4 files, great, so I will mention this in the Audiocoding Wiki somewhere, if nobody has made a different experience.

QUOTE
Comment: www.jojo.com (Ripped with EAC, Encoded with aacenc.exe (PsyTEL® MPEG-4 AAC Encoder V2.15 build Mar 2 2002), quality settings -normal)

Before I did this, the comment tag was "www.jojo.com", this works perfectly


This makes me think that the "Registered Trademark" sign behind "PsyTEL" is guilty for that, because it will probably be on another position in the character set that you use with your OS (which one is it, Win98 maybe?) than in UTF-8/Unicode which is the character set that foobar2000 uses (this was the reason for not releasing a Win9x version first).

So try one more time with the sign deleted, and maybe "everything's gonna be alright" then... wink.gif
GodHead
Yeah I tried tagging some MP4's with foobar right after I made that post. Guess I should have tried before posting, but that would be letting menno off the hook for not following up on his thread biggrin.gif

The tagging works great, but I'm keeping it simple for right now: Artist, Album, TrackNumber, and Title.

I'm sure Ivan has plans for tagging support in Nero. Maybe I missed it, but I haven't seen him mention if this will be in the next release or not.
Ivan Dimkovic
QUOTE
I'm sure Ivan has plans for tagging support in Nero. Maybe I missed it, but I haven't seen him mention if this will be in the next release or not.


I guess for the next update (probably coming next week), there won't be tagging support - but Menno will also integrate tagging into Nero plug-in and I suppose it will be ready for the update after the next one smile.gif
hans-jürgen
QUOTE(GodHead @ Feb 22 2003 - 07:59 AM)
The tagging works great, but I'm keeping it simple for right now: Artist, Album, TrackNumber, and Title.

Could you do me a favor and voluntarily bust a MP4 file with some strange characters in a tag, like Jenny's Registered Trademark or german "Umlaute" or something similar? I would like to be sure that this is the reason for her problems. Which OS are you using?

QUOTE
I'm sure Ivan has plans for tagging support in Nero. Maybe I missed it, but I haven't seen him mention if this will be in the next release or not.


He'll probably hand this over to Menno, because both are working for Ahead Software now... wink.gif Do the other formats (MP3 etc.) have tagging support in Nero?
GodHead
QUOTE
Could you do me a favor and voluntarily bust a MP4 file with some strange characters in a tag, like Jenny's Registered Trademark or german "Umlaute" or something similar? I would like to be sure that this is the reason for her problems. Which OS are you using?


Sure, I'll do that in just a second, but I'm not sure what to expect since I'm running XP.
Ok, done.....UTF-8 codes seem to work fine in foobar2000 .51 and MP4 tags on a Windows XP machine.
Let's see if I can attach an image, not sure I can on HA (nope, had to host on yahoo photos).

Direct Photo Link

If that doesn't work, go here -> Photo List

QUOTE
He'll probably hand this over to Menno, because both are working for Ahead Software now...  wink.gif  Do the other formats (MP3 etc.) have tagging support in Nero?


Not that I can see, but since it's all plugins, should be able to add tagging support regardless of other formats.
Sachankara
QUOTE(hans-jürgen @ Feb 22 2003 - 09:52 AM)
Could you do me a favor and voluntarily bust a MP4 file with some strange characters in a tag, like Jenny's Registered Trademark or german "Umlaute" or something similar? I would like to be sure that this is the reason for her problems. Which OS are you using?

You want "strange" characters? Here you go:

user posted image

smile.gif
ak
Well, I was going to post one myself. But it doesn't even come near... smile.gif
In fact this comment line is too long. Upon some playing around, looks like anything less than 100 chars is ok, more than 128 is not, inbeetwen questionable.
hans-jürgen
QUOTE(ak @ Feb 23 2003 - 12:16 PM)
Well, I was going to post one myself. But it doesn't even come near... smile.gif
In fact this comment line is too long. Upon some playing around, looks like anything less than 100 chars is ok, more than 128 is not, inbeetwen questionable.

Ahaaa.... B) OK, thanks to you and Godhead and Sachankara, hopefully Menno will have a look at this thread again. wink.gif
Volcano
Silly question...

What type of tag will foobar2000 use for MP4 files? Does it already use the new tagging system? (Sorry, I have no MP4 files to try it with ATM... just interested smile.gif)
Sachankara
QUOTE(Volcano @ Feb 23 2003 - 01:44 PM)
Silly question...

What type of tag will foobar2000 use for MP4 files? Does it already use the new tagging system? (Sorry, I have no MP4 files to try it with ATM... just interested smile.gif)

It uses a "Vorbis comments" similar MP4 system. Normal MP4 tags are more like ID3v2, but Menno have made the tagging system so that it uses general strings to store the tags in unicode instead. So in essence it's more like Vorbis comments which allows any types of tags to be used instead of pre-determined tags. (Or atoms as they are called in MP4)
Volcano
So - just to be certain - you are speaking of the tagging system Menno announced in this very thread, right?
Sachankara
QUOTE(Volcano @ Feb 24 2003 - 09:09 PM)
So - just to be certain - you are speaking of the tagging system Menno announced in this very thread, right?

Yes, he finally made it so it's similar to Vorbis comments/APE2, which I'm personally happy about. (Especially considering my strange suggestions from the start... tongue.gif)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.