<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blog.tordeu.com &#187; oggenc</title>
	<atom:link href="http://blog.tordeu.com/?feed=rss2&#038;tag=oggenc" rel="self" type="application/rss+xml" />
	<link>http://blog.tordeu.com</link>
	<description>a blog about stuff</description>
	<lastBuildDate>Thu, 25 Apr 2013 07:03:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.2</generator>
		<item>
		<title>&#8220;ERROR: Input file  is not a supported format&#8221; when using oggenc to convert a FLAC to OGG Vorbis</title>
		<link>http://blog.tordeu.com/?p=61</link>
		<comments>http://blog.tordeu.com/?p=61#comments</comments>
		<pubDate>Wed, 16 Nov 2011 13:53:03 +0000</pubDate>
		<dc:creator>tordeu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[flac]]></category>
		<category><![CDATA[metaflac]]></category>
		<category><![CDATA[ogg]]></category>
		<category><![CDATA[oggenc]]></category>

		<guid isPermaLink="false">http://blog.tordeu.com/?p=61</guid>
		<description><![CDATA[(Download the script here: ) Problem When using oggenc to convert a FLAC file to OGG Vorbis using oggenc, you might encounter the following error: "ERROR: Input file &#60;file&#62; is not a supported format" Explanation One possible reason for this can be an ID3 tag in the flac file. This can happen if the program <a href='http://blog.tordeu.com/?p=61'>[...]</a>]]></description>
				<content:encoded><![CDATA[<p style="text-align: right;">(Download the script here: <a href="http://blog.tordeu.com/downloads/1">reflac.sh</a>)</p>
<h2>Problem</h2>
<p>When using oggenc to convert a FLAC file to OGG Vorbis using oggenc, you might encounter the following error:</p>
<pre>"ERROR: Input file &lt;file&gt; is not a supported format"</pre>
<h2>Explanation</h2>
<p>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.</p>
<p><span id="more-61"></span>You can confirm this by typing the following:</p>
<pre>flac --ogg enc &lt;file&gt;</pre>
<p>which would then output something like this:</p>
<pre>ERROR: input file &lt;file&gt; has an ID3v2 tag</pre>
<p>If this is the problem you are having, then the following should help you</p>
<h2>Bad &#8220;Solutions&#8221;</h2>
<p>The &#8220;solutions&#8221; I found on the web have drawbacks that I could not accept.</p>
<p>The first &#8220;solution&#8221; 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.</p>
<p>Another &#8220;solution&#8221; is to convert your FLACs to WAV files and then either to OGG or back to FLAC (to get &#8220;repaired&#8221; 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.</p>
<p>I am using quotes (&#8220;solution&#8221;) to make clear that I don&#8217;t really consider them solutions to the problem, because the amount of work that would be required makes them practically useless for large collections.</p>
<h2>Solution</h2>
<p>The &#8220;only&#8221; problem with the second &#8220;solution&#8221; 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&#8217;t seem to know about: metaflac.</p>
<p>Metaflac can extract metadata from a FLAC file and add metadata to a FLAC file as well. Therefore, all we need to do is:</p>
<ol>
<li>extract the metadata using metaflac</li>
<li>decode the FLAC to a WAV file</li>
<li>encode the WAV file back to FLAC</li>
<li>import the metadata using metaflac into the new FLAC file</li>
</ol>
<h2>Using a script to &#8220;repair&#8221; the FLACs</h2>
<p>Because this is pretty annoying by hand, I wrote a script named &#8220;reflac&#8221;. You can either use the script in a terminal or &#8220;integrate&#8221; it with Nautilus.</p>
<h3>Downloading the script</h3>
<p>You can download the script here: <a href="http://blog.tordeu.com/downloads/1">reflac.sh</a></p>
<h3>Using the script from the command line</h3>
<p>The script can be used like this:</p>
<pre>reflac.sh &lt;flac file&gt;...</pre>
<p>Example 1:</p>
<pre>refla.shc foo.flac bar.flac</pre>
<p>Example 2:</p>
<pre>reflac.sh *.flac</pre>
<p>It just goes through the four steps for every file you throw at it.</p>
<h3>Adding the script to Nautilus</h3>
<p>If you don&#8217;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</p>
<p>Just as a disclaimer: This is a quick &amp; dirty script I wrote and I don&#8217;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: &#8220;If it&#8217;s worth saving, it&#8217;s worth backing up!&#8221;.</p>
<h2>Download</h2>
<p>Download the script here: <a href="http://blog.tordeu.com/downloads/1">reflac.sh</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tordeu.com/?feed=rss2&#038;p=61</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
