1

I have an Nvidia GPU in my computer and I wanted to use it with ffmpeg to convert video files much quicker using hardware capabilities. On the documentation of Nvidia (ttps://developer.nvidia.com/ffmpeg), it is said that we have to recompile ffmpeg to gain support for CUDA. I am on Linux (Debian based, Ubuntu). First, I did "sudo apt remove" and then I've the repository and did :

sudo ./configure --enable-cuda-nvcc --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-libass
sudo make -j 4
sudo make install

This does work pretty well with CUDA but the fact is that all the free codecs are not supported- (one example is CUDA). So I did :

sudo ./configure --enable-cuda-nvcc --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-libass
sudo make uninstall
sudo make clean
./configure --prefix="$HOME/ffmpeg_build" --pkg-config-flags="--static" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --extra-libs="-lpthread -lm" --bindir="$HOME/bin" --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-cuda-nvcc --enable-cuvid --enable-nvenc --enable-nonfree --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
sudo make -j 4
sudo make install

The problem is, when I run the ffmpeg command, I get this error:

maxime@maxime-X756UWK:~/ffmpeg_sources$ ffmpeg
bash: /usr/local/bin/ffmpeg: Aucun fichier ou dossier de ce type

The translation is "No such file or folder of that kind".

Here's the result of the "type" commande :

maxime@maxime-X756UWK:/usr/bin$ type ffmpeg
ffmpeg est haché (/usr/local/bin/ffmpeg)

The translation is "ffmpeg is hashed (/usr/local/bin/ffmpeg)"

I tried to install ffmpeg using apt, the installation worked, but I wasn't able to run the program...

Can you help me fix that issue?
Thanks in advance.

1

You used --bindir="$HOME/bin" in your ffmpeg configure, so your ffmpeg executable is in ~/bin, and not in /usr/local/bin. This usually isn't a problem (~/bin is in the default PATH for Ubuntu for example), but the hash table has not been updated. This is a somewhat rare case that occurs when installing, executing, uninstalling, re-installing occurs in a certain order, and is why the FFmpeg Wiki suggests using the hash command after installation.

To fix this you have several options:

  • Try running hash -d ffmpeg.
  • Or log out and log in.
  • Or move ffmpeg from ~/bin/ to /usr/local/bin if you prefer that location.
1
  • Thanks for your answer... after rebooting, the ffmpeg package was gone and now I'm going to recompile it using checkinstall, which is much more handy... Thank you again! – Mathématix Aug 29 '19 at 12:34

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.