PDA

View Full Version : Removing Multiple FLAC Tags?



Wigster
2009-10-16, 20:07
Hi,

It seems that SBS 7.4 is now aware when a FLAC file contains multiple tags and displays them as Title/Title/Title/Title.

In this way I have discovered I have a small number of files which have these multiple tags. I have tried removing them with MP3Tag 2.44's Remove Tag function, but it only removes one of them, which then gets readded if I paste tag information.

Does anyone have any idea how I can fix my FLAC files?

Thanks,

JJZolx
2009-10-16, 20:34
Do you have too many files like this that you can't edit them by hand?

In recent versions of Mp3tag if you have multiple fields with the same name then they should appear in the left-hand panel (the 'Tag Panel') with double backslashes between the different field values. For example

Title:
Title1\\Title2\\Title3

Just remove whichever you like.

Wigster
2009-10-17, 09:26
Indeed mp3tag does seem to show all the tags as (Title\\Title\\Title\\Title\\Title), but editing it and saving seems to do nothing. They come back when I click on the file again.

I don't have that many, but probably 100 of these bad FLAC files. I would much rather figure out some automatic way of doing it if it is at all possible.

wowo
2009-10-17, 11:00
Do you use sometimes MediaMonkey ?
If you do some changes within MediaMonkey, MediaMonkey could write multiple tags (it is a bug).
To prevend this: options > library > Tags & Playlists:
unmark "Update tags when editing properties"

Wigster
2009-10-17, 13:44
No I never have. My worry is that it could the the Tag Extender for WMP that is screwing things up.

audiomuze
2009-10-17, 14:39
Indeed mp3tag does seem to show all the tags as (Title\\Title\\Title\\Title\\Title), but editing it and saving seems to do nothing. They come back when I click on the file again.

I don't have that many, but probably 100 of these bad FLAC files. I would much rather figure out some automatic way of doing it if it is at all possible.

mp3tag has in-built functions including a regular expression engine you can use to manipulate strings within any tag.

JJZolx
2009-10-17, 15:21
Indeed mp3tag does seem to show all the tags as (Title\\Title\\Title\\Title\\Title), but editing it and saving seems to do nothing. They come back when I click on the file again.

I don't have that many, but probably 100 of these bad FLAC files. I would much rather figure out some automatic way of doing it if it is at all possible.

Either

a) You're doing something wrong.

or

b) You've encountered a bug.


When you edit anything in Mp3tag's Tag Panel you need to do an explicit save. Use Ctrl-S or click the 'floppy disk' icon to save changes.

In the file list (on the right) it's not necessary to save... whenever you move to a different track the changes are automatically saved.

You can edit the Title in the file list (I don't believe it shows multiple tags by default) by changing the Title column definition. Right-click anywhere in the column headers and select 'Change columns...'. Then find Title and change the Value field from %title% to $meta_sep(title,\\).

You can also use the extended tags dialog. Highlight the file or files to be edited and click the 'paper & pencil' icon or use Ctrl-T.

If it's a bug, make sure you're using the latest Mp3tag. Current latest is a development release - 2.44d. Just like with Squeezebox Server, you'll find a lot of bug fixes in the beta versions between official releases.

http://forums.mp3tag.de/index.php?showtopic=57

Wigster
2009-10-17, 16:51
No, I am definitely saving the tag edits, they just do not get saved. I have retried with version 2.44d.

I have also tried using Tag and Rename 3.5.3: there also you see all the multiple tags, you edit them and save. However, when you reload the file, the extra tags are still there.

There must be something very wrong with these files, but I've no idea what.

I'll report this as a potential bug to Florian.

andyg
2009-10-17, 16:59
As a last resort, you could use metaflac to manually tweak the tags.

JJZolx
2009-10-17, 16:59
There must be something very wrong with these files, but I've no idea what.

Can you post a (small) one of the files someplace that we could download it and see what the problem might be? You could also try emailing one to me at jj (at) zolx (dot) com.

Wigster
2009-10-17, 20:30
I have one uploaded here:

http://drop.io/tagcheck

It's clearly not that small, since it is a FLAC file.

audiomuze
2009-10-17, 21:33
Never seen anything like this - the file passes flac verification but even metaflac doesn't remove the tag data. It's got to be corrupt tag headers or something. All I can suggest is that you convert the flac files back to wav form and then reencode to flac, losing all tag data in the process and then retag using mp3tag or something similar.

If you've the patience you could use metaflac to dump the tag data to text file prior to doing the above. You could then edit the text files, stripping out the chaff and use that as the tag source using metaflac or mp3tag.

What did you use to create/ edit the tags?

Nonreality
2009-10-17, 22:41
Very odd. MP3tag reads multiples of everything and cannot edit it. DBpoweramp reads it normal but cannot edit it. You might want to post this on both of those forums. This is odd.

audiomuze
2009-10-17, 23:05
Very odd. MP3tag reads multiples of everything and cannot edit it. DBpoweramp reads it normal but cannot edit it. You might want to post this on both of those forums. This is odd.

Even metaflac doesn't kill the tags so it's likely the metadata blocks are corrupted. I decoded/encoded flac > wav > flac and the audio stream is fine, so using dbpoweramp to decode to wav and then encoding the wav to flac is an option, but one will have to manually retag unless you use metaflac and edit the outputs as I've suggested above.

I'm really curious as to what tools were used to do the tagging in the first place.

JJZolx
2009-10-17, 23:22
This file has grief.

I'm surprised that Squeezebox Server scans the file at all for you. It crashes my scanner with its multiple REPLAY_GAIN tags. (Squeezebox Server's scanner doesn't validate data very well - it joins the multiple RG tags, attempts to insert something that doesn't look like a valid number into a numeric field in the database and crashes with a database error.)

