Ubuntu 安装 Mplayer with VA-API(Intel/AMD GPU硬件加速)


VA-API是一个开启硬件加速视频处理的开源library/API,它使用GPU加速视频处理从而减轻CPU负担.

支持硬件: Intel HD Graphics,G45芯片组(包括更新的),AMD Radeon GPUs.(另外还有一个支持VA-API的Nvidia VDPAU后端)

你可以在http://en.wikipedia.org/wiki/Video_Acceleration_API#Supported_hardware_and_drivers查看支持的硬件,驱动和视频解码.

原文作者样例:使用MPlayer without VA-API播放一个1080p H.264视频,CPU使用40-50%左右,而用MPlayer with VA-API的情况下,CPU只用了 2-5%.

在Ubuntu上安装Intel / AMD VA-API drivers

Intel GPUs ( Intel HD Graphics , G45 和之后的)

sudo apt-get install i965-va-driver
 
AMD Radeon GPUs(你需要安装proprietary drivers)
sudo apt-get install xvba-va-driver

Ubuntu安装MPlayer(VA-API支持)

Ubuntu官方源中的Mplayer不支持VA-API,
Ubuntu 12.10, 12.04 or 11.10用户可以通过下面的命令安装支持VA-API的Mplayer.
sudo add-apt-repository ppa:sander-vangrieken/vaapi 
sudo apt-get update 
sudo apt-get install mplayer-vaapi
Arch Linux用户可安装
https://www.archlinux.org/packages/community/i686/mplayer-vaapi/这个包.
mplayer-vaapi源码:http://gitorious.org/vaapi/mplayer
参考:http://www.webupd8.org/2012/11/install-mplayer-with-va-api-hardware.html
安装后打开你的播放器,如SMPlayer或其他MPlayer GUI,如Gnome Mplayer, KMPlayer,
打开Preferences,如 ( SMPlayer: General Video > Output driver) 
设置video output driver 为 "vaapi"

相关内容