Speeding up video thumbnails in nautilus
02.08.2020 [Software]
One of the most annoying things with GNOME's default file manager nautilus or nowadays simply called "Files" is that it is extremely slow when generating thumbnails of videos by default. The reason for that lies in its reliance on totem (the GNOME video player) and in turn gstreamer as both are components of the GNOME desktop. Fortunately it's quite easy to switch to ffmpeg for the thumbnail generation. Another advantage is, that ffmpeg has pretty much any video codec commonly used built in and doesn't need any additional plugins or codecs (unlike gstreamer).

To use ffmpeg as thumbnailer for nautilus, you first have to uninstall totem or remove its thumbnailer configuration file and (obviously) install the ffmpeg thumbnailer. I also recommend to delete the thumbnail cache and then restart nautilus. Additionally I'll show you an extended ffmpeg thumbnailer configuration file since the one provided by Ubuntu by default unfortunately doesn't associate all video formats with ffmpeg that it actually knows.

Let's start with installing the ffmpeg thumbnailer
sudo apt install ffmpeg-thumbnailer

Next, if you want to keep totem installed, only delete the thumbnailer configuration file...
sudo rm /usr/share/thumbnailers/totem.thumbnailer

or alternatively uninstall totem (mpv and vlc are way better anyway)
sudo apt remove totem

Now I recommend to do an additional step by editing the ffmpeg thumbnailer configuration file to associate all video formats with it.
File: /usr/share/thumbnailers/ffmpegthumbnailer.thumbnailer
[Thumbnailer Entry]
TryExec=ffmpegthumbnailer
Exec=ffmpegthumbnailer -i %i -o %o -s %s -f
MimeType=video/3gpp2;video/3gpp;video/annodex;video/dv;video/isivideo;video/mj2;video/mp2t;video/mp4;video/mpeg;video/ogg;video/quicktime;video/vnd.mpegurl;video/vnd.rn-realvideo;video/vnd.vivo;video/wavelet;video/webm;video/x-anim;video/x-flic;video/x-flv;video/x-javafx;video/x-matroska-3d;video/x-matroska;video/x-mjpeg;video/x-mng;video/x-msvideo;video/x-ms-wmv;video/x-nsv;video/x-ogm+ogg;video/x-sgi-movie;video/x-theora+ogg;

All that is left is to delete the thumbnail cache (recommended) and to terminate all running nautilus instances (-q for "quit").
rm -rf ~/.cache/thumbnails && nautilus -q