I have a feeling you already worked on this file with Mp3tag. The file posted has multiple FLAC vorbis comment blocks, not just repeats of fields within what should be a single comment block. I can't figure how to edit it in Mp3tag, as it tends to add additional FLAC comment blocks when you do. Can't even strip out all of the tags to start over.

Metaflac can strip out the multiple vorbis comment blocks using the following. The embedded cover art should be preserved.


metaflac --remove --block-type=VORBIS_COMMENT --dont-use-padding [FLACfile]

Andy, if you're still watching, here's the scanner crash on the RG tag:


[09-10-17 23:34:13.7238] Slim::Utils::Scanner::scanDirectory (333) Scanning: F:\Flac Test1\Bibio\Ambivalence Avenue\01 Bibio - Ambivalence Avenue.flac
[09-10-17 23:34:13.7341] Slim::Schema::Storage::throw_exception (82) Error: DBI Exception: DBD::mysql::st execute failed: Data truncated for column 'replay_gain' at row 1 [for Statement "INSERT INTO tracks (bitrate,audio_offset,drm,audio_size,vbr_scale,rep lay_peak,samplesize,remote,titlesort,audio,cover,t imestamp,replay_gain,url,lossless,channels,sampler ate,secs,filesize,content_type,titlesearch,title,y ear) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"]
[09-10-17 23:34:13.7349] Slim::Schema::Storage::throw_exception (82) Backtrace:

frame 0: Slim::Utils::Log::logBacktrace (C:/Program Files/Squeezebox Server 7.4 Trunk/server/Slim/Schema/Storage.pm line 82)
frame 1: Slim::Schema::Storage::throw_exception (C:\Program Files\Squeezebox Server 7.4 Trunk\server\CPAN/DBIx/Class/Storage/DBI.pm line 957)
frame 2: DBIx::Class::Storage::DBI::__ANON__ (C:/Program Files/Squeezebox Server 7.4 Trunk/server/Slim/Schema.pm line 1001)
frame 3: Slim::Schema::newTrack (C:/Program Files/Squeezebox Server 7.4 Trunk/server/Slim/Schema.pm line 1228)
frame 4: Slim::Schema::updateOrCreate (C:/Program Files/Squeezebox Server 7.4 Trunk/server/Slim/Utils/Scanner.pm line 347)
frame 5: Slim::Utils::Scanner::scanDirectory (C:/Program Files/Squeezebox Server 7.4 Trunk/server/Slim/Music/MusicFolderScan.pm line 79)
frame 6: Slim::Music::MusicFolderScan::startScan (C:/Program Files/Squeezebox Server 7.4 Trunk/server/Slim/Music/Import.pm line 569)
frame 7: Slim::Music::Import::runImporter (C:/Program Files/Squeezebox Server 7.4 Trunk/server/Slim/Music/Import.pm line 374)
frame 8: Slim::Music::Import::runScan (C:/Program Files/Squeezebox Server 7.4 Trunk/server/scanner.pl line 294)
frame 9: (eval) (C:/Program Files/Squeezebox Server 7.4 Trunk/server/scanner.pl line 288)
frame 10: main::main (C:/Program Files/Squeezebox Server 7.4 Trunk/server/scanner.pl line 439)

