Re: Adding native FLAC padding column and removal

A long time ago, two years in fact, I created this thread:

I had asked for something to be added in MP3tag: to be able to see and remove padding from FLAC files natively within MP3tag.

As you know, adding a cover art to FLAC files creates the necessary space within the file to accomodate it. However, what you may not know, removing the cover art does NOT remove the extra space that the cover art needed. You need to use metaflac.exe to sanitize the tags.

So, I would like to ask Florian where in its checklist is this feature. He clearly stated in the thread I created above that they did add the feature onto the to-do list.

For now, adding the custom column like I said in the thread above is still possible but, then, you still have to use metaflac separately to remove the padding or use foobar2000 with its "Optimize size" function (right click file -> Properties -> Tools button -> Optimize size).

Adding this function natively would be so much time save!

Cheers.

Here is a thread that describes how you can call metaflac as a tool from within MP3tag:

I tried before doing it myself but it never worked. To boot, I don't speak German.

I'm just curious:
How much hard disc- or SSD space would you gain in your own collection by "optimizing" the FLAC size?

And how much time would you loose, because you realize sometime later, that you need to add some metadata and therefore every single optimized file has to be completely rewritten?

Probably not much, but again, I'm kind of anal about this as I absolutely loathe cover art embedding. Some people embed huge cover arts (several megabytes per file) and I finally want a one-stop app to remove everything. Never been able to call metaflac with MP3tag despite all the supposed solutions to this. Always has been: remove cover with MP3tag then load files into foobar2000 and remove padding. Ugh.

I would have thought that there are a lot of translation web sites around that translate

  • setze den Pfad zu metaflac.exe
  • gebe die Parameter ein:
    --remove --block-type=PICTURE,PADDING --dont-use-padding "%_path%"
  • wähle für alle ausgewählten Dateien
  • bestätige mit OK

into

  • set the path to metaflac.exe
  • enter the parameters:
    --remove --block-type=PICTURE,PADDING --dont-use-padding "%_path%"
  • select for all selected files
  • acknowledge with OK
1 Like

For all future reader searching for the tool definition to remove the Cover Art and padding space for FLAC files in Ctrl+O, Tools:

Adjust the Path: to the location where you have saved the two files metaflac.exe and libFLAC.dll
if you add it in the Windows version of Mp3tag (available from here https://xiph.org/flac/download.html)

Tool-Definition

The Parameter needed to remove an existing cover and the used padding space for it:
--remove --block-type=PICTURE,PADDING --dont-use-padding "%_path%"

The explanation from the help file of metaflac for the used options:

--dont-use-padding    By default metaflac tries to use padding where possible
                      to avoid rewriting the entire file if the metadata size
                      changes.  Use this option to tell metaflac to not take
                      advantage of padding this way.

--remove
    Remove one or more metadata blocks from the metadata.  Unless
    --dont-use-padding is specified, the blocks will be replaced with padding.
1 Like

I have tried this in the past and it does not work.

I have tried this 2 minutes before and it works.
Before:

After:

Thanks but no thanks.

I didn't come here in search of alternate solution with dependencies. I came here to ask Florian what was the status of a BUILT-IN solution. A one-click no bullock solution that will work like in Foobar2000. Using outside tools is not a built-in solution; it's a workaround.

Here's the thing. I backup my settings and all that but, in the event I lose my backups and can't recover my setup, I'll have to reprogram this workaround and I ABSOLUTELY DETEST working with any kind of CLI or arguments. It needs to be dead simple for me to go that way.

Cheers.

Just an observation on my side:
a lot of suggestions for functions for which there is something that you call

have never been implemented.
So I think that until the day when your suggestion becomes a function that you like better you have to live with the "workarounds".

Look, 2 years ago I asked Florian for this and he said and I quote...

I came here asking about the bolded part. That is it.
I just didn't want to necro the old thread.

The topic is still on the to-do-list:

This post is from February 2023.
All I am saying: until it gets implemented you are stuck with that what is classified as workaround.

Some discussion about the empty padding in FLAC files after removing cover art has referenced this thread on the MusicBee forum. Seems the search continues for a way to recover some of this file space for those with larger libraries.

It's still not a thing almost a year later. I'm sad. I still have to drop the files in Foobar after tagging to remove the padding. I never got the command-line stuff to work in MP3tag.

If forum members show that something works like in this post:

and you say it does not work, it would be best if you showed us a similar screenshot of the tool definition so that others may spot what the problem may be.

1 Like

I've just released Mp3tag v3.23d with a new entry Utils → Optimize FLAC in the right-click context menu of FLAC files. This will remove the excess padding from the selected FLAC files.

To display existing padding, create a column with value %_tag_size_appended%. This reports the size of the padding for FLAC files, where %_tag_size_prepended% reports the size of the Vorbis Comments and embedded cover art.

1 Like

I have just tested the new function.

Until now I've displayed padding as $div(%_tag_size%,1024) to show the KiB value. Adding 2 more columns with %_tag_size_appended% and %_tag_size_prepended% yielded this result for a test album:
grafik

After using Utils → Optimize FLAC that becomes:
grafik
as expected.
So the function works.

A few things to note are:
As far as I can tell this step cannot be undone within mp3tag (Edit → Undo did not add the padding back).
Removing the padding entirely is pretty dumb in my opinion since that means any added information will lead to a rewrite of the file, slowing down editing to a crawl for negligible space savings.

I think this option would be far more useful if the user could set whether to remove the padding completely (now state) or if the padding should be set to a chosen value (if possible).

My converter of choice (dbpoweramp) handles it this way.
Instead of removing the padding entirely the padding is set to a fixed value of 4KiB if the metadata and embedded images do not blow it up past that point.

Which is why my workflow to remove excess padding is running all flac files through dbpoweramp to convert from flac to flac after I have removed embedded images etc.. That means the wasted 2MB padding per song from an embedded 3000x3000px jpg (for example) are reclaimed but a sensible padding of 4KiB remains. It also has the added benefit of ensuring that all files are encoded with a current version of flac with max compression and it also reveals files containing errors since the converter verifies the files.

So in summary: Removing the padding in mp3tag works, but I wouldn't recommend using it.

Thanks you so much, Florian! Better late than never. Once the next stable release hits, I'm updating for sure.

That's a YOU preference. I do not want any padding created from embedding image files. I much prefer having a single image files easy to change in the folder where my FLAC file(s) are. And adding a few seconds because I removed the padding for the padding for the tags to be recreated is no biggie.

The option is there for those like me.

That can also be an optional option. Don't force your opinion on others.

Padding is not special to image files., in flacs it is only a problem because of the possible notable waste of space as Mp3tag does not clear this space after deleting embedded artwork automatically and artwort is the only tag that really needs notable space. A 4k-padding-reserve makes always sense. The space for the usually used text-tags is vanishingly small. A typical music-flac-file of let's say 4 minutes could have a size of 25 MB. Who really cares in a file like this about an additional 4kb space which would be about 0,016 % additional space and often even does not make a difference because the file-system also saves in 4k-blocks.

If you clear the padding of flac-files with this new util of Mp3tag to zero any change you make to your tags with MP3tag will again create a padding of 4k, no matter whether you add an additional character or delete a character.

2 Likes