Terence Eden. He has a beard and is smiling.
Theme Switcher:

Extracting DVD-Audio on Linux, the modern(ish) way

· 5 comments · 400 words · Viewed ~3,336 times


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.

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 trying to find a native Linux app. I tried Python AudioTools but I got lost in an endless maze of incompatible dependencies.

So I went with Brian "tuffy" Langenberger's libDVD-Audio.

To install, simply run:

sudo make install

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

dvda-debug-info -A /path/to/your/AUDIO_TS

That will pump out details about each track like so:

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

Extract

To extract the tracks, run:

dvda2wav -A /path/to/your/AUDIO_TS

That will spit out the files in WAV format.

Encode

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 Opus Codec which does excellent quality surround sound at low file sizes.

opusenc --bitrate 4096 track-01-01.wav 1.opus

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

Metadata

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

opusenc --bitrate 4096 in.wav out.opus --title "Yesterday" --artist "The Beatles" --tracknumber "02"

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

Newer versions can use --tracknumber to add track numbers.

Automating

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

Here's a scrappy bash script:

#!/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

I hope future me finds these notes useful!


Share this post on…

5 thoughts on “Extracting DVD-Audio on Linux, the modern(ish) way”

  1. Thanks man! this was realy useful and it works. I have a small collection of DVD-Audio discs and nothing to play them currently, this will help me a lot.

    Reply

  2. Wow -- I'm not even future you and I found this very useful. Thanks for writing.

    I was a bit confused to see that tuffy made libdvd-audio as well as Python Audio Tools. The latter was, indeed, not only difficult to get the dependencies working, but the result was clearly out of date compared to its dependencies, so you really need to do some amateur archaeology to find out the exact version of urwid to add, etc. It doesn't seem worth it. Arch and NixOS both don't seem to have a working copy of dvd2atrack, I was really surprised.

    Reply

  3. Pretty cool and still relevant, thanks for sharing! Would anyone know of the method/tool to use for extracting the WAV from the VIDEO_TS folder by any chances?

    Reply

  4. I am so happy I stumbled onto libdvd-audio via this page, thanks!

    One important note: if your DVD-A needs decrypting, the built-in CPPM routines are only activated if you provide a command line switch with the path to your DVD device. So to extract all audio tracks, use (assuming you have /dev/dvd; you might instead have /dev/sr0):

    dvd2wav -A /mnt/mypath/AUDIO_TS -c /dev/dvd

    Note well that you first have to mount your DVD-A, as in mount /dev/dvd /mnt/mypath.

    I’m looking at the source now with the aim of making decrypted .AOB files instead of extracting the audio, similar to the functionality of the DVD Audio plugin for foobar2000 (using file operations). With a fully decrypted AUDIO_TS/ and a decrypted (via another tool) VIDEO_TS/ one could use a UDF tool to produce a fully decrypted ISO image.

    Reply

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.

See allowed HTML elements: <a href="" title="">
<abbr title="">
<acronym title="">
<b>
<blockquote cite="">
<br>
<cite>
<code>
<del datetime="">
<em>
<i>
<img src="" alt="" title="" srcset="">
<p>
<pre>
<q cite="">
<s>
<strike>
<strong>

To respond on your own website, write a post which contains a link to this post - then enter the URl of your page here. Learn more about WebMentions.