Adding Support for almost All Video Formats/Codecs in Linux

Written by BinnyVA on September 13, 2008 – 12:25 am -


There is an over abundance of video formats right now – fortunately, our favorite OS, Linux, is capable of handling all of them. But some video formats are not supported ‘out-of-the-box’ – in such cases, we have to install the necessary codecs. This guide will show you how install the codecs for just about every video format under the sun.

Before going into the topic further, let me pacify the flamers in the audience. There are many codecs that include DRM and many are proprietary – and for this reason, many distros refuse to support them. But these can be supported using external software – whether or not to do that is a choice I leave to the readers. I am only handling the technical issue of installing the codecs here. The moral and ethical concerns have been handled by others better than me.

The Players – Video Trinity

There is no shortage of video players in linux. Among these, three players are more prominent than the others – these are Mplayer, Xine and VLC. I call them the Video Trinity. Before doing anything, install all three players. Yes, all of them.


Mplayer is perharps the most popular among linux video players. You can install it in a Red Hat/Fedora system using this command(the command for debian/ubuntu systems will be similar – can someone post it in the comments?)…

yum install mplayer mplayer-fonts mplayer-gui

If you are on a Debian based system – like Ubuntu, use this command…

apt-get install mplayer mplayer-fonts mplayer-skins


xine is a free multimedia player. It plays back CDs, DVDs, and VCDs. It also decodes multimedia files like AVI, MOV, WMV, and MP3 from local disk drives, and displays multimedia streamed over the Internet. It interprets many of the most common multimedia formats available – and some of the most uncommon formats, too. Installing xine is just as easy…

yum install xine xine-lib xine-skins xine-lib-extras-nonfree 

Again, on a Debian/Ubuntu system, use the command…

apt-get install xine-ui


VLC media player is a highly portable multimedia player for various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, mp3, ogg, …) as well as DVDs, VCDs, and various streaming protocols. VLC is popular in the windows crowd as well. Here is the command to install it…

yum install vlc

Debain/Ubuntu uses should use the command…

apt-get install vlc

With these 3 players installed, you must be able to open 90% of the video files out there. But for the more exotic video formats, we must install the extra codecs provided by mplayer. First install the codes available in your distro’s repository – in Fedora(with Livna repository) the command I used is…

yum install gstreamer libdvdcss gstreamer-plugins-ugly audacious-plugins-nonfree-mp3 kdemultimedia-extras-nonfree ...

Or in Debian/Ubuntu system

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

Essential Video Codecs

The binary codec packages provided by mplayer adds support for codecs that are not yet supported natively, like newer RealVideo variants and a lot of rare formats. Note that they are not necessary to play most common formats like DVDs, MPEG-1/2/4, etc. Take a look at the codec status table for the list of currently supported codecs in Mplayer.

Instructions for installing binary codecs can be found in the README or in the README.txt file that accompanies each codec package. Detailed usage instructions are in the codecs section of the documentation. A brief overview of the installation procedure is given below...

Installing the Codecs

First, download the codecs package that matches your system. In most cases, that is Linux x86.

First, extract the file to a local directory. There should be 64 files(currently). Next, we have to copy this to the system's codecs folder(usually /usr/local/lib/codecs/). To do this, you must have root user privileges...

sudo cp -R essential-20071007/ /usr/local/lib/codecs/

Voila - we have installed the codecs. But we are not done yet. Some players look for the codecs in other folders - to accommodate those players, we have to link the other folders to the central codecs directory. To do that, run these commands(as root)...

ln -s /usr/local/lib/codecs/ /usr/lib/codecs
ln -s /usr/local/lib/codecs/ /usr/lib/win32
ln -s /usr/local/lib/codecs/ /usr/local/lib/win32

Playing the Video

Now open up the video you are trying to play in any video player(say mplayer) - in 99% of the cases, it will play without any issues. In the unlikely event of a problem, open up the same video in xine. If it still does not play, go to vlc. Your video will be working in atleast one of these three players.

Did it work for you - let me know in the comments...

Tags: , , , , , ,
Posted in Configuration, Troubleshooting, Video | 14 Comments »

Creating a Screencast in Linux

Written by BinnyVA on August 7, 2008 – 11:02 pm -

RecordMyDesktop is a tool to create screencasts in Linux easily. A screencast is a video capture of your desktop – a video equivalent of a screenshot.

Install RecordMyDesktop

You can install RecordMyDesktop in Red Hat/Fedora systems using the command…

yum install recordmydesktop

For debian/ubuntu systems, I am guessing that the package name does not change(can anyone confirm this?). The command in this case is…

apt-get install recordmydesktop

Creating a Screencast

First start the application – that’s in Menu > Multimedia > gtk-recordMyDesktop.

There will be a small image of your desktop inside this application – drag a rectangle inside this preview area to select the record area. Once the selection is made, there will be a bigger rectangle on your screen highlighting the record area. Only the space within this area will be captured.

Now press the Record button to begin your recording. You will notice that you have a new icon in the system bar – something like this…

When this icon is a gray square, that means its recording. You can end the recording by left clicking on this icon. This show a new window that will show the status of encoding of the captured video. Depending on the size and length of the captured video (and your processor speed), this might take a long time.

Once this process is completed, you will be shown the main window once again. Now click on the ‘Save As’ button to save the file as a ogg Theora video file.

That’s it – you have created your first linux screencast! Congratulations!

Feel free to play around in the application – and make some screencasts. One you have done that, upload it to youtube – and post the URL in the comments.

A Screencast

Here is my first screencast. A screencast that shows you how to create a screencast using recordMyDesktop. The background music is ‘Recursion’ by Michael David Crawford – I thought it was appropriate.


Tags: , , , ,
Posted in Applications, Uncategorized, Video | 4 Comments »