Clearing brightness, contrast, saturation and hue from a previous mplayer session

This post was written by eli on November 18, 2010
Posted Under: Linux

Using mplayer, I was annoyed that mplayer remembered my brightness, contrast, hue and saturation settings, which I had tweaked with the keyboard controls the last time I used mplayer. I tried to find where it keeps that info, but didn’t find it anywhere.

Then it turned out, that mplayer changes these settings on the X display’s own attributes. Going “xvinfo” on command prompt soon revealed that my tweakings were remembered by the display itself.

I suppose there’s a reason why mplayer changes the display’s parameters rather than keeping this business to itself. Anyhow, it looks like I’m the only one who gets annoyed by this. Most complaints on the web are about these settings getting lost when a new clip is played. And sincerely, I don’t get it. Why would anyone want all videos played with a color tint from the moment one accidentally shifted the hue? Isn’t the whole point of  a command-line application that it runs exactly the same every time one executes it, regardless of what happened in the past?

Solution: xvattr. The Fedora guys must have thought its 23 kbyte of disk space are too much for the useless things it can do (why would anyone want to reset the settings with a command-line utility when you can do that with the Movie Player’s GUI?), so it has to be installed:

# yum install xvattr

and here’s my little script for clearing the relevant settings.

#!/bin/bash
{ xvattr -a XV_BRIGHTNESS -v 0 ;
  xvattr -a XV_CONTRAST -v 0 ;
  xvattr -a XV_SATURATION -v 0 ;
  xvattr -a XV_HUE -v 0 ; } > /dev/null

I chose to call this script “xvclear”, but that doesn’t matter much.

If anyone knows how to tell mplayer to reset these automagically, please comment below.

Reader Comments

I don’t know how to tell mplayer to reset them automatically, but your script sure was useful!

#1 
Written By Brandon Thomson on June 18th, 2011 @ 06:29

Thank you very much, this has been annoying me for ages! Your solution both explains it (I agree, it’s quite silly!), and solves it (THANK YOU!).

Craig

#2 
Written By Craig on October 15th, 2011 @ 12:11

Thanks a lot, saved my day…

#3 
Written By me on November 26th, 2011 @ 01:55

I was wondering about this for a long time. Thanks for the explanation and the solution!

#4 
Written By Krzysztof on August 29th, 2013 @ 17:07

{ echo brightness=0 ; echo contrast=0 ; echo hue=0 ; echo saturation=0 ; } > ~/.mplayer/config

#5 
Written By Matt W on October 28th, 2013 @ 03:37

Add a Comment

required, use real name
required, will not be published
optional, your blog address