[Libav-user] Hardware Accelerated Decoding

Safi ud Din Khan safiuddinkhan at gmail.com
Fri Nov 29 13:04:56 CET 2013

Hello i am interested in doing hardware accelerated decoding for my 
ffmpeg based multimedia program using VA API .... i am kind of a 
beginner and does not understand very well as how VAAPI interacts with 
ffmpeg libraries .... what i have seen from the source code of ffmpeg is 
that some parts of VAAPI (decoding parts) are already implemented inside 
ffmpeg source code (libavcodec/vaapi.c and others) ......

what i am confused is as how should i activate the VAAPI acceleration 
while processing my video via libav* libraries .

filling up vaapi_context as suggested in api documentation and then 
putting vaapi_context into AVCodecContext::hwaccel_context does nothing 
... and AVCodecContext::hwaccel is also empty ....

as what i have observed from the source code is that libav* libraries 
set hwaccel after it recognizes the hardware accelerated decoder using 
inside setup_hwaccel_for_pixfmt 
<mpeg12dec_8c.html#a5340d7538dc153223eb4fed064c19423>() function. 
ff_find_hwaccel() compares both codec id and pixelformat to detect which 
hardware accelerator to load ... ff_find_hwaccel() searches for codec id 
and pixelfromat described in AVCodecContext to find out what harware 
accelerator to use . in case for mpeg2 codec ff_find_hwaccel() searches 
for codec id of mpeg2 and pixelformat " /PIX_FMT_VAAPI_VLD" /inside 
AVCodecContext . ff_find_hwaccel() is successful in finding the mpeg2 
codec id inside AVCodecContext structure returned from AVFormatContext
  but it fails to find the "PIX_FMT_VAAPI_VLD" and does not activate the 
hardware acceleration ....

what i need to know is what should i do to activate the VAAPI hardware 
acceleration , a simple example would be helpful , and please also don't 
prescribe me to see splited deskop examples
or look at the code of VLC play and MPlayer .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20131129/945197ba/attachment.html>

More information about the Libav-user mailing list