Mplayer and Mencoder

From DreamHost

Jump to: navigation, search

Prerequisites

The instructions provided in this article or section are considered advanced.

You are expected to be knowledgeable in the UNIX shell.
Support for these instructions is not available from DreamHost tech support.
Server changes may cause this to break. Be prepared to troubleshoot this yourself if this happens.
We seriously aren't kidding about this. Read the blinky part again.

First you need to enable shell for your user if you haven't already. You can do this from Users -> Manage Users (or click here) by clicking "edit" under actions. Also you will want to learn how to use SSH if you don't know how to as well.

Manual installation of Mplayer/Mencoder

First you need to start off by creating the required directories and modifying your .bash_profile file:

Run the following commands:

mkdir ~/bin
mkdir ~/lib
mkdir ~/src
mkdir ~/tmp

Once that is out of the way you will want to edit a line in your .bash_profile for easy future executing. You can add the part after the echo command if you want to add this yourself using a text editor otherwise run this command:

echo "export PATH=$HOME/bin:$PATH" >> ~/.bash_profile

Next you will want to setup the /tmp directory to be in your home directory so it doesn't write anything into the public /tmp directory:

export TMPDIR=~/tmp

Next you will need to download the newest version of mplayer (which also contains mencoder. You can do this here:

http://www.mplayerhq.hu/design7/dload.html

Once you get the link you will want to right click and copy it to your clipbord and paste it after the wget command and cd'ing into your 'src' directory you created earlier. This will download the source code. The newest stable version at the time this wiki was created was 1.0rc1 so here is the commands I ran:

cd ~/src
wget http://www4.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc1.tar.bz2

Next you will need to extract the tar.bz file using tar xjvf filename, in this case Mplayer-1.0rc1.tar.bz2, so I ran the following command

tar xjvf MPlayer-1.0rc1.tar.bz2

This should give you a nice long list of files and it should take a while . Once it is done you will need to cd into the Mplayer directory and then run the configure script to setup the Makefiles (for compilation):

cd MPlayer-1.0rc1
./configure --prefix=/home/`whoami`

Be careful to copy/paste the configure line as those are backticks around 'whoami' not single quotes. Another option is to just replace `whoami` with your users actual username.

It might take a little while to run and you should be left at a screen that says which drivers/plugins were enabled/disabled, etc..

The next thing you will want to do is start the compile using the make command, just run:

make

Once that is done running (it will probably take quite a while you should see some output like this when it is doing the file step linking mencoder:

-o mencoder mencoder.o mp_msg-mencoder.o asxparser.o codec-cfg.o cpudetect.o edl.o find_sub.o m_config.o              
m_option.o m_struct.o parser-cfg.o playtree.o playtreeparser.o spudec.o sub_cc.o subreader.o vobsub.o  unrarlib.o 
libvo/aclib.o libvo/osd.o libvo/sub.o parser-mecmd.o xvid_vbr.o  libvo/font_load.o libvo/font_load_ft.o 
libmpcodecs/libmpencoders.a  libmpcodecs/libmpcodecs.a  libaf/libaf.a libmpdemux/libmpdemux.a stream/stream.a 
libswscale/libswscale.a osdep/libosdep.a -Wl,-z,noexecstack  -Llibmpdvdkit2 -lmpdvdkit  libavformat/libavformat.a  
libavcodec/libavcodec.a  libavutil/libavutil.a  libpostproc/libpostproc.a          -lpng -lz -lz -ljpeg        -lfaac -lncurses             
-lpthread -ldl   -lm    libfaad2/libfaad2.a  mp3lib/libMP3.a liba52/liba52.a libmpeg2/libmpeg2.a tremor/libvorbisidec.a 
-lfontconfig -lfreetype -lz
[servername]$

Once that step is complete you are now off to the final step to install it into your home directory, this is done by simply doing:

make install

You should see tons of lines go by where it is copying files and after it is done you will want to disconnect and reconnect via ssh and type 'mencoder' and you should get some output like this:

[servername]$ mencoder
MEncoder 1.0rc1-3.3.5 (C) 2000-2006 MPlayer Team
CPU: Dual Core AMD Opteron(tm) Processor 175 (Family: 15, Model: 35, Stepping: 2)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2

No file given

Exiting... (error parsing command line)

This means everything is successfull and you can just set the PATH to mencoder in your scripts to /home/username/bin/mencoder, just replace mencoder with 'mplayer' for mplayer.

Personal tools