Wednesday, September 4, 2019

How to Rip a DVD Audio Track using Free Software

Sometimes it can be helpful to have the audio track from a movie available as a computer file. This post gives a detailed description how to achieve this in two simple steps. It uses the software packages "HandBrake" and "VLC player". In an additional step, one can then edit the audio, e.g. using "Audacity". All of these three programs are free and available for Windows, Mac, and Linux. Below, all screenshots are shown for my Kubuntu Linux system, but they should very similar for Windows and Mac.

Why would you want to rip DVD Audio?

For me, ripping audio from DVDs becomes relevant whenever I build movie props with sounds. A nice example is the HAL 9000 computer from the "2001: A Space Odyssey" movie. My HAL 9000 replica features an infrared motion sensor which triggers HAL's sound clips from the movie. The electronics is based on an Arduino micro controller connected to the DFPlayer Mini module. The latter plays mp3 files from a micro SD card (I have posted a detailed description of this player here).
While one can find many of HAL's sound clips on the the web, they are usually in rather poor quality, different files have inconsistent sound quality and volume levels, and not all of HAL's clips are available. To get the best quality, and a complete set of HAL's sound clips (which I listed here), I decided to do it myself and from scratch, as follows...

Three Steps

Starting with the DVD of the movie, it took me three steps to get all the sound clips.
  1. Ripping the DVD. This creates a computer file of the movie (of approx. 1 GB size). 
  2. Extracting the audio. This produces a single with all the audio from the movie.
  3. Editing the audio. In this step, the individual sound clips are separated and optimized.

Ripping the DVD in HandBrake

When the DVD is inserted in the DVD drive, launch HandBrake and you should see this:

From the File menu (1), select the DVD (2). 

Now, the name of the DVD will show up (3). It will take a minute or two (depending on the disk) to read the structure of the DVD, and HandBrake will identify the titles on the disc and their chapters.
 

Usually, HandBrake selects the main movie (= the longest title) and it selects all chapters. If this is not what you want, you can change this in the "title" and "chapter" pull-down menus.
From the File menu (4), select "destination" (5). This opens the file dialog and you choose where you want the output file to be saved.

In this example, I chose my USB drive with name "Samsung USB". This is then displayed at (6). (Note: the filename is generated automatically, here "Moon.mkv". You may change this if you want)

Select the “Normal” preset, on the right, under “Presents” (I forgot to number this). 
In the "Audio" tab (7), you open the "Encoder" menu and select "Auto Passthru" (8). This means that you will get the original DVD audio file, without any degrading due to re-encoding. 

Then you press "Start" (9), wait for an hour or so ... (depending on the DVD and your computer) ... and you will find the file in the destination that you chose in (5) and (6). Now you can quit HandBrake.
Please note that this procedure was optimized to result in the best possible audio track and in a fast ripping. You should only use this for ripping Audio. If you plan to rip movies, you should search Google to find the best settings for this purpose.

Extracting the Audio in VLC Player

Here, VLC Player is used to extract the audio is extracted in “CD audio quality” with the original DVD sample rate of 48kHz. Launch VLC player


 In the "Media" pull down menu (1), select "Convert/Save" (2)

This opens a new window. In the "File" tab you select "Add" (2b) which opens the file dialog, where you select the output file from HandBrake (here: Moon.mkv) which shows up at (2c).

Pressing "Convert/Save" (2d) brings you to the "Convert" screen Where you select the profile (3) of "Audio - CD" (4). 

The selected profile shows up in field (5). Now you click "Edit selected profile" (6).

Based on the "Audio - CD" profile, everything should be set correctly - but you may want to check. In the "Encapsulation" tab, check that "WAV" (8) is selected.

In the "Audio codec" tab (9), uncheck "keep original audio track", and from the "Codec" menu select "Wav" (10).


Make sure that the "Sample Rate" is set to 48000Hz (10) - and press "Save" at the bottom.

This brings you to the next screen where you select "Browse" (11) and enter the name of the output file for the results.

Then you press "Start" (12) and may watch the progress bar while VLC is producing the audio file. This takes less than a minute. Then you have the complete file with the audio track from the DVD video. If this is all that you wanted, you're done. Have a great day!

If, however, you plan to extract individual sound clips then fire up Audacity and continue reading... 

Editing the Audio in Audacity

Audacity is an incredibly powerful (and free!) audio editor. In the following I will show you how to use it to:
  • select a piece of an audio file
  • optimize the volume ("normalize")
  • apply fade in/out
  • save the result as mp3 file
When you open the (huge!) file in Audacity, it takes a moment for Audacity to create the waveform, and the result will look like this.


Let's say that there is a short sound clip at 7:43 minutes into the movie that you would like to edit and extract. You can mark the approximate region with the mouse,


from the "View" menu you select "Zoom to selection",


and the result will look like this.


With the mouse (point and click) you can place the cursor wherever you like, and play from the current location using the Play, Stop, Pause buttons on the top left (note: a very useful shortcut is to use the SPACE bar for Play/Stop). This way you can exactly locate the piece that you want to extract. Maybe repeat using the mark-and-zoom feature as described above, to focus on the region that you need (plus approx. one second before and after).


To normalize this piece (make sure everything is selected!), in the "Effect" menu, select "Normalize"

This brings up the "Normalize" window, in which you select the following - and press "OK".

Now that the volume level is set, it's time to do the fade-in and and fade-out, to ensure that the background noises come in (and late fade out) smoothly. You select approx. half a second before the relevant piece starts

and from he "Effect" menu select "Fade In"

and get this result:

To get a better fade-in, I would suggest to repeat this (for the same selection, do "Fade In" a second time)

Now, do the same for the "Fade Out" (appplied to approx. half a second after the end of the relevant piece)

To save the final clip, select the whole piece, from the beginning of the fade-in to the end of the fade-out piece.

In the "File" menu, select "Export Selection"

In the following "Export File" dialog you can set the filename, the file format ("MP3 Files") and, under "Options", the mp3 quality settings, e.g. like the following.

That's it. I hope this was helpful.

No comments: