busywait
Posts: 64
Joined: Sat May 09, 2020 10:48 pm
Location: Southampton, UK

Command line tool to edit .flac file metadata?

Tue May 26, 2020 2:53 pm

I'd like to make a bulk correction to a folder of music files (.flac in this case). The .flac files were created with dBPowerAmp on Windows.

I've found out that id3v2 and mid3vs won't work with .flac files and that the FLAC format uses Ogg Vorbis comments. So

Code: Select all

sudo apt install vorbis-tools
When I try to use vorbiscomment I also get an error:

Code: Select all

pi@raspi3b: vorbiscomment -l WrongAlbumTagValue.flac
Failed to open file as Vorbis: Input is not an Ogg bitstream.
Does anyone here have any command line suggestions to amend the value of the "Album" field of some .flac files (without changing the other carefully added metadata)?

bls
Posts: 713
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA
Contact: Twitter

Re: Command line tool to edit .flac file metadata?

Tue May 26, 2020 3:38 pm

Haven't looked at these in detail, but a quick review of the results for sudo apt search flac shows some promising candidates worth your investigation: flac, flactag, lltag, pacpl, and puddletag.
Pi tools:
Easily and quickly build customized-just-for-you SD Cards: https://github.com/gitbls/sdm
Free your network from your router's DHCP/DNS:https://github.com/gitbls/ndm
Easy strongSwan VPN installer/manager: https://github.com/gitbls/pistrong
Lightweight Virtual VNC Config: https://github.com/gitbls/RPiVNCHowTo

User avatar
scruss
Posts: 3320
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Command line tool to edit .flac file metadata?

Tue May 26, 2020 4:19 pm

metaflac from the flac package is what I use for mass tagging live shows for the Internet Archive:

Code: Select all

sudo apt install flac
It's a big clunky: you'll end up with lots of --set-tag="NAME=VALUE" in the call. ISTR that Vorbis tags can be free-form, but the one you likely want is --set-tag="ALBUM=...".

metaflac --list is also almost entirely useless, as it lists all metadata. Got embedded artwork? It lists that, line by line, in hex.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

busywait
Posts: 64
Joined: Sat May 09, 2020 10:48 pm
Location: Southampton, UK

Re: Command line tool to edit .flac file metadata?

Tue May 26, 2020 7:17 pm

scruss wrote:
Tue May 26, 2020 4:19 pm
metaflac ...
It's a big clunky: you'll end up with lots of --set-tag="NAME=VALUE" in the call. ISTR that Vorbis tags can be free-form, but the one you likely want is --set-tag="ALBUM=...".
Thanks... if it's known working, I'll take a look :)
scruss wrote:
Tue May 26, 2020 4:19 pm
metaflac --list is also almost entirely useless, as it lists all metadata. Got embedded artwork? It lists that, line by line, in hex.
Wow, --list certainly doesn't try to have a sensible default! It took me a while to work this out...

Code: Select all

metaflac --list --block-type=VORBIS_COMMENT file.flac

And then, remembering to *remove* Album before re-adding it

Code: Select all

pi@raspi3b:~  $ metaflac --remove-tag="Album" --set-tag="Album=New Name" --preserve-modtime *.flac
for the win :)

busywait
Posts: 64
Joined: Sat May 09, 2020 10:48 pm
Location: Southampton, UK

Re: Command line tool to edit .flac file metadata?

Tue May 26, 2020 7:18 pm

bls wrote:
Tue May 26, 2020 3:38 pm
Haven't looked at these in detail, but a quick review of the results for sudo apt search flac shows some promising candidates worth your investigation: flac, flactag, lltag, pacpl, and puddletag.
Thanks - I'm new to apt, I keep forgetting that it might be able to help me!

User avatar
scruss
Posts: 3320
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Command line tool to edit .flac file metadata?

Tue May 26, 2020 9:37 pm

busywait wrote:
Tue May 26, 2020 7:17 pm
And then, remembering to *remove* Album before re-adding it
Huh. I didn't think you needed to do that. All the software I've used just uses the newest ALBUM comment tag and ignores the rest.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

Return to “Media centres”