Remove ID3 tags from FLAC files

If you’ve flac files with id3 tags embedded they’re easily removed using the bash script below.

First generate a list of folders/directories to be processed:

find . -type d -exec ls -d {} \; >> ./id3inFLAC.list

install id3v2 via your favourite Linux distribution or from here.

Now parse and process it:

[code]#!/bin/bash

id3v2=/bin/id3v2
cwd=$(pwd)
filelist=./id3inFLAC.list

set the number of seconds to run

multiply by 3600 for each hour

(( seconds_to_run= 24 * 3600 ))

echo “Run duration: $seconds_to_run seconds”
echo "Albums to process: " $(wc -l $filelist)

while [ -s $filelist -a $SECONDS -lt $seconds_to_run ] ; do
file=$(head -1 $filelist)
echo .
echo .
echo Removing ID3 tags from: “$file”
echo .
echo .
cd “$file”
find . -name “*.flac” -exec $id3v2 --delete-all {} ;
# flac -f -8 *.flac
cd $cwd
# remove current file from list
sed -i.prev ‘1d’ $filelist
done[/code]

1 Like

Why would you ever want to do this? Just curious.

FLAC files should not have ID3 tags for metadata. But some programs unfortunately have added and they can be hard to remove. FLAC metadata is properly contained in VORBIS COMMENT tags, as used by most FLAC encoder programs.

Ah…didn’t know that. Thanks. :slight_smile:

Yip, luckily I’ve not purchased anything with id3 tags in some time. Whilst e-tailers still generally do a crappy job with metadata it seems they’ve at least stopped embedding id3.

Gary, can you pls explain more about the impact on roon’s behavior if having ID3 inside flac? To be honest I’m not sure if I have ID3 inside my files. Nearly all of them ripped with dB-poweramp and subsequently cleansed by TAG (appropriate software for individual correction via iMac) and for harmonization mass changes I used media monkey (unfortunately only on PC but great for this specific task).

All over all I can’t say that I have a mayor issue, but I also from time to time see some room for meta data improvement surfing my CDs in roon.

So do you think it’s an issue for roon detecting ID3 within my files?

doubt it, not sure whether or not Roon would read them and if so whether it’d favour id3 over vorbis comments, however, I can tell you that the FLAC toolset doesn’t anticipate nor cater for it - it won’t even run an integrity test on a FLAC file with id3 headers.

That’s exactly my thought. I can somehow live with the situation without 100% formal consistency. Especially because my files have to be that robust feeding roon and sonos in parallel. In my implementation the metadata issue is close to perfect for my requirements.

I invested a lot in metadata cleansing but focused only on the most important tags for me

  • Album title
  • Album artist
  • album image
  • Song title
  • Song title artist
  • Compilation y/n
  • Composer (because I have a lot of classical music)

In the composer I have a home made issue: Before roon I organized my composer entries by “year name” because then I could easily see my composers in a historic sequence and composers of non classical further down could be ignored. Now I think I have an issue in roon properly feeding the “works” category because roon obviously doubts the “year name” entry in composer but as I mentioned I’ m not sure about root cause. Unfortunately at least for me it’s not 100% clear how Roon deals with which meta date fields and how I can contrive best in getting it most of it in my set up.

If you ripped with dbpoweramp, you don’t have id3 tags. Dbpoweramp correctly uses vorbis comment tags in flac files.

2 Likes

Great to hear - THX :sunglasses: