Installing mplayer/mencoder from source is pretty easy following the basic instructions on the mplayer web site:
download: http://www.mplayerhq.hu/design7/dload.html
install: http://www.mplayerhq.hu/DOCS/README
To summarize, this is what I did:
Check out the mplayer trunk:
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
Go into the newly created sandbox and configure. You can specify your installation destination prefix as I do in this example, or let it use the default /usr/local:
cd mplayer
./configure --prefix=/my/apps
When you run the configure command, you may discover a few dependencies that need to be installed first. In my case, I needed the yasm package and the git package. You may need other development tools. git was needed because the configure script uses it to automatically download and compile ffmpeg. There is probably a way to specify using an existing ffmpeg installation instead of downloading a new one, but I did not look into that. The configure options also give you a lot of control over what codecs to include. When configure completes, it will summarize what codec support will be compiled in. You may need to install other libraries and/or add some configure options to get the codecs you want included (like x264).
After configure succeeds and you are happy with the codec support, then you can compile and install:
make
make install
Then adjust your PATH where necessary if you installed in a non-standard location.