Results 1 to 10 of 62

Thread: HOWTO: Compiling mplayer with multi-core decoding support

Threaded View

  1. #1
    Join Date
    Apr 2007
    Ubuntu 13.04 Raring Ringtail

    HOWTO: Compiling mplayer with multi-core decoding support

    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

    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 (

    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:

    $ cd $HOME
    $ svn checkout svn:// mplayer
    When this is done it's time to download the ffmpeg-mt source code. First you need git, install it with the following command:

    sudo apt-get install git-core
    Then download the source code for ffmpeg-mt using git:

    git clone
    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".

    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 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.

    Now just follow the rest of andrew.46's guide starting from:

    $ cd $HOME/mplayer
    $ ./configure --enable-gui
    $ make
    $ sudo make install
    $ make clean
    and mplayer should compile with no problems.

    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):

    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)
    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.

    Happy HD viewing
    Last edited by runesvend; February 10th, 2009 at 04:34 PM. Reason: I had forgotten to link to andrew.46's guide

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts