Unable to compile FFmpeg on Ubuntu 20.04

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 the config.log gives more info on the error message :

/usr/bin/ld: cannot find -lunistring
collect2: error: ld returned 1 exit status
ERROR: gnutls not found using pkg-config

With help from ffmpeg's IRC channel, installing the libunistring-dev package fixed the problem.

sudo apt-get install libunistring-dev