14

I am trying to compile FFMPEG with Nvidia Cuda support, on Debian 9.3. Parameters, what I am using:

--enable-cuda --enable-cuvid --enable-nvenc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-gpl --enable-libx264 --disable-x86asm --enable-libx265 --enable-libfdk-aac --enable-nonfree

Nvidia Cuda with drivers are installed. When I try to configure ffmpeg, it says:

ERROR: cuvid requested, but not all dependencies are satisfied: cuda

Newer ffmpeg will show a similar, re-worded message:

ERROR: cuda requested, but not all dependencies are satisfied: ffnvcodec

I absolutely don't know why I'm having this issue, because I am compiling ffmpeg on all of our trans-coding servers.

  • What does config.log say towards the end? It will be in ffbuild/ – Gyan Feb 28 '18 at 8:39
34

The NVIDIA headers were moved out of the FFmpeg codebase to a standalone repository in commit 27cbbbb. From the commit message:

External headers are no longer welcome in the ffmpeg codebase because they increase the maintenance burden. However, in the NVidia case the vanilla headers need some modifications to be usable in ffmpeg therefore we still provide them, but in a separate repository.

Also, from FFmpeg Wiki: HWAccelIntro:

FFmpeg now uses its own slightly modified runtime-loader for nvidias CUDA/nvenc/nvdec related libraries. If you get an error from configure complaining about missing ffnvcodec, this is what you need.

It has a working Makefile with an install target:

make install PREFIX=/usr

FFmpeg will look for its pkg-config file, called ffnvcodec.pc. Make sure it is in your PKG_CONFIG_PATH.

To compile the FFmpeg NVIDIA headers ("ffnvcodec"):

git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers
make
sudo make install

Now compile ffmpeg as usual. The headers should be autodetected. If not then declare the PKG_CONFIG_PATH pointing to the path where ffnvcodec.pc is located when running configure for FFmpeg. For example:

PKG_CONFIG_PATH="/path/to/lib/pkgconfig" ./configure
1

I encountered a similar error but it turns out, it was caused by missing tool package config. On Ubuntu 16.04 you can run

apt-get install pkgconf

and check whether the missing package is really missed or not:

pkgconf --list-all | grep package-name
-1

https://github.com/FFmpeg/FFmpeg/commit/27cbbbb33f259de7c795d2b75edf7b240f0f82e6

I found this commit code occur error. Use previous commit code

git clone https://github.com/FFmpeg/FFmpeg.git

git checkout 7414d0bda7763f9bd69c26c068e482ab297c1c96

git reset --hard

  • This will limit you to be stuck with commit 7414d0b indefinitely. Just download and install the NVIDIA headers before compiling ffmpeg. – llogan Feb 28 '18 at 20:03

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.