config-mplayer

config-mplayer is a small GUI program for customising your mplayer configuration. It is NOT a wrapper or GUI version of mplayer. It's only business is showing some configuration options and rewriting the mplayer config whenever you change them. The idea is that you can customise it with YOUR desired configuration options just by editing a few files.

I commonly use it for:

  • Switching my audio output between rooms (devices).
  • Changing the DISPLAY which mplayer will play on - for playing on my main desktop, my TV, or within VNC (and in the case of VNC - selecting the SDL driver which actually works over VNC).
  • Switching the video to use X11 so that I can take a screenshot.
  • Changing the aspect ratio of a video when the file is incorrect.
  • Toggling the 'eq2' filter on when I start a second instance of mplayer and the first instance has got the overlay brightness control.
  • Starting in fullscreen
  • Cropping the black borders off of a PAL video within a wide format stream.
and things I do less often but want to be able to do without any bother:
  • Adding a volume filter for low or high volume video files.
  • Toggling deinterlacing.
  • Forcing the OSD on or off.
  • Forcing the index of a dodgy file to be rebuilt.
  • Switching to using a different XV port when the main one decides to stop working and just stays blue (very rare these days).
  • Selecting an MPEG-TS transport stream pid.
  • Adjusting subtitle position

As an example, I can select from various audio output configurations by checking a checkbox. If you look at the screenshot you will see I have a checkbox for 'office' and 'lounge' and 'headphones' etc. Each checkbox corresponds to a file on disk which contains just the specific mplayer configuration for that option.

The configuration it shows is customisable to your hearts content.
Basically you create subdirectories within ~/.mplayer-configs for each configuration item you want (you can download my setup as a sample below).

Each folder within the ~/.mplayer-configs has the files within it turned into radio buttons.

Each file directly within ~/.mplayer-configs is turned into a checkbox.

This is what the audio section looks like:

And this is the folder it is generated from:

.mplayer-configs/01_audio
.mplayer-configs/01_audio/none
.mplayer-configs/01_audio/98_dmix-mobo
.mplayer-configs/01_audio/10_lounge
.mplayer-configs/01_audio/30_lounge-dmix
.mplayer-configs/01_audio/99_headphones
.mplayer-configs/01_audio/70_surround
.mplayer-configs/01_audio/01_office
The numbering in the filenames is just to force a particular order. Any initial number followed by an underscore is stripped from the displayed button name.

Now if we look at a the contents of a couple of those files:

: ~ $; more /home/frob/.mplayer-configs/01_audio/*
::::::::::::::
/home/frob/.mplayer-configs/01_audio/01_office
::::::::::::::
=ao=alsa:device=hw=0.0
::::::::::::::
/home/frob/.mplayer-configs/01_audio/10_lounge
::::::::::::::
=ao=alsa:device=yamaha

::::::::::::::
/home/frob/.mplayer-configs/01_audio/30_lounge-dmix
::::::::::::::
=ao=alsa:device=yamaha-dmix
::::::::::::::
/home/frob/.mplayer-configs/01_audio/70_surround
::::::::::::::
=ao=alsa:device=surround51
::::::::::::::
/home/frob/.mplayer-configs/01_audio/98_dmix-mobo
::::::::::::::
=ao=alsa:device=dmix0
::::::::::::::
/home/frob/.mplayer-configs/01_audio/99_headphones
::::::::::::::
=ao=alsa:device=hw=1.0
::::::::::::::
/home/frob/.mplayer-configs/01_audio/none
::::::::::::::
=ao=null

The only difference in the configuration format from the standard mplayer configuration is that a line should start with an '=' or a '+'. If it starts with '=', that option is set to that value. If it starts with a '+', that option is merged with any others of the same option and appended as a list. This is so that you can for example specify multiple vf= parameters in separate config files and they will be merged to produce the final vf config value.

Another example is the section I use for fixing the aspects of a video while watching it on my widescreen JVC tv (Lots of videos are encoded with the wrong aspect and need to be corrected. The config panel allows me to adjust the aspect to one of a bunch of likely suspects and then stick with the one that looks best. The weird aspect values in the file are because my TV is widescreen but the TV-out mode I use is 4/3. ).

Here is the configuration file contents: Note that the configuration file for 'no' is empty - so I can simply disable the whole section.


: ~ $; find /home/frob/.mplayer-configs/*JVC*

.mplayer-configs/20_output_to_JVC
.mplayer-configs/20_output_to_JVC/2_16:9
.mplayer-configs/20_output_to_JVC/0_no
.mplayer-configs/20_output_to_JVC/3_1.85
.mplayer-configs/20_output_to_JVC/5_2.67
.mplayer-configs/20_output_to_JVC/4_2.35
.mplayer-configs/20_output_to_JVC/1_4:3


: ~ $; more .mplayer-configs/*JVC*/*
::::::::::::::
.mplayer-configs/20_output_to_JVC/0_no
::::::::::::::
::::::::::::::
.mplayer-configs/20_output_to_JVC/1_4:3
::::::::::::::
=aspect=4/3
=nokeepaspect=1
=display=:0.1
=fs=1
::::::::::::::
.mplayer-configs/20_output_to_JVC/2_16:9
::::::::::::::
=aspect=4/3
=nokeepaspect=1
=display=:0.1
=fs=1
::::::::::::::
.mplayer-configs/20_output_to_JVC/3_1.85
::::::::::::::
=aspect=1.391
=nokeepaspect=1
=display=:0.1
=fs=1
::::::::::::::
.mplayer-configs/20_output_to_JVC/4_2.35
::::::::::::::
=aspect=1.765
=nokeepaspect=1
=display=:0.1
=fs=1
::::::::::::::
.mplayer-configs/20_output_to_JVC/5_2.67
::::::::::::::
=aspect=2.0
=nokeepaspect=1
=display=:0.1
=fs=1

As you can see from those config files, I always use fullscreen (fs=1) when outputting to my JVC TV, and it is on display :0.1.
My

Requirements

You will need to have GTK version 2.xxx installed, as well as the perl GTK2 bindings (perl-gtk2 or gtk2-perl depending on your system). You don't need any GNOME rubbish installed.

License

GPL version 2

Downloads

Software downloads are released under the GNU GPL. All downloads and related files are released "as is" and their use is entirely at your own risk.

Screenshots

see above

My thanks to...

mplayer of course!

The GTK developers.

The developers of the GTK perl bindings.

Open source / free software developers everywhere.

Files

I havent got a download for it yet since I realised that it uses another library of my perl code which I am going to create a page for soon.

sample config directory (tarball)