[Libav-user] Nvenc_H264 very slow compared to Libx264

Philippe Noël philippe_noel at college.harvard.edu
Fri Jan 17 19:12:49 EET 2020


>
> In my experience, x264 is very fast and you may not be able to beat it at
> low quality.  That said, there are a lot of possibilities for why it may be
> slow.  Look at:
> https://devblogs.nvidia.com/nvidia-ffmpeg-transcoding-guide/ which will
> give you some tips for minimizing PCIe transfers to keep it fast.
> Cheers.


Thanks! I read through the nvidia docs. It seems that I need to pass in the
"hwaccel: cuvid" option in order to keep the raw frame in GPU memory. Do
you have any idea how to do this in Libav (C)? I tried following this
Stackoverflow post,
<https://stackoverflow.com/questions/5985273/using-ffmpeg-hwaccel-from-c?fbclid=IwAR0bI8NuMoc29Kw_tCwGQVogXAsG4liAqYSw6hftOZ2n8H5jn-JIV6RVdko>
but av_hwaccel_next() kept returning NULL for a pixel format of
AV_PIX_FMT_YUV420P and a codec of "h264_nvenc." I also see that
av_hwaccel_next is deprecated. Do you have any suggestions?

Thanks!

Philippe

On Fri, Jan 17, 2020 at 12:07 AM Jodon Karlik <jodonk at gmail.com> wrote:

>
>
> On Thu, Jan 16, 2020 at 5:28 PM Philippe Noël <
> philippe_noel at college.harvard.edu> wrote:
>
>> Hi,
>>
>> I was using libx264 to encode a video file using libav from a C file and
>> switched to nvenc_h264 and now the encode is very slow. It appears
>> nvenc_h264 does not have a "ultrafast" setting.
>>
>> With nvenc_h264 I am using preset "llhq" and tune "zerolatency". Am I
>> using the wrong settings?
>>
>> Cheers,
>>
>> Philippe
>> _______________________________________________
>> Libav-user mailing list
>> Libav-user at ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/libav-user
>>
>> To unsubscribe, visit link above, or email
>> libav-user-request at ffmpeg.org with subject "unsubscribe".
>
>
> In my experience, x264 is very fast and you may not be able to beat it at
> low quality.  That said, there are a lot of possibilities for why it may be
> slow.  Look at:
> https://devblogs.nvidia.com/nvidia-ffmpeg-transcoding-guide/ which will
> give you some tips for minimizing PCIe transfers to keep it fast.
>
> Cheers.
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/libav-user
>
> To unsubscribe, visit link above, or email
> libav-user-request at ffmpeg.org with subject "unsubscribe".
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20200117/a80d493c/attachment.html>


More information about the Libav-user mailing list