<?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>ripping &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/ripping/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Wed, 13 Aug 2025 06:23:16 +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>ripping &#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>
		<item>
		<title><![CDATA[Dealing With Quadrophonic / DVD-A Files In Linux]]></title>
		<link>https://shkspr.mobi/blog/2014/08/dealing-with-quadrophonic-dvd-a-files-in-linux/</link>
					<comments>https://shkspr.mobi/blog/2014/08/dealing-with-quadrophonic-dvd-a-files-in-linux/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 13 Aug 2014 17:44:10 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[dvd]]></category>
		<category><![CDATA[ripping]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=10744</guid>

					<description><![CDATA[These are mostly notes to myself.  These all comply with the UK&#039;s new copyright laws.  Check your local laws, kiddies!  DVD-Audio (called DVD-A or DVDA) never really took off.  It&#039;s hard to find the discs and compatible hardware.  Nevertheless, I want to listen to these high-resolution audio tracks under Linux.  In these examples, I&#039;m using Ubuntu - but any modern system should cope.  Ripping…]]></description>
										<content:encoded><![CDATA[<p>These are mostly notes to myself.  These all comply with the <a href="http://www.wired.co.uk/news/archive/2014-03/28/copyright-reform">UK's new copyright laws</a>.  Check your local laws, kiddies!</p>

<p>DVD-Audio (called DVD-A or DVDA) never really took off.  It's hard to find the discs and compatible hardware.  Nevertheless, I want to listen to these high-resolution audio tracks under Linux.  In these examples, I'm using Ubuntu - but any modern system should cope.</p>

<h2 id="ripping-dvd-a"><a href="https://shkspr.mobi/blog/2014/08/dealing-with-quadrophonic-dvd-a-files-in-linux/#ripping-dvd-a">Ripping DVD-A</a></h2>

<p>In theory, <a href="http://dvd-audio.sourceforge.net/">DVD Audio Tools</a> should work.  In practice, I found no guide to compiling the software and the pre-built binaries just didn't work. If anyone knows how to get this working, I'd be grateful if you could let me know.</p>

<p>In practice, I had to use <a href="https://www.winehq.org/">WINE</a> and <a href="http://www.videohelp.com/tools/DVD-Audio-Explorer">DVD-Audio Explorer</a> (DVDAE).</p>

<p>You can either point DVDAE at your DVD drive, or manually extract the AUDIO_TS folder to your hard disc.</p>

<p>Open up any of the .IFO files, you'll get a list of the tracks available. Select the ones you want to extract and hit save.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2014/08/dvdae-fs8.png" alt="dvdae-fs8" width="878" height="600" class="aligncenter size-full wp-image-10745">

<p>After a few moments, the tracks will be ripped onto your computer.</p>

<h2 id="playing-mlp-files"><a href="https://shkspr.mobi/blog/2014/08/dealing-with-quadrophonic-dvd-a-files-in-linux/#playing-mlp-files">Playing .MLP Files</a></h2>

<p>If you're using VLC or similar, you should be able to play the files.  If you're using XBMC / Kali / OpenElec, you'll need to add the following to "/storage/.xbmc/userdata/advancedsettings.xml"</p>

<pre>&lt;advancedsettings&gt;
  &lt;audio&gt;
    &lt;defaultplayer&gt;dvdplayer&lt;/defaultplayer&gt;
  &lt;/audio&gt;
  &lt;musicextensions&gt;
    &lt;add&gt;.mlp&lt;/add&gt;
    &lt;remove&gt;&lt;/remove&gt;
  &lt;/musicextensions&gt;
&lt;/advancedsettings&gt;
</pre>

<h2 id="converting-mlp-files"><a href="https://shkspr.mobi/blog/2014/08/dealing-with-quadrophonic-dvd-a-files-in-linux/#converting-mlp-files">Converting .MLP Files</a></h2>

<p>FFmpag / avconv will quite happily convert .mlp files into flac / ogg / anything else you like.</p>

<pre>avconv -i track.mlp trac.flac
</pre>

<p>Is sufficient to convert the file.</p>

<p>There is one small problem.  <a href="https://superuser.com/questions/790331/converting-32-bit-mlp-to-32-bit-flac">FLAC does <strong>not</strong> support 32 bit files</a>.  While the documentation for avconv suggests that using "-sample_fmt s32" will work, it will either silently drop back down to 16 bit or simply not work.</p>

<p>Quite how much sonic information you will lose by going <a href="https://people.xiph.org/~xiphmont/demo/neil-young.html">from 32bit to 16bit is up for debate</a>.  Basically, unless you really do have amazing hearing, professionally calibrated studio equipment, and no ambient noise. Even then, most of what you're losing is noise.</p>

<p>On the other hand, disk space is relatively cheap.  A typical .MLP file will be reduced by 50% - 60% when converted to FLAC based on my tests.</p>

<p>One thing I did find was that some equipment would get the order of the FLAC channels mixed up, or upconvert the sound to 5.1.  Have a play with your equipment and see what works.</p>

<h2 id="dts-wav-files"><a href="https://shkspr.mobi/blog/2014/08/dealing-with-quadrophonic-dvd-a-files-in-linux/#dts-wav-files">DTS WAV Files</a></h2>

<p>Some surround music is available as DTS (yup, just like on DVDs).  It's encoded as a straight .WAV - the idea being that you digitally stream the WAV to your equipment, your HiFi detects that is actually a DTS bitstream and plays glorious surround sound.  If any part of this goes wrong, you'll hear static.  Not nice.</p>

<p>Sometimes, avconv won't automatically detect the DTS encoding</p>

<pre>avconv -i dts.wav
Input #0, wav, from 'dts.wav':
  Duration: 00:04:08.70, bitrate: 1411 kb/s
    Stream #0.0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
</pre>

<p>in which case, just force it to see the DTS - you can ignore any errors</p>

<pre>avconv -f dts -i dts.wav
[dca @ 0x19dc840] Not a valid DCA frame
[dts @ 0x19d27c0] max_analyze_duration reached
[dts @ 0x19d27c0] Estimating duration from bitrate, this may be inaccurate
Input #0, dts, from 'dts.wav':
  Duration: 00:04:08.70, start: 0.000000, bitrate: 1411 kb/s
    Stream #0.0: Audio: dca (DTS), 44100 Hz, 5.1, s16, 1411 kb/s
</pre>

<p>You can then convert to any other format you like.</p>

<h2 id="from-dvd"><a href="https://shkspr.mobi/blog/2014/08/dealing-with-quadrophonic-dvd-a-files-in-linux/#from-dvd">From DVD</a></h2>

<p>Most DVD-A discs also contain a slightly lower quality copy which can be played as a normal DVD. Sweet!</p>

<p>I use <a href="http://makemkv.com/">MakeMKV</a> to extract the regular DVD portion.  I've written <a href="https://shkspr.mobi/blog/2012/02/command-line-backup-for-dvds/">a brief tutorial about using it on the command line</a>.</p>

<p>Once you have your .mkv you have two choices.  Either leave it as it is - you get the benefit of chapter markers at the cost of a higher file size due to the video content.  Or rip the audio straight out.</p>

<pre>avconv -i whatever.mkv -acodec copy audio.ac3</pre>

<p>Generally, a much smaller filesize than the .mlp - have a listen to see if you can notice the loss of fidelity.  Annoyingly, converting AC3 to FLAC will <em>increase</em> the file size.</p>

<p>Incidentally, if you want to rip, say, the 2nd audio track - if you've got multiple audio tracks on a disc:</p>

<pre>avconv -i whatever.mkv -map 0:2 test.flac</pre>

<p>For some reason, neither MakeMKVcon nor avconv can extract PCM audio from DVDs.  For this, we have to use mplayer:</p>

<pre>mplayer -vc null -vo null -ao pcm:fast -ao pcm:file=audio.wav dvd://1 -dvd-device /full/path/to/VIDEO_TS/</pre>

<p>Takes a little while, but gets the job done.  Naturally, the .wav can be converted to flac.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=10744&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/08/dealing-with-quadrophonic-dvd-a-files-in-linux/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Command Line Backup for DVDs]]></title>
		<link>https://shkspr.mobi/blog/2012/02/command-line-backup-for-dvds/</link>
					<comments>https://shkspr.mobi/blog/2012/02/command-line-backup-for-dvds/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 22 Feb 2012 12:37:39 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[drm]]></category>
		<category><![CDATA[dvd]]></category>
		<category><![CDATA[ripping]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=5364</guid>

					<description><![CDATA[This is a quick tutorial to show you how to rip DVDs on a headless server.  That is; one which only has command line access.  The documentation for MakeMKV is available.  It&#039;s a bit sparse. It also doesn&#039;t have many of the features of the GUI.  For example, the GUI allows you to select which video, audio, and subtitles, you want to copy. So if you only want the original German director&#039;s…]]></description>
										<content:encoded><![CDATA[<p>This is a quick tutorial to show you how to rip DVDs on a headless server.  That is; one which only has command line access.</p>

<p><a href="http://www.makemkv.com/developers/usage.txt">The documentation for MakeMKV is available</a>.  It's a bit sparse. It also doesn't have many of the features of the GUI.</p>

<p>For example, the GUI allows you to select which video, audio, and subtitles, you want to copy. So if you only want the original German director's commentary, with the Swedish subtitles from the main feature, you can do that.
<img src="https://shkspr.mobi/blog/wp-content/uploads/2012/02/makemkv-gui.jpg" alt="makemkv gui" title="makemkv gui" width="312" height="324" class="aligncenter size-full wp-image-5365">
The command line is an "all or nothing affair".</p>

<h2 id="install-the-software"><a href="https://shkspr.mobi/blog/2012/02/command-line-backup-for-dvds/#install-the-software">Install The Software</a></h2>

<p>We're going to be using MakeMKV.  The <a href="http://www.makemkv.com/forum2/viewtopic.php?f=3&amp;t=224">latest version of the Linux software</a> can be found on their forum.</p>

<p>First, download both pieces of software.</p>

<pre>wget http://www.makemkv.com/download/makemkv-bin-1.7.6.tar.gz
wget http://www.makemkv.com/download/makemkv-oss-1.7.6.tar.gz</pre>

<p>Then, extract the files.</p>

<pre>tar -zxvf makemkv-bin-1.7.6.tar.gz
tar -zxvf makemkv-oss-1.7.6.tar.gz</pre>

<p>Get the tools you need to build the software</p>

<pre>sudo apt-get install build-essential libc6-dev libssl-dev libexpat1-dev libgl1-mesa-dev libqt4-dev</pre>

<p><strong>NOTE:</strong> You need GCC version 4.6 or higher.  If you're unsure which version you have, type:</p>

<pre>gcc --version</pre>

<p>If you need a more recent version, <a href="http://superuser.com/questions/310809/how-can-i-update-gcc-to-the-latest-version-in-ubuntu-10-04/394811#394811">follow these GCC upgrade instructions on StackOverflow</a>.</p>

<p>To build the software, first compile the Open Source part</p>

<pre>cd makemkv-oss-1.7.6
make -f makefile.linux
sudo make -f makefile.linux install</pre>

<p>Then install the binary part (you will have to agree to a licence).</p>

<pre>cd ../makemkv-bin-1.7.6
make -f makefile.linux
sudo make -f makefile.linux install</pre>

<p>All should be installed without error!</p>

<h2 id="running-for-the-first-time"><a href="https://shkspr.mobi/blog/2012/02/command-line-backup-for-dvds/#running-for-the-first-time">Running for the First Time</a></h2>

<p>Stick a DVD in your drive and run the following command</p>

<pre>makemkvcon -r info</pre>

<p>You should get a bunch of information about the drive and the program.</p>

<p>To see information about the disc, run</p>

<pre>makemkvcon -r info disc:0</pre>

<p>Assuming that your DVD drive is 0.</p>

<h2 id="how-to-rip"><a href="https://shkspr.mobi/blog/2012/02/command-line-backup-for-dvds/#how-to-rip">How To Rip</a></h2>

<p>This command rips all the movies on the disc which are longer than 3600 seconds (60 minutes).  This means that it should skip any special features etc.</p>

<p>You will need to create the folder you want to rip to first. The filename will be "title00.mkv" so make sure you're ripping to a unique folder each time.</p>

<pre>makemkvcon --minlength=3600 -r --decrypt --directio=true mkv disc:0 all /DVDs/MovieName/ ; eject -r</pre>

<p>The " ; eject -r" tells the system to eject the disc once ripped.</p>

<h2 id="what-cant-you-do"><a href="https://shkspr.mobi/blog/2012/02/command-line-backup-for-dvds/#what-cant-you-do">What Can't You Do?</a></h2>

<p>MakeMKVcon is missing the following functionality (hopefully being fixed by its creator)</p>

<ul>
    <li>Can't select a specific title.</li>
    <li>Can't extract specific audio files.</li>
    <li>Can't specify subtitles.</li>
    <li>Can't create folder.</li>
    <li>Can't set filename.</li>
</ul>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=5364&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2012/02/command-line-backup-for-dvds/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
