0

I have ubuntu18.04, NVIDIA GTX1060, NVIDIA driver 11.4, cuda version 10.2, cudnn version7.6.5.

Yesterday, I got it done with following configuration and it worked perfectly with my test video(ffmpeg 4.3.4 +nv-codec-headers10.0):

./configure --prefix=/usr/local/ffmpeg --disable-asm --disable-x86asm
--enable-cuda --enable-cuvid --enable-nvenc
--enable-nonfree --enable-libnpp
--extra-cflags=-I/usr/local/cuda/include
--extra-cflags=-fPIC --extra-ldflags=-L/usr/local/cuda/lib64
--enable-gpl --enable-libx264 --enable-libx265
--enable-shared
--enable-libass
--enable-libfdk-aac
--enable-libfreetype
--enable-libmp3lame
--enable-libopus
--enable-libtheora
--enable-libvorbis

However, today I want to try another version of nv-codec-headers, and I use the exactly same configuration, it gives me these errors: [h264_cuvid @ 0x55e14e670bb0] ctx->cvdl->cuvidGetDecoderCaps(&ctx->caps8) failed [h264_cuvid @ 0x55e14e670bb0] ctx->cvdl->cuvidGetDecoderCaps(&ctx->caps10) failed [h264_cuvid @ 0x55e14e670bb0] ctx->cvdl->cuvidGetDecoderCaps(&ctx->caps12) failed Stream mapping: Stream #0:0 -> #0:0 (h264 (h264_cuvid) -> h264 (h264_nvenc)) Stream #0:1 -> #0:1 (aac (native) -> aac (native)) Error while opening decoder for input stream #0:0 : Generic error in an external library

Right after this error occurred, I was never able to make it work again. No matter what version I choose, or what configuration I use, it just didn't work, always the same errors. I couldn't use GPU to accelerate the video encoding/decoding anymore.

What should do?

4
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented May 25, 2022 at 15:16
  • It looks like the question should be "how to restore nv-codec-headers 10.0 in Ubuntu 18.04?". It looks like the error is related to "external library", and not to FFmpeg... Commented May 25, 2022 at 16:56
  • I followed the instruction for compiling nv-codec-headers, and I tried both 10.0 and 8.0, they both didn't work. Since the steps of nv-codec-headers compilation are pretty simple, I couldn't find out any operation to fix it. Commented May 26, 2022 at 0:50
  • Problem solved! It appears to be the cuda file's problem. I go to /usr/local/cuda/lib64, there is no libnvcuvid.so.470.129.06, and no libnvidia-encode.so.470.129.06, so ffmpeg cannot find the right files. I copied these two files from usr/lib/x86_64-linux-gnu/, and created soft link files .so, .so.1, and it finally worked Commented May 26, 2022 at 6:19

1 Answer 1

1

I had the same problem. The libnvcuvid.so was broken. Copy libnvcuvid.so from the system to the cuda directory was what solved this for me:

sudo cp /usr/lib/x86_64-linux-gnu/libnvcuvid.so /usr/local/cuda-11.7/targets/x86_64-linux/lib/libnvcuvid.so
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.