[FFmpeg-user] problem ffmpeg with cuda and scale

Dennis Mungai dmngaie at gmail.com
Wed Oct 16 00:24:56 EEST 2019

On Tue, 15 Oct 2019 at 23:47, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> Am Di., 15. Okt. 2019 um 22:25 Uhr schrieb Michele Salerno
> <mikysal78 at gmail.com>:
> > ffmpeg version 4.1.4 Copyright (c) 2000-2019 the FFmpeg developers
> This looks old.
> Carl Eugen

And secondly, if you want the scale_npp filter, you must compile
FFmpeg from source with --enable-cuda-nvcc option passed to the
./configure script. Note that the CUDA SDK must be installed on the
system you're building and running FFmpeg on.

Since you have nvenc present and enabled, you should be able to use
the scale_cuda filter, yadif_cuda, thumbnail_cuda and hwupload_cuda
filters respectively as they're dependent on the ffnvcodec headers
package needed to enable the NVENC feature set.

For usage, see:

ffmpeg -h filter=scale_cuda

On my build, I see:

Filter scale_cuda
  GPU accelerated video resizer
       #0: default (video)
       #0: default (video)
cudascale AVOptions:
  w                 <string>     ..FV...... Output video width (default "iw")
  h                 <string>     ..FV...... Output video height (default "ih")

So with your command, substitute scale_npp with scale_cuda as shown:

for i in *.mp4; do
    ffmpeg -threads 8 -hwaccel nvdec -i "$i" -vf scale_cuda=720:-1
-c:v h264_nvenc -preset slow "convert/$i";

NVDEC should be available on your platform as ffmpeg was configured
with the aforementioned ffnvcodec header package.
Note the thread count limit I've added to the command above, as nvdec
will warn you on high thread counts exceeding ~16.


More information about the ffmpeg-user mailing list