[Libav-user] Hardware accelerated decoding

Lucas Soltic lucas.soltic at orange.fr
Wed Sep 4 21:04:02 CEST 2013


Le 4 sept. 2013 à 16:21, Kirill Gavrilov <gavr.mail at gmail.com> a écrit :

> 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.

On my side, when I had tried Apple's VDA, I don't remember it was too slow for real time decoding. Plus I didn't need to explicitly give the codec name for the hwaccel to be used (or at least that's what I guess because the CPU consumption was really lower).

What you say about the modifications required to use most hwaccel isn't a good news... and makes it really less interesting...

Is Apple's VDA the only hwaccel working that way?

> -----------------------------------------------
> 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/20130904/94798194/attachment.html>


More information about the Libav-user mailing list