I am following this compilation guide for FFmpeg. After compiling all the required dependencies, I get the following error in the last section.
ERROR: gnutls not found using pkg-config
This error occurs when I run the configure command as below :
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./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-gnutls \
--enable-libaom \
--enable-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-nonfree
I am compiling FFmpeg on a fresh install of Ubuntu 20.04.
In the
ffbuild
directory (path :ffmpeg_sources/ffmpeg/ffbuild/
), inspecting theconfig.log
gives more info on the error message :With help from ffmpeg's IRC channel, installing the
libunistring-dev
package fixed the problem.The other solutions didn't work for me, although I'm on Debian not Ubuntu. For me the solution was:
Yes, that guide does not work correctly on any Ubuntu build since at least 16.04. The simplest method to solve this problem I've found is to first install the default Ubuntu package and then generate your custom script. Prior to running your ffmpeg compile script, install the default package from official Ubuntu repository of the library that ffmpeg is complaining about:
apt install -y gnutls
The root cause many of these library issues and Package Config appears to be often related to C/C++ syntax that is incorrect in the library source files. This has been an issue (and continues to be one) for several ffmpeg dependencies in Ubuntu, such as VLC's x265 library. The problem is compounded by BitBucket's recent decision to discontinue Mercurial support, including their decision to shutdown its forums, which removed several related discussions and solutions from the Internet. :(