I am trying to do Super Resolution with FFmpeg following this thread from Video Stackexchange : How do the super resolution filters in FFmpeg work ?.
SYSTEM :
- Ubuntu 20.04
- Nvidia 510 (verified using
nvidia-smi
) - CUDA 11.6 (verified using (
nvcc --version
) - CUDNN 8.4 (installation method and running verification following their official website)
- Tensorflow 2.7.0 (installation method and running verification following their official website)
- TensorRT (installed from
pip3
) - Installed
zlib1g
andzlib1g-dev
(viaapt-get
)
I had to build ffmpeg with tensorflow, here's the complete settings from the tutorial :
./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-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-libtensorflow \
--enable-nonfree
ERROR :
There was no error during building & installing FFmpeg from source. However, running FFmpeg (including ffmpeg --version
) result in this error :
ffmpeg: Relink `/usr/local/lib/libtensorflow_framework.so.2' with `/lib/x86_64-linux-gnu/libz.so.1' for IFUNC symbol `crc32_z'
ffmpeg: symbol lookup error: ffmpeg: undefined symbol: vaSyncBuffer
Looks like it's tensorflow-related, however I have verified that tensorflow is working properly on my system. I could find nothing on Google, there's just one thread discussing exactly the same error (here), however there is still no solution as well. I am aware the error is not symlink related, but just in case this information is needed :
$ ls -l /usr/local/lib | grep "libtensor*"
lrwxrwxrwx 1 root root 28 Apr 10 05:17 libtensorflow_framework.so -> libtensorflow_framework.so.2
lrwxrwxrwx 1 root root 32 Apr 10 05:19 libtensorflow_framework.so.2 -> libtensorflow_framework.so.2.7.0
-r-xr-xr-x 1 root root 38362936 Apr 10 05:14 libtensorflow_framework.so.2.7.0
lrwxrwxrwx 1 root root 18 Apr 10 05:18 libtensorflow.so -> libtensorflow.so.2
lrwxrwxrwx 1 root root 22 Apr 10 05:19 libtensorflow.so.2 -> libtensorflow.so.2.7.0
-r-xr-xr-x 1 root root 784355912 Apr 10 05:14 libtensorflow.so.2.7.0
$ ldd /usr/local/lib/libtensorflow_framework.so.2
linux-vdso.so.1 (0x00007ffdd598e000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc9f93bd000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc9f926e000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fc9f9264000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc9f9241000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc9f9027000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc9f900c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc9f8e18000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc9fb31a000)
$ ls -l /lib/x86_64-linux-gnu | grep "libz.*"
lrwxrwxrwx 1 root root 14 Oct 15 2020 libz.so.1 -> libz.so.1.2.11
-rw-r--r-- 1 root root 108936 Oct 15 2020 libz.so.1.2.11
$ ldd /lib/x86_64-linux-gnu/libz.so.1
linux-vdso.so.1 (0x00007ffc693bf000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3935cfb000)
/lib64/ld-linux-x86-64.so.2 (0x00007f3935f5c000)
[UPDATE]
Error 1 is solved (see answer below). Now what remains is Error 2 :
$ ffmpeg --version
ffmpeg: symbol lookup error: ffmpeg: undefined symbol: vaSyncBuffer
Any suggestion ?
FIX FOR ERROR 1 :
I have
zlib1g
installed viaapt-get
and I guess that was the problem because it wasn't the version that FFmpeg wanted. I'm following answer from this question with some modifications :Look for information regarding symbolic link on
libz.so.1
Open this website and look for a package following the symbolic link (mine is
libz.so.1.2.11
). I downloaded all packages (3 of them :zlib1g
,zlib1g-dev
andzlib1g-dbg
).Remove and purge already installed
zlib1g
andzlib1g-dev
withapt-get remove --purge
, then fix anything withsudo apt --fix-broken install
if necessary.Install 3 packages from point 2 with :
sudo dpkg -i
sudo ldconfig.
Done, error 1 is gone.
PS : If you do
apt-get dist-upgrade
you will be asked to upgradezlib1g
and/orzlib1g-dev
, well, don't upgrade them otherwise you will encounter this error again. I hold mine from upgrade withapt-mark hold
.FIX FOR ERROR 2 :
Remove all
libva*
installation from machine.Install libva and libva-utils from Intel Github.
libva
in particular will get installed in a directory that FFmpeg won't find. Therefore, during configuration of both, add prefix/usr
Reboot.
No more vaSyncBuffer error. FFmpeg managed to find
libva