Tuesday, June 21, 2011

Nvidia VDPAU and HD Video in Linux

   If you're using Linux and want to playback high definition video your best bet for decoding high bitrate H264 video has long been to use an Nvidia video card with VDPAU. A few months back I upgraded my desktop with a new hard drive and a clean 64 bit install of Ubuntu, but VDPAU was broken on my system and because of my 5 year old CPU I had difficulty playing back H264 videos without slowdowns. I finally got around to installing up to date packages for the Nvidia driver, VDPAU libs and SMplayer, which fixed the problem. Here's a quick overview of how to do that.

  
   I've been buying Nvidia graphics cards for years mainly because of their superior (compared to AMD/ATi and Intel) Linux driver support and performance. My GeForce 9800GT is an older card, but still supported by the proprietary Nvidia driver. All cards from the GeForce 8 series and up support VDPAU to offload HD video from the CPU onto the GPU.

   Try playing back a 1080p H264 video, like Sintel or Big Buck Bunny, using a player set to ouput to VDPAU. I like SMplayer a lot for its interface and great format support. If there's a lot of obvious frame-dropping, slowdowns, or your CPU monitor shows high system load, then something isn't working as it should. That's what my system was like on a new install.

   The first thing I did was grab the latest Nvidia drivers from the X Updates PPA. Follow the instructions to add the PPA to your system, then use your package manager (I use aptitude) to install the packages. I didn't install the updated Xorg packages, just the current Nvidia driver and its dependencies.

   Next I grabbed the latest SMplayer and Mplayer packages from another PPA. SMplayer was set to use multi-threading by default on my config, you'll want to disable that as well as post-processing and make sure the video output is set to VDPAU. Go to the Performance options and set H264 Loop Filter to skip on HD videos if playback isn't smooth enough.

   Now try playing back your high def video again. If you have top open in a terminal, or some other CPU monitor visible, you should see that there's very little increase in system load when playing back HD video using an Nvidia card that supports VDPAU once you've got a working setup.

No comments:

Post a Comment