(Download the script here: reflac.sh)
When using oggenc to convert a FLAC file to OGG Vorbis using oggenc, you might encounter the following error:
"ERROR: Input file <file> is not a supported format"
One possible reason for this can be an ID3 tag in the flac file. This can happen if the program you used to create your FLAC files uses ID3 tags instead of native FLAC tags to store metadata.
You can confirm this by typing the following:
flac --ogg enc <file>
which would then output something like this:
ERROR: input file <file> has an ID3v2 tag
If this is the problem you are having, then the following should help you
The “solutions” I found on the web have drawbacks that I could not accept.
The first “solution” is to just rip the CD again with a different software or different options. This is annoying, because you need to go through the whole process again and ripping a CD can take a long time, depending on how you do it.
Another “solution” is to convert your FLACs to WAV files and then either to OGG or back to FLAC (to get “repaired” FLACs you can now use with oggenc). The drawback of this approach is that all the metadata gets lost during the conversion from FLAC to WAV, because WAV files can not hold metadata.
I am using quotes (“solution”) to make clear that I don’t really consider them solutions to the problem, because the amount of work that would be required makes them practically useless for large collections.
The “only” problem with the second “solution” is the lost metadata. Other than that the solution works fine. Fortunately it is possible to solve the problem by using a command line tool that is already installed with flac, but that most people don’t seem to know about: metaflac.
Metaflac can extract metadata from a FLAC file and add metadata to a FLAC file as well. Therefore, all we need to do is:
- extract the metadata using metaflac
- decode the FLAC to a WAV file
- encode the WAV file back to FLAC
- import the metadata using metaflac into the new FLAC file
Using a script to “repair” the FLACs
Because this is pretty annoying by hand, I wrote a script named “reflac”. You can either use the script in a terminal or “integrate” it with Nautilus.
Downloading the script
You can download the script here: reflac.sh
Using the script from the command line
The script can be used like this:
reflac.sh <flac file>...
refla.shc foo.flac bar.flac
It just goes through the four steps for every file you throw at it.
Adding the script to Nautilus
If you don’t like the terminal that much, you can also use the script directly from Nautilus. Just copy the script to the folder ~/.gnome2/nautilus-scripts/ (To copy the script to this location from within Nautilus, download the script
Just as a disclaimer: This is a quick & dirty script I wrote and I don’t really see something in it that could go horribly wrong. Nevertheless, there is ALWAYS a risk when using software, so backing up your data is YOUR responsibility. And always keep in mind: “If it’s worth saving, it’s worth backing up!”.
Download the script here: reflac.sh