Hi Dave, I haven't reviewed metaflac to see whether its algorithm might incorrectly show a tag twice. It's possible that dBpoweramp appended a tag that already existed. I imagine that if metaflac says there's an occurrence of the tag with no value, and another with a value, then that's probably accurate. Can you show the output of metaflac? That might help verify. You could use other tools, like "hexdump -C path/filename" although it seems that you're on Windows, so you might not have that. Anyway, hexdump would show the raw file data, and then you could search for the 4-character tag to see whether it actually appears once or twice in the file. I'd be tempted to write a simple tool that only shows FLAC chunks as tag and size, but it's probably quicker to review metaflac to see whether it is correct. Brian On Jan 19, 2025, at 11:30 AM, Dave B. wrote:> If I run the metaflac command, "metaflac --show-all-tags path\filename". There is a tag that is listed twice. Only one of the tags has a value. This seems to be the case for all of my flac files. I ripped these with dBpoweramp and this tag was added/defined as a "custom" tag. > > I can run the same command using exiftool, "exiftool --tag-all path\filename" and I only see the single tag, the one that has a value is the one listed. If I look that this same file with MP3Tag "Extended Tags" I also only see it listed once, the one with the value. > > Does anyone know why it might be listed twice using metaflac. I thought metaflac would be the better tool since it is the "official" tool, at least I assume it is. Exiftool will read flac files but will not write to them, so I wonder if I am getting a complete list from it. And MP3Tag has me wondering, because of the name. I dont care ? OR WANT ? mp3 tags. I only want FLAC tags. > > Can anyone shed some light on me. > > Thanks > Dave
> On Jan 19, 2025, at 11:30 AM, Dave B. wrote: > > If I run the metaflac command, "metaflac --show-all-tags path\filename". There is a tag that is listed twice. Only one of the tags has a value.This is the place where you show the metaflac output. Duh.> This seems to be the case for all of my flac files. > I ripped these with dBpoweramp and this tag was added/defined > as a "custom" tag.What flag? How exactly was it "added" and who added it, and why, and why without a value?> > Does anyone know why it might be listed twice using metaflac. > I thought metaflac would be the better tool since it is the "official" tool, > at least I assume it is.You said --show-all-tags and it's showing you all flags. So yes, it is better than the other tools, which don't.> Exiftool will read flac files but will not write to them,Does writing have anything to do with reading the flags?> so I wonder if I am getting a complete list from it.Apparently not.> And MP3Tag has me wondering, because of the name.That's exactly how exiftool got me wondering. Jan
Thank for the replay Brian. My intent is to remove a ?custom? tag that inadvertently ended up with a with the space in it?s name (Song Rating) and replace it with a tag with no space (SongRating). My working file is WorkingMan.flac If I run the metaflac command: metaflac --show-tag="Song Rating" --show-tag=SongRating WorkingMan.flac I see the following: Note there is a duplicate tag (one with a value and one with no value). Case explained to me that a duplicate tag is not necessarily unwanted. [cid:fc74d701-df5b-496d-b73b-ce2db2ce3ba6] From within dBpoweramp I deleted the SONG RATING tag (2nd from the bottom) [cid:424e371a-639e-4044-9fc7-b8fc7db2c69a] Then re-run the same metaflac command metaflac --show-tag="Song Rating" --show-tag=SongRating WorkingMan.flac I now see: [cid:32e3247e-e942-4359-9e8c-0756866324dc] That not only removed the tag that I actually wanted to delete, it also removed the duplicated tag that had no value. ?I must say I am confused. So now the question begs to be asked. If there are 2 tags, or more, with the same name. One with a value and one without, or for that matter they both have values and you want to remove a specific one. How would I do that. If I use the metaflac command: metaflac --remove-tag=SongRating WorkingMan_Copy.flac it removes both. [cid:c8bed3b0-23ca-4576-87c3-2e6c6d96d839] It seems the deep I go the more confused I am getting. Thanks Dave ________________________________ From: brianw <brianw at audiobanshee.com> Sent: Sunday, January 19, 2025 2:44 PM To: Dave B <daveb30 at hotmail.com> Cc: flac at xiph.org <flac at xiph.org> Subject: Re: [Flac] Duplicate Tag Hi Dave, I haven't reviewed metaflac to see whether its algorithm might incorrectly show a tag twice. It's possible that dBpoweramp appended a tag that already existed. I imagine that if metaflac says there's an occurrence of the tag with no value, and another with a value, then that's probably accurate. Can you show the output of metaflac? That might help verify. You could use other tools, like "hexdump -C path/filename" although it seems that you're on Windows, so you might not have that. Anyway, hexdump would show the raw file data, and then you could search for the 4-character tag to see whether it actually appears once or twice in the file. I'd be tempted to write a simple tool that only shows FLAC chunks as tag and size, but it's probably quicker to review metaflac to see whether it is correct. Brian On Jan 19, 2025, at 11:30 AM, Dave B. wrote:> If I run the metaflac command, "metaflac --show-all-tags path\filename". There is a tag that is listed twice. Only one of the tags has a value. This seems to be the case for all of my flac files. I ripped these with dBpoweramp and this tag was added/defined as a "custom" tag. > > I can run the same command using exiftool, "exiftool --tag-all path\filename" and I only see the single tag, the one that has a value is the one listed. If I look that this same file with MP3Tag "Extended Tags" I also only see it listed once, the one with the value. > > Does anyone know why it might be listed twice using metaflac. I thought metaflac would be the better tool since it is the "official" tool, at least I assume it is. Exiftool will read flac files but will not write to them, so I wonder if I am getting a complete list from it. And MP3Tag has me wondering, because of the name. I dont care ? OR WANT ? mp3 tags. I only want FLAC tags. > > Can anyone shed some light on me. > > Thanks > Dave-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/flac/attachments/20250120/b22cc336/attachment-0001.htm> -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 89255 bytes Desc: image.png URL: <http://lists.xiph.org/pipermail/flac/attachments/20250120/b22cc336/attachment-0004.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 14664 bytes Desc: image.png URL: <http://lists.xiph.org/pipermail/flac/attachments/20250120/b22cc336/attachment-0005.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 18178 bytes Desc: image.png URL: <http://lists.xiph.org/pipermail/flac/attachments/20250120/b22cc336/attachment-0006.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 39686 bytes Desc: image.png URL: <http://lists.xiph.org/pipermail/flac/attachments/20250120/b22cc336/attachment-0007.png>
Hi Dave, One problem is that you're using dBpoweramp to remove the tag, and there's no guarantee that dBpoweramp will do the right thing. The way it's coded, removing a tag removes all duplicates. In fact, most specifications do not officially allow duplicate tags, even though they're technically possible in the file. dBpoweramp is not necessarily wrong in removing all tags that match "SONG RATING" - another detail is that almost all system which allow removing data will only match on the tag name, not the tag value, so there's no guarantee that all software will perform the same way with duplicate tags. I see that you also tried the metaflac --remove-tag argument, and it does the same thing. In my experience, this is entirely within reason. Hardly any software requires you do specify that value that you want to remove when removing a tag. You'll not that --remove-tag only provides the tag name, not the tag value, so there would be no way for you to pick which one is deleted. In your specific case, I think that the best approach is to remove all duplicates and then add only the tag that you desire. You could potentially script this, or use the FLAC library to write a custom piece of software that does exactly what you need. If you write your own custom tool, then you can provide arguments for both the tag name and the tag value, and then your tool could only delete one tag and not any other. Brian p.s. It's actually quite challenging to describe a file format so precisely that there is no room for different software developers to interpret it differently. In this example, duplicate tags are probably not mentioned in the official spec (I haven't double-checked that - just guessing) and there's certainly no specification on which tag to remove when there are duplicates. On Jan 20, 2025, at 12:47 PM, Dave B wrote:> Thank for the replay Brian. > > My intent is to remove a ?custom? tag that inadvertently ended up with a with the space in it?s name (Song Rating) and replace it with a tag with no space (SongRating). > My working file is WorkingMan.flac > > If I run the metaflac command: > metaflac --show-tag="Song Rating" --show-tag=SongRating WorkingMan.flac > I see the following: > Note there is a duplicate tag (one with a value and one with no value). Case explained to me that a duplicate tag is not necessarily unwanted. > <image.png> > From within dBpoweramp I deleted the SONG RATING tag (2nd from the bottom) > <image.png> > > Then re-run the same metaflac command > metaflac --show-tag="Song Rating" --show-tag=SongRating WorkingMan.flac > I now see: > <image.png> > > That not only removed the tag that I actually wanted to delete, it also removed the duplicated tag that had no value. > ?I must say I am confused. > So now the question begs to be asked. If there are 2 tags, or more, with the same name. One with a value and one without, or for that matter they both have values and you want to remove a specific one. How would I do that. If I use the metaflac command: > metaflac --remove-tag=SongRating WorkingMan_Copy.flac > it removes both. > <image.png> > > It seems the deep I go the more confused I am getting. > Thanks > Dave