Handbrake and protected DVDs

Ripping DVDs is a thing of the past, but occasionally I still need to do it. However, it happens so rarely that evertime I have either a new computer or a new Linux distribution and I need to install the necessary software. This time I am on Ubuntu 16.04. I usually use Handbrake and it is very comfortable, but handbrake sometimes fails to do the job. This time, I had to resort to MakeMKV. However MakeMKV only rips the video to an MKV container but it does not compress it. If you need the space reduction you should still push the file through a compressor.

Here's the whole chain of commands:

I only have an Apple USB-Superdrive. Apple doesn't want me to use it with any other computer but Macs. Therefore, in order to make it work under Linux, you needs to sens it a "Magic cookie" (see here: ):
sg_raw /dev/sr0 EA 00 00 00 00 00 01

If you have Handbrake installed from the default Ubuntu repository, you need to remove it (it's crippled and you want to be able to use it also with encrypted DVDs):
(sudo apt remove handbrake && sudo apt autoremove)

Install this version:
sudo add-apt-repository ppa:stebbins/handbrake-releases
sudo apt update
sudo apt install handbrake-gtk handbrake-cli

Install software to read encrypted DVDs:
sudo apt-get install libdvd-pkg
However, you have to execute some manual commands after the install is ready, but the installer instructs you during installation.

Select as source the TS_Audio folder on the DVD. If the scan never finishes or you do not see any tracks after the scan finishes, you might need something like MakeMKV. I didn't find any PPA or deb file, so I compiled it from source, which succeeded without any problems following the isntructions from here: http://www.makemkv.com/forum2/viewtopic.php?f=3&t=224. Here the short version:

wget http://www.makemkv.com/download/makemkv-bin-1.10.4.tar.gz
wget http://www.makemkv.com/download/makemkv-oss-1.10.4.tar.gz
tar -xvzf makemkv-bin-1.10.4.tar.gz
tar -xvzf makemkv-oss-1.10.4.tar.gz
cd makemkv-oss-1.10.4/
./configure
make
sudo make install
cd ../makemkv-bin-1.10.4/
make
sudo make install

The executable is /usr/bin/makemkv