Author Topic: Is there a tag length limit?  (Read 1184 times)

skeptic mike

  • Posts: 8
Is there a tag length limit?
« on: 17 Apr '21 - 17:56 »
I use the lyrics field in music files for descriptive data. e.g synopses and aria lists for opera recordings. This can make the "lyrics" quite long. After adding these in an m4a file no Lyrics were shown in the messages/tags pane, although other metadata was. Checking with mp4file --dump showed that the length of the ©lyr tag was 11914 bytes. Shortening it to 5097 bytes made it readable.

The tagging rules for mp4 files aren't very easy to check, but I'm not aware of any limitation on the length of lyric tags, although most other text tags are limited to 255 characters (or is that bytes?) I'm fairly sure that XMPlay correctly reads UTF-8 text tags, so was wondering if there's a length limitation, and if so is it characters or bytes.

Any information on the rules for displaying tag information would be useful. In an ideal world I'd like to be able to control the sort order, friendly name, and tags to ignore, but I'm grateful that in nearly all cases I can read the information that is available from witin the music player

thanks

Mike

Ian @ un4seen

  • Administrator
  • Posts: 24940
Re: Is there a tag length limit?
« Reply #1 on: 19 Apr '21 - 17:24 »
There is currently a 10000 byte limit (so it will be less than that with multi-byte UTF-8 characters) for each tag, and the display order is as they are in the file. I will look into adding an XMPLAY.INI config option to possibly raise (or lower) the limit.

Ian @ un4seen

  • Administrator
  • Posts: 24940
Re: Is there a tag length limit?
« Reply #2 on: 23 Apr '21 - 17:45 »
Here's an update that adds a "TagLimit" XMPLAY.INI option to set the maximum tag length in bytes:

   www.un4seen.com/stuff/xmplay.exe

For example, a "TagLimit=15000" line in the XMPLAY.INI file will raise the limit to 15000 bytes.

skeptic mike

  • Posts: 8
Re: Is there a tag length limit?
« Reply #3 on: 25 Apr '21 - 13:31 »
Thankyou very much for that. I know that I could reasonably cut files into sections, e.g. an opera into acts, which would reduce the length of the metadata.

However, increasing the length is conveninet and allows me to put off fixing it.

My guess is that there will be very, if any, people who will benefit from this, so it's very kind of you to go to the trouble of fixing it.

thanks again.

Mike

danlock

  • Posts: 2
Re: Is there a tag length limit?
« Reply #4 on: 26 Apr '21 - 06:39 »
For example, a "TagLimit=15000" line in the XMPLAY.INI file will raise the limit to 15000 bytes.

Great! What does that make the maximum tag size? I acknowledge that a tag exceeding a certain size may be impractical or even silly AND that hardware and software (and maybe file format) impose limitations of their own, but is there a limit now, other than hardware and software constraints?

Thank you!

Ian @ un4seen

  • Administrator
  • Posts: 24940
Re: Is there a tag length limit?
« Reply #5 on: 26 Apr '21 - 18:05 »
Do you mean the number of characters in the tag? If so, it will depend on the characters used. XMPlay holds tags in UTF-8 form, which means that if a tag is all English then the limit will be equal to the "TagLimit" setting (1 byte per character), but otherwise it will be less than that because each character may take multiple bytes.