Search:  
Gentoo Wiki

MPlayer/Framebuffer

Contents

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 fbcon. 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

mplayer file.avi

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

mplayer -vo fbdev -vf scale=1280:1024 FileName.mpg

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.

emerge svgalib
modprobe svgalib_helper

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

emerge mplayer

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

USE="svga" emerge mplayer

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

mplayer file.avi -vo svga

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:

USE="directfb" emerge mplayer

Then you can enjoy your favourite movie by issuing:

mplayer -vo directfb video.mpeg

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

vo=xv,svga

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:

vo=xv,x11,svga,null

See also

Here are some links that you may need:

Retrieved from "http://www.gentoo-wiki.info/MPlayer/Framebuffer"

Last modified: Sat, 20 Sep 2008 07:10:00 +0000 Hits: 42,939