[09-10-17 23:34:13.7363] main::main (300) Error: Failed when running main scan: [Carp::Clan::__ANON__(): DBI Exception: DBD::mysql::st execute failed: Data truncated for column 'replay_gain' at row 1 [for Statement "INSERT INTO tracks (bitrate,audio_offset,drm,audio_size,vbr_scale,rep lay_peak,samplesize,remote,titlesort,audio,cover,t imestamp,replay_gain,url,lossless,channels,sampler ate,secs,filesize,content_type,titlesearch,title,y ear) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"] at C:/Program Files/Squeezebox Server 7.4 Trunk/server/Slim/Schema/Storage.pm line 86]
[09-10-17 23:34:13.7369] main::main (301) Error: Skipping post-process & Not updating lastRescanTime!

JJZolx
2009-10-18, 00:12
I was wrong about what Mp3tag is doing. The Ctrl+R is actually just emptying the first VORBIS_COMMENT block of all comments. When you do another save it populates that block with comments created by the tag values in all of the other blocks. That's why if you keep trying to edit and save the file in Mp3tag the number of repeated TITLEs (and other fields in the Tag Panel) keeps increasing. I don't believe it actually adds any additional VORBIS_COMMENT blocks - that must have been done by some other software.

You could also use metaflac to delete only the duplicate comment blocks and keep your tagging data, but it's arguably even more tedious than removing them all and retagging from scratch. You'll then most likely still have duplicate fields within the remaining block, so would have to remove those in Mp3tag.

If you want to do this, use metaflac to get a list of comment metadata blocks in a file:


metaflac --list --block-type=VORBIS_COMMENT [FLACfile]

Check the output and decide which blocks you want to remove. Note that each one is numbered. Then use something like:


metaflac --remove --block-number=3,4,5,6 --block-type=VORBIS_COMMENT --dont-use-padding [FLACfile]

Mnyb
2009-10-18, 01:27
For some reason editing the file with EasyTag ( on linux ) and saving it made it possible to edit it with mp3tag later.

EasyTag is really lousy junk-UI confusing as nothing I ever seen and it don't see all tags but it is working on this file ?

I run mp3tag under wine as i have yet to find a decent tag editor for linux.
mp3tag is normally a very good application .

JJZolx
2009-10-18, 01:35
mp3tag is normally a very good application

For whatever reason, Florian hasn't given Mp3tag the tools to take care of broken tagging situations. For instance to remove ID3v2 tags from FLAC files you have to manually delete all tags and then manually paste them back in again. Maybe he'll view this one as an actual bug and give the program the ability to remove multiple comment blocks.

Squeezebox Server could do something to combat this situation as well. In Winamp I see what looks like perfectly normal looking metadata with this screwed up file. My guess is that it only reads metadata from one of the vorbis comment blocks instead of merging and appending them all together.

Nonreality
2009-10-18, 02:36
For whatever reason, Florian hasn't given Mp3tag the tools to take care of broken tagging situations. For instance to remove ID3v2 tags from FLAC files you have to manually delete all tags and then manually paste them back in again. Maybe he'll view this one as an actual bug and give the program the ability to remove multiple comment blocks.

Squeezebox Server could do something to combat this situation as well. In Winamp I see what looks like perfectly normal looking metadata with this screwed up file. My guess is that it only reads metadata from one of the vorbis comment blocks instead of merging and appending them all together.

Dbpoweramp read the file fine, just one for each field but when I tried to use it to edit the id tag it crashed both ways I tried. I would like to know what made it so I make sure to avoid it.

MrSinatra
2009-10-18, 02:53
Squeezebox Server could do something to combat this situation as well. In Winamp I see what looks like perfectly normal looking metadata with this screwed up file. My guess is that it only reads metadata from one of the vorbis comment blocks instead of merging and appending them all together.

Jim, i don't know if this applies to what you are saying, but i know winamp will merge id3 data. so if you have 2.3 tags but they only contain RG values, and you also have 1.1 tags with artist, title, etc... winamp will ignore whats blank and take info anywhere it can get it.

as you showed me in my SBS bug, unlike winamp SBS will NOT use lower levels of info if higher levels have any info at all. thats prob how it should be, but SBS should indicate blank fields for artist, aa, and title.

Wigster
2009-10-18, 07:25
Unfortunately, I have no idea how the file got so corrupted. There isn't really a pattern to the corruption here. It's only happened on a small number of albums, but each file within it.

The only thing that is supposed to touch these files is EAC during the initial encode, then I use flac2mp3 to create a low-bitrate MP3 copy and then I paste the tag data in MP3Tag from the MP3 to FLAC once I have looked it up with Windows Media Player (I'm still to find as good a source for tags as AMG).

Some of the files (and maybe these ones are in that category) spent some time on my laptop, so they were probably added to the WMP library through the use of the WMP Tag Extender plugin. To me it appears that this plugin never writes to the FLAC files, desptie its claim to do so, so maybe that's the origin of the problem.

Finally I have had a small number of files encoded into APE and then recoded to FLAC through Foobar, but I never had any problems there.

Funnily enough, SC did not see these additional tags until v 7.4 which is why I never had any idea this was going on.

Thanks for all the suggestions. I will try to strip all the tag info using metadata and retag the files. There aren't that many.

andyg
2009-10-18, 08:26
Yikes, yeah that file is quite a mess. I'm not sure what the scanner should do with it, should it ignore multiple VORBIS_COMMENT blocks? Surely that should never occur in a normal file.

andyg
2009-10-18, 08:31
Actually that wouldn't even help, as the first comment block has duplicate tags anyway. I think the scanner probably needs to do a better job of handling multiple tags and ignoring the extras for certain fields, like replaygain, while allowing it for other fields, like artist. Either way the file is a mess and would have to be re-tagged, there's nothing the scanner can do to work around it.

SteveEast
2009-10-18, 09:28
What did the old scanner do with it?

Steve.

Wigster
2009-10-18, 09:46
It used to work fine with the old scanner. I've had some of these files for years.

EDIT: By this I mean that the old scanner ignored the extra tags somehow.

MrSinatra
2009-10-18, 10:09
Jim, i don't know if this applies to what you are saying, but i know winamp will merge id3 data. so if you have 2.3 tags but they only contain RG values, and you also have 1.1 tags with artist, title, etc... winamp will ignore whats blank and take info anywhere it can get it.

as you showed me in my SBS bug, unlike winamp SBS will NOT use lower levels of info if higher levels have any info at all. thats prob how it should be, but SBS should indicate blank fields for artist, aa, and title.

i should clarify that in my last sentence, i meant to say thats what sbs should do, but DOESN'T currently do.

MrSinatra
2009-10-18, 10:44
Actually that wouldn't even help, as the first comment block has duplicate tags anyway. I think the scanner probably needs to do a better job of handling multiple tags and ignoring the extras for certain fields, like replaygain, while allowing it for other fields, like artist. Either way the file is a mess and would have to be re-tagged, there's nothing the scanner can do to work around it.

Andy,

here are 2 bugs i think the scanner needs to address to get closer to perfect:

https://bugs.slimdevices.com/show_bug.cgi?id=8380

https://bugs.slimdevices.com/show_bug.cgi?id=9938

vagskal
2009-10-18, 12:18
For instance to remove ID3v2 tags from FLAC files you have to manually delete all tags and then manually paste them back in again.

Could you please give me the details on how you did this? What are the settings? Do I need a beta version of v. 2.44?

It does not work for me and I just tried to get an answer regarding this on the MP3TAG forum, but have not got any useful answers there yet (http://forums.mp3tag.de/index.php?showtopic=10330&st=0&gopid=40899&#entry40899)

(Sorry for being a bit off track and for not having anything encouraging to say to the OP.)

PS. Thanks for the information on how to display multiple Vorbis comments in the list view in MP3TAG. I was not aware of this possibility. Do you by any chance know of a way to search for (filter out) files with multiple comments in MP3TAG, or where I can read about this?