O'Reilly logo

Ubuntu Hacks by Bill Childers, Kyle Rankin, Jonathan Oxer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #29. Watch Videos

While the default Totem video player in Ubuntu is great, it's hard to beat MPlayer in terms of flexibility, configurability, and features.

Every once in a while, a tool comes along in Linux that impresses you in almost every respect with its flexibility. MPlayer is one of those tools. When it comes to video and audio playback, think of MPlayer as your universal translator. It can play basically any audio or video format you throw at it (provided it has the libraries available), in just about any container you throw at it. For instance, it can play DVDs from the disc, an image of the disc, or even just the VOBs from the disc. Of course, depending on your taste, there is one downside: by default, MPlayer is a command-line program. There is a graphical frontend for MPlayer for those interested, called gmplayer, or you can just use the default Ubuntu video player, Totem. This hack discusses the basics of how to play multimedia files with MPlayer from the command line.

Install MPlayer

The first step to using MPlayer is to install it and the codecs it needs. If you haven't already followed the steps in "Install Multimedia Plug-ins" [Hack #28], do that first to get all of the codecs you'll need. Next, use your preferred packaging tool and install the mplayer package that matches your CPU architecture. If you use apt-get, type:

$ sudo apt-get install mplayer-
               
                  686
               

Replace 686 with 386, 586, k6, k7, g4, g5, etc., depending on your processor. To see a list of the different ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required