MPlayer/Framebuffer

Introduction
MPlayer (media-video/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. If you haven't, please see the links below for more information on how to set these up.

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 /etc/make.conf or specifically the flag for mplayer in /etc/portage/package.use depending on your preference. (See links below for information on setting flags via package.use or read man portage.)

Once you have set this USE flag, emerge mplayer. 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, 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 to your USE flags, and emerge mplayer.

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 is masked with missing keywords as of January 2006), you can use DirectFB instead. Setup your kernel to do framebuffer and then simply emerge mplayer with the flag set. Then you can enjoy your favorite movie with:

Configuring MPlayer
MPlayer has the ability, when using the -vo 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 .mplayer 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 mplayer -vo help.

To have mplayer cycle through specific vo options, add this line to ~/.mplayer/config:

List each video out option seperated 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: