I'm posting this HowTo since I think it is a great advancement in HD playback on Linux and people should be able to take advantage of it. I found out how to do this from the following post on doom9.org: http://forum.doom9.org/showthread.ph...45#post1221445
Overview: To use mplayer with multithreaded decoding abilities all you have to do is compile mplayer as per usual, but having replaced the normal ffmpeg source code (within the mplayer source code directory) with the ffmpeg-mt source code (http://gitorious.org/projects/ffmpeg/repos/ffmpeg-mt).
I'm going to use the following guide written by andrew.46 entitled [Howto] Successfully install the svn mplayer + gmplayer + all the codecs as the basis for my tutorial as it's very thorough and I feel there's no need to reinvent the spoon.
How to install:
1. Follow andrew.46's guide until you reach the point "Download and Compile the svn mplayer" (you can skip the step "Installing the amr libraries" if you don't need these, I skipped it)
2. When you reach the step "Download and Compile the svn mplayer" proceed as andrew.46 says with downloading the mplayer source code from SVN:
When this is done it's time to download the ffmpeg-mt source code. First you need git, install it with the following command:
$ cd $HOME
$ svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
Then download the source code for ffmpeg-mt using git:
sudo apt-get install git-core
In order to make use of the now downloaded ffmpeg-mt source code you need to replace the three following folders from the mplayer source directory with the folders from the ffmpeg-mt directory: "libavcodec", "libavformat" and "libavutil".
git clone http://git.gitorious.org/ffmpeg/ffmpeg-mt.git
Now you have the mplayer source code in which the ffmpeg source has been replaced with the ffmpeg-mt source. You should be ready to go.
cd mplayer #enter the directory where the mplayer source code is
rm -rf libavcodec libavformat libavutil #delete the three aforementioned folders
cp -a ../ffmpeg-mt/libavcodec . #copy the three folders from the ffmpeg-mt source dir to mplayers source dir
cp -a ../ffmpeg-mt/libavformat .
cp -a ../ffmpeg-mt/libavutil .
Now just follow the rest of andrew.46's guide starting from:
and mplayer should compile with no problems.
$ cd $HOME/mplayer
$ ./configure --enable-gui
$ sudo make install
$ make clean
Here are some benchmarks of mplayer with the normal single-threaded ffmpeg decoder compared to the multi-threaded ffmpeg decoder playing various 1080p H.264 video samples (using my Core2 Quad 2.83GHz CPU):
I hope you've enjoyed this guide, I basically just snatched the guides from the two aforementioned users and joined them, thanks goes out to them.
SINGLE-THREADED FPS MULTI-THREADED FPS PERCENT INCREASE IN FPS
The Dark Knight 37 121 329%
In Bruges 45 134 296%
(no -ss 120)
The Bank Job 46 141 305%
The Terminator 37 126 341%
(no -ss 120)
(MPLAYER ARGUMENTS: -vc ffh264 -lavdopts threads=4 -vo null -benchmark -frames 1000 -ss 120 -nosound)
Happy HD viewing