[Libav-user] Hardware accell encoding

Leandro Raffo ljraffo at gmail.com
Thu Sep 8 17:57:24 EEST 2016


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
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user

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