Page 1 of 1

Could We Please Enable h264_nvenc Support in ffmpeg?

Posted: Thu Dec 26, 2019 2:02 am
by GrahamLeach

I could use a little help please? :)

My older NVIDIA board doesn't support CUDA. It's an NVIDIA Quadro K2000M in a DELL PRECISION M4700.

The K200M chip architecture is based on Kepler, which does not support CUDA:

However, hope remains for hardware acceleration!

NVidia states that as of ffmpeg 3.3, H.264 encoding is supported for the Kepler architecture:

Code: Select all

NVidia GPU HW-Acceleration Support Table

FFmpeg Version 3.3

GPU	Protocol	Operation	Available
Kepler	H.264		Encoding	Y
Kepler	HEVC 		Encoding	N

Kepler	Decoding	MPEG2 decoding	Y
Kepler	Decoding	MPEG-4 decoding Y
Kepler	Decoding	H.264 decoding	Y
Kepler	Decoding	HEVC decoding	N
Kepler	Decoding	VP9 decoding	N
But, that type of encoding (h264_nvenc) doesn't seem to be compiled in to the latest static build of ffmpeg, and I need it to make my Shotcut installation work correctly. At the moment, Shotcut detects my NVIDIA device and shows support for it, but fails to get it because the embedded ffmpeg version lacks support for the h264_nvenc option:

Code: Select all

C:\Program Files\Shotcut>ffmpeg -hwaccels
ffmpeg version n4.2.1-17-g48ae235 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 5.5.0 (GCC)
  configuration: --prefix=/root/shotcut/shotcut/Shotcut --disable-static --disab
le-doc --enable-gpl --enable-version3 --enable-shared --enable-runtime-cpudetect
 --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libvpx --enable-
libopus --enable-libmfx --cross-prefix=x86_64-w64-mingw32.shared- --arch=x86_64
--target-os=mingw32 --pkg-config=pkg-config
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Hardware acceleration methods:
So I came here, hoping that I would be able to find a version of ffmpeg with the h264_nvenc option enabled.

No dice.

The NVIDIA support in the latest version of ffmpeg only supports CUDA, which my board does not support:

Code: Select all

4-static\bin>ffmpeg -hwaccels
ffmpeg version git-2019-12-24-287620f Copyright (c) 2000-2019 the FFmpeg develop
  built with gcc 9.2.1 (GCC) 20191125
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfi
g --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libb
luray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --e
nable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable
-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 -
-enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enab
le-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --en
able-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcode
c --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 -
-enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 36.101 / 56. 36.101
  libavcodec     58. 65.100 / 58. 65.100
  libavformat    58. 35.101 / 58. 35.101
  libavdevice    58.  9.101 / 58.  9.101
  libavfilter     7. 69.101 /  7. 69.101
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Hardware acceleration methods:
h264_nvenc support appears to be missing in the latest ffmpeg build, and the latest Shotcut build, which depends on ffmpeg.

So, here's my request: Could someone please build me a statically linked version of ffmpeg for Windows (ideally, Windows 7) with h264_nvenc enabled?

Here's the command line switches to enable support for both cuda and nvenc in ffmpeg.

Code: Select all

./configure 	--enable-cuda-sdk 				\
		--enable-cuvid 					\
		--enable-nvenc 					\
		--enable-nonfree			 	\
		--enable-libnpp					\
		--extra-cflags=-I/usr/local/cuda/include	\ 

If this could happen, I would be ever so grateful!


Graham Leach

Re: Could We Please Enable h264_nvenc Support in ffmpeg?

Posted: Fri Jan 03, 2020 9:14 pm
by BiDouiLle
Hi Graham,

You are talking about the last build but does an old build does the job ?

I'm not sure that a non free build can be distributed but I'm clearly not a legal expert.



Re: Could We Please Enable h264_nvenc Support in ffmpeg?

Posted: Tue Jan 07, 2020 4:42 am
by xtemp09
I also have a Kepler video card (GeForce 650 Ti). Both the latest static build and the latest stable static build work fine.

Could you post the command-line parameters that do not work?