DVD rip on Linux Mint

2015/06/23

My old DVD player is not interacting well with my TV, but I still have a bunch of DVD’s that I occasionally want to watch.

Luckily my TV can connect to a NAS on the Ethernet and the TV is not picky about formats.

A long time ago I used programs like Mac the Ripper on my Mac to rip DVD’s, but since modern Macs ship without a DVD drive I found a way to do this on Linux Mint.

After finding and testing a bunch of programs for copying DVD’s to ISO files I realised that Brasero which is included in Linux Mint 17 is up for the job. As a matter of fact, Brasero “just works” and has a minimal GUI with few settings.

Update: It turns out that the dangerous dd command is just as fit for the job as Brasero. sudo dd if=/path/to/mounted/DVD of=/path/to/image.iso The DVD is typically mounted in a location like /dev/srX or /media/something.

The laptop on which I run Linux Mint is second hand and could not play (nor rip) the DVD’s I tried – probably due to a mismatch between the area codes of the drive and the DVD’s.

To remove the limitations of the area code I followed the advice found here:

Initially I tried to change the region of the DVD drive with regionset, but this did not work.

For ripping a DVD to a video file I use HandBrake. At first I had problems on Linux Mint which turned out to be due to the outdated version in the official repositories. To be specific, I had problems with ripping the ISO file – ripping directly from a DVD worked.

As explained on HandBrake’s webpage, the latest versions are available from custom repositories:

sudo add-apt-repository ppa:stebbins/handbrake-releases
sudo apt-get update
sudo apt-get install handbrake-cli
sudo apt-get install handbrake-gtk

Afterwards I was advised to run sudo apt-get autoremove

The Command Line HandBrake

HandBrake also works from the command line with the case sensitive name HandBrakeCLI. The version installed from the custom repository does not have a man page, but can be found here.

I use the CLI with

HandBrakeCLI --main-feature -Z "High Profile" -i INPUT.iso -o OUTPUT.mp4

To choose a specific title x replace --main-feature with -tx. An example where this is useful was when I ripped a DVD with a number of short movies (with the Minions from Despicable Me). Not all titles on the DVD are of interest though – the intro with the production company is for instance a title of its own. Running HandBrakeCLI -t0 -i INPUT.iso yields information about all titles. Often the duration of each title is sufficient to distinguish those of interest. To filter the output to wiew only titles and their duration, run the following in ZSH:

HandBrakeCLI -t0 -i ILLUMINATION_MINI_MOVIES_2014.iso |& grep -B 2 "duration" 

In other shells replace |& with e.g. 2>&1 |. This reveals that the movies of interest are the titles from 3 to 12.

A small shell script to encode each movie independently with Danish subtitles (as Danish audio tracks were not available) is

for i in {3..12}; do
    HandBrakeCLI \
    	--title $i \
    	--native-language Dansk \
    	--preset "High Profile" \
    	--input ILLUMINATION_MINI_MOVIES_2014.iso \
    	--output "Illumination/Minion $i.mp4"
done