How can I enable video and audio codecs?

I would like to know how can I enable video and audio codecs not included by default on Ubuntu. Thanks!


Install this package via the command line:

sudo apt-get install ubuntu-restricted-extras

Installing this package will allow you to play MP3 files, and to decode various audio formats such as LAME. It will also allow you to use Microsoft fonts, install the Java Runtime Environment, Adobe Flash, and play DVDs.

Additional reading: Restricted Formats, and Medibuntu.


Run the following in the terminal:

sudo apt-get install ubuntu-restricted-extras


To play encrypted DVDs, you must install libdvdread4, which is a codec allowing you to play them.

  • Run this command in a terminal:

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


If you want only free & open-source software, then without enabling Multiverse repository, you can install following packages which are available on Universe repository:-

sudo apt-get install gstreamer1.0-fluendo-mp3 gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav

In which gstreamer1.0-fluendo-mp3 provides decoding of MPEG 1 audio layer III streams, gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly are the gstreamer plugins and gstreamer1.0-libav1 supports a large number of audio and video compression formats through the use of the libav library.