Ubuntu / Linux news and application reviews.

Firstly, why should you use Mplayer with hardware accelerated video decoding? Check out this video (look at the CPU usage for the same video when played with and without vdpau) I've just recorded:


(Video available in HTML5 if you've enabled it on YouTube)



As you can see in the above video, using Mplayer without vdpau to play an HD video (H.264 - 720p used for this test), I had a 24-52% CPU usage while using Mplayer with vdpau, the CPU usage decreased to 0%! This may not be the case for everyone, but you should still see a huge improvement in playing HD videos.

In Ubuntu 10.10 Maverick Meerkat, you only have to install a few packages from the repositories to be able to use Mplayer with hardware acceleration - no compiling required.

To to take advantage of vdpau, you need an Nvidia graphics card which supports it (can't help you here, check your graphic card specifications and see if it supports hardware acceleration) and install the proprietary drivers.


If your Nvidia graphics card supports hardware acceleration, proceed to enabling vdpau for Mplayer in Ubuntu 10.10 Maverick Meerkat :

1. Firstly, install mplayer and other required packages:
sudo apt-get install mplayer libvdpau1

Then you may need to restart X (I'm not sure about this).


2. How to use:

Then, to try it out, use mplayer like this (for H264 encoded videos only):
mplayer -vo vdpau -vc ffh264vdpau yourvideo.mkv

If the video doesn't use H264 encoding, don't use "-vc ffh264vdpau".

3. Optional: You can use Gnome Mplayer or Smplayer as a Mplayer front-end. Install Gnome Mplayer using the following command:
sudo apt-get install gnome-mplayer

Then to set Gnome Mplayer to use hardware acceleration, in Gnome Mplayer go to Edit > Preferences, on the first tab (Player), under "Video output" select "vdpau".

Install Smplayer:
sudo apt-get install smplayer

Then under Options > Preferences > General, on the Video tab, select "vdpau" under "Output driver".


Both Gnome Mplayer and Smplayer have an option to pass arguments to mplayer. Here, you can also add the "-vc ffh264vdpau" option.



Update: I use an Nvidia graphics card and my instructions for other graphics cards were wrong (as J. H. pointed out in a comment) so I updated the post with Nvidia graphics card instructions only as I can only test it with Nvidia. If you use a different card, sorry, I am not aware on how to do this!