46

How to install all possible media codecs from console?

Is there a way to load and save them for some cases without Internet connection?

Thanks in Advance!

Jorge Castro
  • 71,754

4 Answers4

48

UPDATE: 2017-Jan

For Ubuntu 16.04 LTS and 16.10 (12.04 or later)

update the repos:

sudo apt-get update

install CURL tool

sudo apt-get install curl

load VideoLAN repository

curl https://download.videolan.org/pub/debian/videolan-apt.asc | sudo apt-key add -
echo "deb https://download.videolan.org/pub/debian/stable ./" | sudo tee /etc/apt/sources.list.d/libdvdcss.list
sudo apt-get update

install VLC and Mplayer, and their support elements

sudo apt-get install vlc vlc-data browser-plugin-vlc mplayer2

If still using 14.04 LTS (or earlier), then:

sudo apt-get install vlc-plugin-pulse

install remaining Ubuntu 'restricted extras' (146 MB when installed, skip if space is critical)

sudo apt-get install ubuntu-restricted-extras

If you are NOT already using 16.04 LTS (or later), force (manually) install the three key elements for full DVD support:

sudo apt-get install libdvdcss2 libdvdnav4 libdvdread4
Nacht
  • 476
david6
  • 14,499
  • didn't get. for what we adding medibuntu rep? to get wide codecs range? – skater_nex Aug 02 '12 at 07:56
  • 1
    ubuntu did'nt include some codec's due to licence issues , mediaubuntu team packed such codecs – Tachyons Aug 02 '12 at 08:01
  • 1
    see: http://medibuntu.org/ "Medibuntu is a packaging project dedicated to distributing software that cannot be included in Ubuntu for various reasons, related to geographical variations in legislation regarding intellectual property, security and other issues:" – david6 Aug 02 '12 at 08:02
  • 1
    This answer could need an update (for Ubuntu 16.04). E: Package 'vlc-plugin-pulse' has no installation candidate and sudo: /usr/share/doc/libdvdread4/install-css.sh: command not found – MERose Jan 24 '17 at 18:00
  • Package 'vlc-plugin-pulse' in now included (as of 2015-11-17) in vlc main. See: https://launchpad.net/ubuntu/xenial/arm64/vlc-plugin-pulse – david6 Jan 25 '17 at 03:59
  • probably we should use https://download.videolan.org/pub/debian/videolan-apt.asc instead of that unencrypted key? – Nacht Feb 08 '19 at 02:29
9

Yep, I had this problem when I switched to Ubuntu a year ago lol. I only know how to install them. I then made a mirror of my Linux installation as it's a bit more complex than using just the Ubuntu Desktop. I use a Server Thin Client Environment.

Anyway the command to install codecs you need is

sudo apt-get install gstreamer0.10-ffmpeg gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad gstreamer0.10-bad-multiverse

You may want to check if there is a later version of gstreamer available. The last one worked well for me and all my videos played so I stuck to this version (0.10)

I'm sure there is a way to save it too but hopefully someone will answer your the second part of your question here

7

To install all the *default media codecs for Ubuntu, run this command in the **terminal:

sudo apt-get install ubuntu-restricted-extras

You will then be asked for your password (your password will NOT show up in the terminal, but I promise you it is there)

Press [Enter]

When prompted, press [Enter] (again)

Once the process is complete, you're good to go!

*Generally you have a choice to download and install them during initial instillation, but you can always install them this way as well after the fact

**To open the terminal, right click on any empty workspace, and select "Open Terminal"

5

Install the ubuntu-restricted-extras for most of the codecs. To install it, click on the below image: Install via the software center

Install and run aptoncd Install aptoncd to backup all the packages you have downloaded; you can reuse them using aptoncd in any computer.

  • I really need all the codecs. How Can I obtain rare ones? – skater_nex Aug 02 '12 at 04:34
  • i think all the codecs would come with restricted extras, still you can search in the "software centre" for any other codecs left to be installed. if you are a music professional , you can install "ubuntustudio desktop" it will fetch all the required packages for art-music professionals. – techvish81 Aug 02 '12 at 05:34