Using Ubuntu to Convert a DVD to an MP4 File

Use Handbrake to backup your DVDs on Ubuntu

This guide shows you how you can convert DVDs to MP4 file format in the Ubuntu/Linux operating system. This process is commonly known as ripping.

Hand inserting a disc into a laptop computer
LdF / E+ / Getty Images

Legal Considerations When Ripping DVDs

It is important that you know your local laws when it comes to copyrights. In many countries, you cannot legally convert DVDs to a digital format if the DVD has copyright protection. Not all DVDs, however, have copyright. For example, school plays and weddings are often filmed by a professional and distributed on a DVD. It is highly unlikely that there is anything stopping you from legally converting the content on the DVD to a digital format.

Set up Ubuntu and Install Handbrake

You will need to first install the following software before ripping a DVD:

  1. You can find Handbrake in the default Ubuntu repositories, but there's a decent chance that the package will be fairly outdated. Thankfully, the Handbrake developers maintain an official Ubuntu PPA.

    Begin by opening a terminal window and typing the following command to add the PPA to your system.

    sudo add-apt-repository ppa:stebbins/handbrake-releases
  2. Now, update your package database, and install Handbrake.

    sudo apt update
    sudo apt install handbrake-gtk

    This will install the video decoding software for converting DVDs to MP4.

  3. Next, type the following command at the terminal prompt to install the restricted extras package. This will install a collection of codecs:

    sudo apt install ubuntu-restricted-extras

    During the installation, a purple screen will appear with a license agreement. Press Tab to highlight the option to accept the agreement, and press Enter.

    OK button in Ubuntu
  4. Finally, install the libdvd-pkg to install a library that will let you play DVDs within Ubuntu by entering the following command:

    sudo apt install libdvd-pkg

    During the installation, you will be asked to accept an agreement. Press Tab to select the OK option and press Enter.

    OK button in Ubuntu
  5. At the end of the process, you may get a message saying you need to run another apt-get command to continue installing the package. If you get this message, type the following command:

    sudo dpkg-reconfigure libdvd-pkg
  6. Allow the installation to finish, and then run Handbrake either by pressing the super key to bring up the dash and searching for Handbrake or by running the following command in the terminal:

handbrake &
Ubuntu launch Handbrake

Select DVD Device and Set File Name and Format Settings

  1. After installing and launching Handbrake in Ubuntu, insert a DVD into your disc drive. In Handbrake, press Open Source in the top left corner of the screen.

    OpenSource button in Handbrake
  2. A new file browser will open. In the bottom left corner of the screen, you will see a drop-down menu called Detected DVD Devices. Select your DVD player from the list and, press OK. You can also select the DVD from the left side menu if it's appeared there. A scan will take place to import information about the DVD. 

  3. Select the Summary tab. Details for the DVD that you intend to rip along with settings are displayed. You can change the output format by selecting the Format drop-down menu and selecting your choice from the available options. The most common format is MP4, but MKV is also common.

    Summary tab in HandBrake
  4. In the Save As field, enter a name for the converted file, and set the location where you want to save the file.

    Save As field in HandBrake
  5. Under the source info and title select, use the Preset drop-down menu to pick your video's output format and resolution.

    Preset category in HandBrake
  6. You can also choose a preset for encoding the DVD in the best format for certain devices such as iPods and Android tablets. You can choose to encode the entire DVD or a range of chapters. You can also optimize the output for putting the final video on the web.

Picture and Video Settings

The Dimensions tab isn't particularly useful unless you want to crop the video's dimensions.

Dimensions tab in HandBrake

The Video tab lets you choose the video encoder and determine the quality of the final output. The encoders available include:

  • H.264
  • H.265
  • MPEG-4
  • MPEG-2

You can also choose between a constant and a variable framerate. In most situations, you will want to choose a constant framerate rather than a variable framerate.

Video tab in HandBrake

Other settings include the ability to choose the quality, choose a profile, and choose a level. The defaults suffice in most cases. However, if you are converting cartoons and you use the H.264 encoder, you will notice that there is a Tune option called Animation and this is probably better than the default option.

The best way to get the most out of Handbrake is with trial and error. These settings will work well for most DVDs, but you can try different settings to see what works for you.

Audio and Subtitle Settings

A DVD may be encoded in different languages. You can choose the languages you wish to use on the Audio Defaults tab. Select individual languages by pressing the Add button and the Remove icon to the right of the entry.

Add and Remove options in the Audio tab of HandBrake

By default, the AAC encoder is selected for ripping the audio from the DVD. It is worth adding a second encoder for MP3, in case the machine playing the ripped file isn't capable of playing AAC encoded files. 

The Subtitles tab lets you select the languages to use for subtitles. It works in the same way as the ​Audio tab. If you don't want subtitles, choose None as the selection behavior.

Tags for Your Video

The Chapters tab has a list of all the DVD's chapters. You can name each chapter to make it more memorable during playback.

The Tags tab lets you add information about the video, such as the title, the actors, the director, release date, a comment, genre, description, and details about the plot.

Tags tab in HandBrake

Start Ripping Your DVD

When you have finished adjusting the settings for your video, you can start the ripping process. Press Start at the top of the screen. The process can take a while depending on the length of the DVD you are encoding. When the process is completed, you can find the ripped video file in the location you chose for it.

Start button in HandBrake