[Libav-user] Hardware accelerated decoding

Oleg mybrokenbeat at gmail.com
Thu Sep 5 12:53:46 CEST 2013


1. VDA is faster then CPU decoding in general. 
2. CPU usage of VDA API depends on your video-card. Old cards don't support full decoding acceleration and some job is still done by CPU. All cards have limitation on image size.
3. VDA decoded frames could be rendered without copying frame to RAM, using OpenGL. Anyway ffmpeg stores all frames in RAM, so h264_vda decoder copies each frame to RAM that's way h264_vda could be slower then classical h264 decoder.

04.09.2013, в 17:21, Kirill Gavrilov написал(а):

> Hi,
> On Wed, Sep 4, 2013 at 5:33 PM, Attila Sukosd <attila.sukosd at gmail.com> wrote:
> I've looked at OS X's VDA acceleration, but it seems as though you need to do some extra work in the application to support the different hwaccels, but I haven't found any nice examples on how to do it.
> Most accelerated decoders decode picture into API-specific surface in GPU memory, which can be drawn using OpenGL (VDPAU) or Direct3D (DXVA2) without extra copying it back to CPU memory.
> For this reason you need to do a lot of extra work to configure FFmpeg using specific hardware decoder (or detect when it can not be used), render result on the screen using more complicated scenarios.
> Because this stuff is really overcomplicated, painful and contradicts to implemented decoding+rendering pipeline - I haven't tried it in my application yet.
> VDA is somewhat simpler than most others because the original Apple API doesn't provide the way to render result directly and you should copy frame back to CPU memory anyway.
> Technically you should just try to open another decoder and use it instead of auto-detected one in avcodec_open2 (with extra checks and + probably overridden get_format2 if you like planar YUV420P):
> AVCodec* aCodecVda = avcodec_find_decoder_by_name ("h264_vda");
> avcodec_open2 (theCodecCtx, aCodecVda, NULL);
> I have tried this decoder on my old Macbook and it is significantly slower than software decoder.
> There is also patch in mail list which introduces similar decoder (automatic GPU->CPU memory copying) with DXVA2 acceleration.
> -----------------------------------------------
> Kirill Gavrilov,
> Software designer.
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130905/c9f7581f/attachment.html>

More information about the Libav-user mailing list