Mplayer on Framebuffer

MPlayer is a media player for Linux that, given the correct decoders, can play virtually any video or audio file. While most people use MPlayer from X, which is the easiest way, it is possible to run MPlayer in the framebuffer. This guide assumes that you have already setup the framebuffer, ALSA and MPlayer.

Process
After you have actually setup the framebuffer, installing MPlayer is relatively simple. First, you need to set the USE flag. You can either do this in your or specifically the flag for mplayer in  depending on your preference.

Once you have set this USE flag, to make sure it is installed with the right use flags. Once it is finished emerging, use the following command to play your movie files

Now, depending on your setup, you may or or may not notice a problem here. First of all, your videos may not play at all. And, if they do, you may find that your videos are displaying at an incredibly small size, in which case, use the following command to fix this

SVGAlib
Using SVGAlib is probably the simplest way to get MPlayer to output to the framebuffer. The only drawback is that it loads an external module which needs to be recompiled each time you change or upgrade your kernel (similar to how the nvidia-kernel package works).

To use MPlayer with the SVGA library, first install SVGAlib and load the module.

Then, add svga to your USE flags, and emerge mplayer.

Or, you can test it first by emerging only mplayer with svgalib:

Once the module is loaded, and mplayer is compiled with the support, you can use svga as the -vo option.

DirectFB
As an alternative way to have things working, especially on amd64 (svgalib masked with missing keywords... - January 2006), you can do as follow. Setup your kernel to do framebuffer and then simply emerge mplayer in this way:

Then you can enjoy your favourite movie by issuing:

Configuring MPlayer
MPlayer has the ability, when using the argument, to loop through the options you pass it until it finds one that works. This comes in handy when you save those options to your mplayer configuration file, which will be saved in your home directory, under the directory.

As an example, assume that when running in X, MPlayer should use Xv as the vo device, but when running in console mode, it should use SVGA. You can see a list of your other video out options by running.

To have MPlayer cycle through specific vo options, add this line to

List each video out option separated by commmas. Now you won't need to pass -vo when running mplayer.

One thing worth noting, is that if neither Xv nor SVGA works, mplayer will still advance to its next vo option. If you compiled mplayer with support for GIF, PNG or JPEG, it will try these next, outputting your video to image files.

You can add "null" to the end of the vo list, which will always succeed, if you don't want it to output image files.

This example also uses X11 as a video out device if Xv doesn't work for some reason: