Sunday, December 29, 2013

Compiling a custom mplayer-mt

The full HD format becomes more and more popular today. Decoding of high definition video requires a modern hardware but even with fast processors it's not enough to use one core for smooth playback of dynamic scenes. Proprietary decoders are used under Windows for a long time but open-source decoders under Linux are known as unstable. Nevertheless you shouldn't afraid of this word. In the Linux world "unstable" often means "not enough tested". This is true for ffmpeg-mt branch of ffmpeg project with experimental multithread decoding support.

Recently I compiled mplayer with ffmpeg-mt and was very pleased by result. Player is able to decode all my 1080p films correctly and without any glitches. Now I share the mplayer-mt.ebuild package for Gentoo users and also supply instructions for manual build.

First of all we must integrate ffmpeg-mt into mplayer. Take latest versions from repositories:

#  svn checkout svn:// mplayer
#  git clone git://

Replace directories libavcodec, libavformat and libavutil in mplayer by new ones from ffmpeg-mt. Please note, that the latest version of mplayer could be non-compatible with current ffmpeg-mt. If you want to create an archive then you probably want to remove service folders of version control system that take away almost a half of all space:

#  find . -name '.svn' | xargs rm -r

If you have no direct access to repositories (closed ports, etc.), you care about traffic and time or you're just a little bit lazy then you can download archive from this site. Compile and install it as usual:

#  ./configure && make && make install

To enable parallel decoding use the following options:

#  mplayer-mt -lavdopts threads=N file.mkv

where N is the number of threads.

No comments:

Post a Comment