Where to get FFmpeg with NVENC?

Do you know a repo that would provide FFmpeg with NVENC enabled?
I’m pretty sure it worked on my end in the past but one of the updates must have broken it. Currently I have 3.4.4-lp150.9.1 from the packman repo installed.

To be 1000% sure you have from Packman all you need, it might be good to do the vendor switch (again).

With YaST.

To add the Packman repo:
YaST > Software > Repositories Management. Then the Add button below. Choose Community Repositories in the next screen and click Next. Select Packman from the list shown and click OK. The Packman repo will now be added to your list of subscribed repositories.

To do the Vendor switch:
YaST > Software Management, then from the View menu choose Repositories. Then in the list of repos, select Packman. At right, above the list of Packages there is a line saying something like: Switch system packages to … Click on the underlined part and continue low-right.

I’m not quite sure but I believe you need the ffmeg 4.0+ binaries for that
afaik packman has only released the ffmpeg 4.0 libraries not the binary
http://packman.links2linux.org/package/ffmpeg-4/871226
after you’ve done a full vendor change to packman and installed ffmpeg-4.0
try running

ffmpeg -codecs

or if that output is too much for you to handle redirect it to a text file and open it with kate/kedit/gedit

ffmpeg -codecs >~/list_of_codecs.txt

and see if your ffmpeg has nvenc support

edit
you can also use

ffmpeg -version

to see if ffmpeg was compiled with nvenc support

my mistake nvenc is supported by ffmpeg 3.4 (which is currently the default version for LEAP 15)
https://github.com/FFmpeg/FFmpeg/blob/master/Changelog#L101
but as previosly stated all patented bits (like nvidia code) are not available from the OSS build you need packman packages for that

I just ran ffmpeg -version and as far as I can tell the packman build of ffmpeg 3.4 does not come with nvenc support (I tested a win64 build on my windows machine and it had nvenc support)
maybe 4.0 will have it but I don’t know as far as opensuse goes packman is the place to get multimedia if it’s not there you’ll have to build it or open a request on the packman mailing list
http://lists.links2linux.de/cgi-bin/mailman/listinfo/packman

ok, so maybe someone knows a community repo that has FFMpeg with NVENC?
As mentioned I currently run ffmpeg from Pacman and not having this is a real bummer. I had it on 42.3 and I might be mistaken, but I think at one point I had it on Leap 15 (I recall doing some recording through OBS and setting it up to use my 2nd nvidia gpu for encoding).
I’m not sure I’m up to compiling ffmpeg myself - if I remember correctly ffmpeg was a bit tricky for someone who knows nothing about programming and did builds only using included build scripts. I’m also a tad afraid of messing up multimedia libraries - I did it in the past and untangling it was not something I’d like to repeat :wink: .

the only other multimedia repo I can think of is the vlc repo but the vlc repo doesn’t provide an ffmpeg binary only libraries
http://download.videolan.org/SuSE/Leap_15.0/
it’s quite possible some user build an ffmpeg with nvenc but afaik uploading it on obs would break the guidelines and might not be legal
a quick google search revealed these 2 sites (there are more to be found)
https://johnvansickle.com/ffmpeg/
https://sites.google.com/site/linuxencoding/builds
as those are static builds you can just copy the ffmpeg binary somewhere in your path
for example
~/bin ($HOME/bin) if you don’t have a bin dir in your home you can make one
a side note those are 3rd party builds and I have no idea if they’re safe or not use at your own risk

I tested the static build from the link above and no luck it’s without nvidia acceleration (it has intel vaapi tho)

> ffmpeg -codecs 
ffmpeg version 4.0.2-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Codecs:
 D..... = Decoding supported
 .E.... = Encoding supported
 ..V... = Video codec
 ..A... = Audio codec
 ..S... = Subtitle codec
 ...I.. = Intra frame-only codec
 ....L. = Lossy compression
 .....S = Lossless compression
 -------
.
.
.
 DEV.L. mpeg2video           MPEG-2 video (decoders: mpeg2video mpegvideo mpeg2_v4l2m2m ) (encoders: mpeg2video mpeg2_vaapi )
 DEV.L. mpeg4                MPEG-4 part 2 (decoders: mpeg4 mpeg4_v4l2m2m ) (encoders: mpeg4 libxvid mpeg4_v4l2m2m )
 DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m ) (encoders: libx264 libx264rgb h264_v4l2m2m h264_vaapi )

unless someone knows a particular build you might need to build it
or go package hunting
https://software.opensuse.org/search?q=ffmpeg

Based on the following page which describes ffmpeg support for hardware acceleration for <all> hardware (not just nVidia)…

https://trac.ffmpeg.org/wiki/HWAccelIntro

Firstly,
nVidia hardware acceleration apparently can be implemented a number of different ways, not just by NVENC. An easy way is through the application layer (first few options listed)
This link also describes what capabilities are possible using each method.

As for NVENC itself,
It seems that you probably don’t need a special ffmpeg build…
You only need a build that **doesn’t explicitly deny nvenc.
**You should be able to execute nvenc as a command line option on most current ffmpeg binaries and is described in the above link.

TSU

to be honest I haven’t tested it but on my windows machine running

ffmpeg -codecs

for h264 I do get

DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 libopenh264 h264_cuvid ) (encoders: libx264 libx264rgb libopenh264 h264_nvenc nvenc nvenc_h264 )

as the nvenc are missing from the list of supported encoders in the linux binary I deduced they’ve been compiled without nvidia hardware acceleration I don’t know why as far as I can tell nvenc is bundeled in the ffmpeg source tree and the intel h264_vaapi does show up as a supported encoder