[FFmpeg-devel] hwaccel infrastructure in libavcodec

Gregor Riepl onitake
Wed Mar 16 05:04:25 CET 2011

Drawing attention away from the recent happenings (I noticed only after
the switch to the new list domain today), I want to address a topic that
has been bothering me for a while.

Over the last 12 months or so, the support for hardware accelerated
video in PC platforms has improved considerably. Apple released VDA[1],
AMD has finally opened up XvBA to the public[2].

Having tried (and given up for now) to integrate VDA support into
MPlayer and libavcodec, I'm coming forth to ask for some help improving
the hwaccel parts of ffmpeg. This would facilitate integrating the
various APIs (notably DXVA, VDPAU, vaapi, XvBA, VDA, XvMC and
Openchrome) into existing video players that already rely on libavcodec
for video decoding.

There are other options, for example improving vaapi support, so
decoders that are accessible through this API can be easily made
compatible. This has the disadvantage that it would only work on Linux
and similar platforms, where vaapi is currently available.

As for now, I have a basic understanding on how to use VDA and how XvBA
and VDPAU work. I have started working on a VDA patch for ffmpeg on my
own, but hit three major showstoppers. One of them is a specific quirk
of VDA, requiring a valid avcC block for initialization (which is not
available from every container format I believe). The second is
uncertainty about what can/should be put into the hwaccel module, and
what should be done in the media player software that uses libavcodec.
The third is the requirement of frame reordering due to hardware
accelerator libraries generally feeding decoded frames in DTS order
instead of PTS order.

Is someone interested in this? Is there already some work under way?
Should I stop bothering about using libavcodec for hardware acceleration
and implement everything directly in a media player?

[1] http://developer.apple.com/library/mac/#technotes/tn2267/_index.html
[2] http://developer.amd.com/ZONES/OPENSOURCE/Pages/default.aspx (scroll
to the bottom)

More information about the ffmpeg-devel mailing list