Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#7537 closed defect (invalid)

Problems with nvdec/cuvid

Reported by: boris-petrov Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Why are there two separate implementations of nvidia hardware acceleration? As far as I understand nvdec is simply a rebranding of cuvid. Yet in FFmpeg they coexist and exhibit different behaviors.

  1. Is either of nvdec/cuvid the recommended one to use? Is either one deprecated?
  2. cuvid does not auto-detect the decoder. This works correctly: ffmpeg -hwaccel cuvid -c:v h264_cuvid -i ..., and so does ffmpeg -hwaccel nvdec -i ..., but this does not: ffmpeg -hwaccel cuvid -i ...
  3. cuvid is noticably (although not drastically) faster. Maybe around 15-20%
  4. ffmpeg -decoders displays some cuvid-related things, but nothing nvdec-related
  5. nvdec is not displayed when running ffmpeg -hwaccels
  6. When using scale_npp with cuvid it can be used with just -vf scale_npp=... whereas nvdec requires -vf hwupload_cuda,scale_npp=...

The output for ffmpeg:

ffmpeg version 4.1.git Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8 (SUSE Linux)
  configuration: --extra-libs='-lm -lpthread' --prefix=/home/lapis/ffmpeg_build --pkg-config-flags=--static --extra-cflags='-I/home/lapis/ffmpeg_build/include -I/opt/cuda/include/' --extra-ldflags='-L/home/lapis/ffmpeg_build/lib -L/opt/cuda/lib64/' --bindir=/home/lapis/bin --enable-version3 --enable-pic --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-ffnvcodec --enable-cuda --enable-cuvid --enable-nvdec --enable-nvenc --enable-libnpp --enable-libsmbclient
  libavutil      56. 23.100 / 56. 23.100
  libavcodec     58. 36.100 / 58. 36.100
  libavformat    58. 21.100 / 58. 21.100
  libavdevice    58.  6.100 / 58.  6.100
  libavfilter     7. 43.100 /  7. 43.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100

I'm not sure which of those are bugs, which are by design, which are normal. I'll appreciate any insight. Thanks!

Change History (3)

comment:1 Changed 2 years ago by cehoyos

  • Resolution set to invalid
  • Status changed from new to closed

This is a bug tracker, please post all usage questions on the FFmpeg user mailing list.

comment:2 Changed 2 years ago by boris-petrov

@cehoyos - well, I do think that points 5 and 6 are bugs. And 2 through 4 are probably too. I'm not 100% sure, of course, but please take the time to read through the points. They are formulated as questions but I think there are real underlying issues.

comment:3 Changed 2 years ago by oromit

The hwaccel is called cuda, not nvdec. nvdec is just an alias which ffmpeg.c translates to cuda for compatibility.

And you probably forgot to specify the hwaccel output format, so the frames will be downloaded for you automatically.

Note: See TracTickets for help on using tickets.