Multimedia Dynamite

An overview of the awesome power and configurability of MPlayer.
The Command Subsystem

MPlayer has a very rich input command processing subsystem that can be manipulated with the keyboard, mouse, joystick or LIRC remote control. You also can customize several keyboard keys to invoke MPlayer's controls.

The following provides the list of keys that can be configured. The defaults are very sensible, and you may not need to change them:

$ mplayer -input keylist

You also can find MPlayer's controls for seeking, volume control, brightness correction and other things with the following command:

$ mplayer -input cmdlist

The slave.txt file that comes with MPlayer's documentation explains how to customize the input.conf and menu.conf files that come with the MPlayer package in your Linux distribution.

You also can have MPlayer accept input commands from a FIFO file (FIFO stands for First In, First Out). This comes in handy when it is reading the media from the standard input:

$ mkfifo /tmp/fifo
$ cat playlist.txt | mplayer -input 
 ↪file:/tmp/fifo -cache 8192 -playlist -

Typing the following mutes and executes it again with the audio unmuted:

$ echo 'mute' > /tmp/fifo

You can use the mouse for the usual seek operations. The mouse wheel is configured by default to seek files in both directions.

On-Screen Display

Apropos of input methods, MPlayer has excellent support for on-screen display (OSD). I normally use only the superb scalable TTF fonts. These are not available on the MPlayer Web site.

The following command displays a timer:

$ mplayer -osdlevel 3 -font 
 ↪/home/girish/.ttffonts/Comicbd.ttf video.avi

See Figure 2 for a sample of this display.

Figure 2. MPlayer with Basic OSD Support

You can create a custom menu to browse using the keyboard with the OSD facility. It even has a console where you can enter MPlayer slave commands.

Figure 3. MPlayer OSD Menu

Figure 4. MPlayer Built-in Console

Figure 5. MPlayer with OSD of Media File Information

As you can see, the scalability of the OSD fonts does not break with the video scale filter.

Here is how to create this kind of configuration. First, set up most everything in the config file. Here is my ~/.mplayer/config file:

# Write your default config options here!
# Use Matrox driver by default.
vo=sdl
font=/home/girish/.ttffonts/comicbd.ttf
vf=hue,eq,screenshot
#menu-startup=yes
menu=yes
subfont-autoscale=3
subfont-osd-scale=8
subfont-text-scale=8
subpos=50
spuaa=4
osdlevel=3
# I love doing headstand (Sirsasana) while watching videos.
#flip=yes
# Decode/encode multiple files from PNG,
# start with mf://filemask
mf=type=png:fps=25
# Eerie negative images are cool.
#vf=eq2=1.0:-0.8

The input configuration and menu configuration are stored separately in input.conf and menu.conf, respectively. The menu.conf file needs to have a section that looks something like this:


<cmdlist name="main" title="MPlayer OSD menu" ptr="<>" >
     <e name="Pause" ok="pause"/>
     <e name="Prev/Next" ok="pt_step 1" cancel="pt_step -1"/>
     <e name="Jump to ..." ok="set_menu jump_to"/>
     <e name="Open ..." ok="set_menu open_file"/>
     <e name="Open playlist ..." ok="set_menu open_list"/>
     <e name="Help" ok="set_menu man"/>
     <e name="Pref" ok="set_menu pref_main"/>
     <e name="Properties" ok="set_menu properties"/>
     <e name="Console" ok="set_menu console0"/>
     <e name="Quit" ok="quit"/>
</cmdlist>

You need this line in input.conf in order to tell MPlayer what event invokes the menu. The setting here invokes the menu if you click the left-mouse button:

MOUSE_BTN0 menu main

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

There is good support for

pumarex's picture

There is good support for audio effects

Alaçatı konaklama

alaçatı konaklama's picture

thank you for all

good content

mert2000's picture

thanks admin

hi. thanks for sharing

mini's picture

hi. thanks for sharing

new

emrah eren's picture

thanks admin

no

maxi's picture

thanks admin

hello

emrah eren's picture

thanks

hi. thanks for sharing. my

comet's picture

hi. thanks for sharing. my friend

is that true?

Anonymous's picture

see... mplayer can't fully display substation alpha subtitles, it messed up the whole karaoke effects

There is good support for

nihat hatipoglu's picture

There is good support for audio effects, and the karaoke effect especially gets interesting with certain songs.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState