[Libav-user] Hardware decoding via libva

faeem faeem.ali at gmail.com
Fri Dec 21 23:50:16 CET 2012

Hi All ...

I currently use a media player based on ffplay.c, but have a problem 
where HD video playing on an Intel Atom processor is far too slow, and 
uses too much CPU time. My understanding is that the problem may be 
resolved by using direct hardware decoding via VAAPI/libva. I have 
tested VLC compiled with VAAPI support and there is a huge performance 
improvement when playing HD video. I'm trying to accomplish something 
similar with libav.

Would someone please direct me to documentation and/or some other 
explanation of how to perform hardware decoding using VAAPI/libva with 
ffmpeg's libav libraries. Code examples would be great. I have no 
interest in hardware encoding, only decoding. Unfortunately, several 
hours on Google have not yielded any positive results thus far; I'm 
probably looking in the wrong places. I have compiled ffmpeg/libav with 
VAAPI support. The ffplay.c code has a line that states:

  // FIXME use direct rendering

I need to know how to fix that FIXME.

Additional info:
- My media player is based on the 0.11.1 version of ffmpeg's ffplay.c
- My media player has been altered to link against the new 1.0 version 
of ffmpeg/libav. However my code is still derived from the ffplay.c 
included in ffmpeg 0.11.1.
- The main modification I've made is to render the video via OpenGL 
instead of using an overlay. This is a requirement for the project on 
which I'm working. The only other major modification is removing the 
features of ffplay.c I don't require, which is pretty much everything 
aside from the basic decode and render code.
- The code is being developed on Linux. The graphics cards being used 
are NVIDIA and Intel i9xxx.

Thanks in advance.


More information about the Libav-user mailing list