Unable to play that 1080p video without lagging? Wanna watch that 720p video file on dated hardware? Well here’s something you can try. Basically the default behavior of most video players is such that they only hog a single core while doing video decoding. If we also commit all the other available cores to the task, well, we’ll of course expect to get better performance. You won’t get double or triple the performance of course – things don’t work out that simply. The difference is noticeable though.
This isn’t a new method. However, the old instructions don’t seem to work anymore – the ffmpeg-mt branch no longer seems to build with mplayer without non-trivial modifications. Fortunately, all the improvements in the ffmpeg-mt branch have recently been merged into the main release. So we can now use the main release instead.
- Grab the mplayer source:
svn co svn://svn.mplayerhq.hu/mplayer/trunk mplayer
- Grab the source for the latest ffmpeg release here. The version I tried is the latest one as of the writing of this post: 0.9.1. Simply download and extract the ffmpeg folder into the mplayer folder from the previous command.
- Now build mplayer:
cd mplayer
./configure
nice make -j 4 - And install it as ‘mplayer-mt’:
sudo install -m 755 mplayer /usr/bin/mplayer-mt
Now you can use mplayer-mt to play more performance-intensive videos and should perceive a noticeable improvement, assuming you have a multi-core processor. If you use a GUI frontend like smplayer, look for an option that lets you specify the mplayer executable, and replace it with mplayer-mt.
Unfortunately I have no idea if anything similar is possible with VLC. If you do, kindly let me know at the comments.
kurosu
Why not use mplayer2 and libav? Multi-threading is enabled there by default.
idyllic
ditto… you can even grab the binary from the mplayer2 website without compiling.
Jason "moofang"
hmmm wasnt aware of that. Thanks for the heads up.
dai1313
Yea, I was going to say… mplayer2 does that by default. XD
Jason "moofang"
hmmm, mplayer2 works pretty well, but I’m seeing visual artifacts and distortions that I’m not seeing on regular mplayer or mplayer-mt for some videos. Any ideas on what gives?
idyllic
10bit decoding on the mplayer2 binary (the one provided at the website) isn’t spectacular. You might need to compile from source or grab the precompiled from ur factory repo. ZOMG, the dial-up here is killing me… took 3 tries to post this >.<