<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<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>dvda &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/dvda/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Fri, 24 Jan 2025 09:32:04 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>dvda &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Extracting DVD-Audio on Linux, the modern(ish) way]]></title>
		<link>https://shkspr.mobi/blog/2019/01/extracting-dvd-audio-on-linux-the-modernish-way/</link>
					<comments>https://shkspr.mobi/blog/2019/01/extracting-dvd-audio-on-linux-the-modernish-way/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Thu, 24 Jan 2019 17:16:04 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[dvd]]></category>
		<category><![CDATA[dvda]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opus]]></category>
		<category><![CDATA[ripping]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=31270</guid>

					<description><![CDATA[DVD-Audio (henceforce DVDA) is an unloved and mostly forgotten audio format. Nevertheless, there&#039;s a large back-catalogue of music which is still trapped on ancient discs encoded in the proprietary MLP format.  A few years ago I wrote about how to extract the audio using the obsolete Windows program DVD-Audio Explorer.  I wanted to be able to run the extraction via the command line, which means…]]></description>
										<content:encoded><![CDATA[<p>DVD-Audio (henceforce DVDA) is an unloved and mostly forgotten audio format. Nevertheless, there's a large back-catalogue of music which is still trapped on ancient discs encoded in the proprietary MLP format.</p>

<p>A few years ago <a href="https://shkspr.mobi/blog/2014/08/dealing-with-quadrophonic-dvd-a-files-in-linux/">I wrote about how to extract the audio using the obsolete Windows program DVD-Audio Explorer</a>.  I wanted to be able to run the extraction via the command line, which means trying to find a native Linux app.  I tried <a href="http://audiotools.sourceforge.net/">Python AudioTools</a> but I got lost in an endless maze of incompatible dependencies.</p>

<p>So I went with <a href="https://github.com/tuffy/libdvd-audio">Brian "tuffy" Langenberger's <code>libDVD-Audio</code></a>.</p>

<p>To install, simply run:</p>

<pre><code class="language-_">sudo make install
</code></pre>

<p>That will give you two new programs.  To get info about your DVDA, run:</p>

<pre><code class="language-_">dvda-debug-info -A /path/to/your/AUDIO_TS
</code></pre>

<p>That will pump out details about each track like so:</p>

<pre><code class="language-_">Title  Track  Length  PTS Length  First Sector  Last Sector
    1      1    3:30    13450000             0        86547
    1      2    4:11    12500000         73144       122600
    1      3    2:11    16010000        370601       233337
</code></pre>

<h2 id="extract"><a href="https://shkspr.mobi/blog/2019/01/extracting-dvd-audio-on-linux-the-modernish-way/#extract">Extract</a></h2>

<p>To extract the tracks, run:</p>

<pre><code class="language-_">dvda2wav -A /path/to/your/AUDIO_TS
</code></pre>

<p>That will spit out the files in WAV format.</p>

<h2 id="encode"><a href="https://shkspr.mobi/blog/2019/01/extracting-dvd-audio-on-linux-the-modernish-way/#encode">Encode</a></h2>

<p>WAV is pretty large - about 20MB per minute per channel.  Converting to FLAC (the Free Lossless Audio Codec) gets you down to about 10MB.  I just go straight for the modern <a href="https://opus-codec.org/">Opus Codec</a> which does excellent quality surround sound at low file sizes.</p>

<pre><code class="language-_">opusenc --bitrate 4096 track-01-01.wav 1.opus
</code></pre>

<p>That's about 2MB/minute/channel and I promise that you won't hear the difference.</p>

<h2 id="metadata"><a href="https://shkspr.mobi/blog/2019/01/extracting-dvd-audio-on-linux-the-modernish-way/#metadata">Metadata</a></h2>

<p>If you want to add metadata to a track, it's done like this:</p>

<pre><code class="language-_">opusenc --bitrate 4096 in.wav out.opus --title "Yesterday" --artist "The Beatles" --tracknumber "02"
</code></pre>

<p>Older versions of Opusenc, oddly, don't have a native way to express track numbers, so you'll need to do it manually using <code>--comment "tracknumber=02"</code></p>

<p><ins datetime="2019-07-30T08:08:18+00:00">Newer versions can use <code>--tracknumber</code> to add track numbers.</ins></p>

<h3 id="automating"><a href="https://shkspr.mobi/blog/2019/01/extracting-dvd-audio-on-linux-the-modernish-way/#automating">Automating</a></h3>

<p>You can make it slightly easier to add the metadata if you give the files predictable names.  For example: <code>01-Yesterday-The Beatles.wav</code></p>

<p>Here's a scrappy bash script:</p>

<pre><code class="language-_">#!/bin/bash
for FILE in *.wav
do
    FILENAME="${FILE%.*}"

    TRACK=$(echo  $FILENAME | cut -d'-' -f 1)
    TITLE=$(echo  $FILENAME | cut -d'-' -f 2)
    ARTIST=$(echo $FILENAME | cut -d'-' -f 3)

    OUTPUT="[$TRACK] $ARTIST - $TITLE.opus"

    opusenc --bitrate 4096 "$FILE" "$OUTPUT" --title "$TITLE" --artist "$ARTIST" --tracknumber "$TRACK"
done
</code></pre>

<p>I hope future me finds these notes useful!</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=31270&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2019/01/extracting-dvd-audio-on-linux-the-modernish-way/feed/</wfw:commentRss>
			<slash:comments>8</slash:comments>
		
		
			</item>
	</channel>
</rss>
