Wednesday, 18 January 2012

How-to: Play Common Media Formats in Ubuntu

Ubuntu is a region-neutral distribution by default. That means it comes unencumbered with certain media codecs which are illegal in certain territories owing to their popularity with  piratical characters who use them for undesirable acts such as playing music and DVD's. Scandalous!

So any new install of Ubuntu will not be able to play MP3 files and DVD's without some remedial work on your part...



1. Install ‘Ubuntu Restricted Extras’ for additional codecs and plugins.
This is a marvellous meta-package now in the Ubuntu repositories by default (it wasn't always so). It's not illegal for the repositories to hold it for the legitimate use of users in those territories where it is legal to use them, so long as Canonical doesn't take responsibility for installing it by default and possibly falling foul of local laws.

This will install the audio mp3 (MPEG Layer 3) decoders required for playing your mp3 songs. Similarly you get the Adobe flash player for flash content such as YouTube Videos (until HTML 5 kills flash completely).

You can install the package  ubuntu-restricted-extras through Software Center or using a terminal command:

sudo apt-get install ubuntu-restricted-extras

2. Install the library/packages for playing commerical (encrypted) DVD’s

Commercial DVD's are usually encrypted with CSS (Content Scramble System). You will need to install libdvdcss2, which a free software library for unscrambling DVD's. Like the codecs above, there are territorial legal restrictions on the use of this decoder, so you need to install it yourself.

You can install though the Software Center or the terminal command

sudo apt-get install libdvdread4

You will also need to run a bit of script to correctly register the decoder.

sudo /usr/share/doc/libdvdread4/install-css.sh

It is likely you will need to restart your machine to the changes to take effect. RC