[Libav-user] vaapi h.264 decoding with libav

Nikita Orlov nikitos1550 at yandex.ru
Wed Apr 1 07:16:51 CEST 2015


Hello!

Thanks, I will try it.
But, how to do such thing from c/c++ using libav? 

I have found some instructions in the internet, but they are not clear.

One:

AVHWAccel *ff_find_hwaccel(enum CodecID codec_id, enum PixelFormat pix_fmt)
{
    AVHWAccel *hwaccel=NULL;

    while((hwaccel= av_hwaccel_next(hwaccel))){
        if (   hwaccel->id      == codec_id
            && hwaccel->pix_fmt == pix_fmt)
            return hwaccel;
    }
    return NULL;
}

I really don`t understand what to do with AVHWAccel...

Second 
find_codec_by_name and set name to h264_vaapi, but people say it doesn`t work.

P.S. I forgot to say, I use linux OS,

01.04.2015, 03:55, "Xiang, Haihao" <haihao.xiang at intel.com>:
> You should use a player with VAAPI enabled.
>
> e.g.  MPV + ffmpeg/libav
>
> $> mpv --hwdec=vaapi --vo=vaapi <video file>
>
> You will see the message of 'Trying to use hardware decoding' in the log
> and CPU usage drop a lot if using VAAPI.
>
> Thanks
> Haihao
>>  Hello!
>>
>>  I am using ffmpeg/libav 2.5.3 on Haswell 4770 (HD 4600).
>>  I am using libav for decoding h.264 video stream.
>>  My ffmpeg build supports vaapi hardware decoder.
>>
>>  ...
>>  AVCodec *pCodec = FindDecoder(AV_CODEC_ID_H264);
>>  ...
>>
>>  How to check am I using hardware decoder or not?
>>
>>  P.S.
>>  I have several ffmpeg builds with vaapi and without, But don`t see any difference in performance. Maybe cpu is very powerfull?
>>  I am decoding two separate 1080p yuv420 streams in realtime.
>>
>>  --
>>  Nikita Orlov
>>  Skype: nik_stet
>>  QQ: 2717846083
>>  _______________________________________________
>>  Libav-user mailing list
>>  Libav-user at ffmpeg.org
>>  http://ffmpeg.org/mailman/listinfo/libav-user
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user

-- 
Nikita Orlov
Skype: nik_stet
QQ: 2717846083


More information about the Libav-user mailing list