[Libav-user] Hardware accell encoding

Charles linux2 at orion15.org
Fri Sep 9 16:55:12 EEST 2016

On 09/08/2016 09:57 AM, Leandro Raffo wrote:
> 2016-09-07 22:18 GMT-03:00 Charles <linux2 at orion15.org>:
>> On 09/07/2016 10:06 AM, Leandro Raffo wrote:
>>> Do the ffmpeg libraries expose hardware encoding capabilities? (I'm
>>> mainly looking for NVENC). I've been looking at the ffmpeg source code
>>> for a bit now, but I cannot find where it is implemented, although I
>>> could encode directly with the executable (I compiled), hope I get
>>> some kind of response this time, I'm sorry if my mails are too
>>> newbie/dumb for this mail list but I want to learn to use the ffmpeg
>>> api libraries and I'm going at a snail's pace :).
>>> _______________________________________________
>> Yes, you need to have the NVidia Video SDK when you build.
>> ./configure --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg
>> --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man
>> --extra-cflags=-I../Video_Codec_SDK_7.0.1/Samples/common/inc [...]
>> --enable-nvenc [...] blah blah blah
>> The path --extra-cflags=-I is to the nvEncodeAPI.h file needed and
>> --enable-nvenc adds the h.264 encoder
>> See ./libavcodec/nvenc.c
>> Thanks
>> cco
> Charles thanks for your answer. I've already compiled using the Nvidia
> SDK, the thing is that SDK example code is.. uhm.. so I was trying to

lol ... yes the Nvidia Sample code is uhm...

You can verify you ffmpeg is build with nvenc

linux2 8:28am avlib >> ffmpeg -encoders |& grep h264_nvenc
  V..... h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)

I am not following what you trying to do? Use ffmpeg or direct to nvidia nvenc...


> read FFmpeg's source code instead looking how were you using it.
> Reading the nvenc.c code and correct me If I'm wrong but setting up an
> AVCodecContext, calling ff_nvenc_encode_frame with a frame and receive
> a packet to write would do it?

More information about the Libav-user mailing list