
Due to copyrights, Ubuntu (currently Hardy Heron 8.04) is distributed without codecs to play many of the most prevalent media formats including DVD video (unencrypted and encrypted), Flash (.swf and .flv extensions), QuickTime movies (.mov ), MP3s (.mp3), Windows Media Audio and Video (.wma and .wmv), and unencrypted ACC files (.acc, .mp4, and .m4a). Luckily, these codecs are easy to install. This guide shows you how.
Step 1: Add Medibuntu to Your Repository List
Several of the codecs installed below are not in the default Ubuntu repositories. They are instead in the Medibuntu repository. Open a terminal and use the wget http file retrieval program to add a path to the Medibuntu repositories to your system source list. (Note that the command below has wrapped to a second line, but it is a single command and should be typed without any carriage returns.)
/etc/apt/sources.list.d/medibuntu.list
This command writes the path to the Medibuntu repository to a file called medibuntu.list in the appropriate directory.
Next you have to install Medibuntu’s GPG key to ensure proper authentication.
When prompted, type “Yes” to complete the package installation. Finally, update the list of repositories available to the aptitude package management program on your system.
Step 2: Install Flash Plugins for Firefox
To start viewing YouTube videos with Ubuntu, you have to install the Flash browser plugin. The following command should do the trick.
I know this installs the plugin for Firefox. If you determine that this command works for other browsers as well, please leave a comment below.
Step 3: Installing Audio and Video Codecs
You can get most audio and video file formats working by installing a single package from the Medibuntu repository. If you are using a machine with a 32 bit processor, type the following command in the terminal.
If you have a 64 bit processor, replace w32codecs with w64codecs. If you have a PowerPC based machine I believe the appropriate package is ppc-codecs. If you install this codec and still do not hear sound when playing media files, make sure that your speakers are not muted. I discovered that by default my machine had sound muted. You can easily change volume levels by right clicking on the speaker icon in the status bar at the top of the screen.
Step 4: Installing DVD Playback Packages
The following command installs packages needed for DVD playback and DVD menu navigation functionality.
However, before most DVDs will play, you need to set the region code of you DVD drive. Install the regionset package.
Next, put a DVD encoded for your region in the DVD drive and type the following at the command prompt replacing the XXXXX with your DVD drive’s device name. (Mine is cdrom1 and yours is probably something with a similar prefix but possibly a different trailing number. All of your devices are listed in the /dev directory. If you type the wrong device name the regionset command will fail to compete and you can just try again.)
When prompted enter your region code number (The United States and Canada are region 1).
Step 5: Installing DVD Playback Programs
Ubuntu is distributed with Totem for viewing video, but Totem is very bad at playing DVDs. For example, Totem does not include support for DVD menus. Two alternative programs are Xine and the related Totex-Xine. I prefer Xine but it is a little more difficult to configure (more options) than Totem-Xine. I recommend installing and trying them both. The following command will install Xine with some supporting codecs.
To run Xine type xine at the command prompt or navigate to Applications > Sound & Video > xine. The following command will install Totem-Xine and a Totem-Xine Firefox plugin.
After these packages finish installing, type totem-xine at the command prompt to run the program. That about does it. Enjoy listening and viewing your favorite media on Ubuntu. If you know of packages that I omitted from this guide but would enhance the Ubuntu user experience, please leave a comment below. For more Ubuntu tips check out the related posts linked to below.

Add New Comment
Viewing 8 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks
(Trackback URL)
May 31, 2008 at 8:31 am
[...] repository has been added to your system’s source list as per “Step 1″ of this post. If these packages ...
July 14, 2008 at 7:01 pm
[...] How to Install Media Codecs for Flash, DVD, QuickTime (MOV), MP3, WMV, WMA, and ACC (MP4, M4A) Playb... - ...