Package thumbnailer provides a more efficient media thumbnailer than available with native Go processing libraries through ffmpeg bindings.
Use
go get -u github.com/bakape/thumbnailer/v2
to install the library in your project.
For a comprehensive list of file formats supported by default see main.go:Process().
NB:
sudo apt build-dep ffmpeg
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg
git checkout n4.1
./configure
make -j`nproc`
sudo make install