Generate Video Thumbnails Faster with ‘FFmpegthumbnailer’ in Cinnamon

Thought it is certainly not my favorite multimedia player, any GNU/Linux distribution that comes with Gnome desktop or make use of its core applications, use ‘Totem’ as the multimedia player. Plus, it is also being used to create thumbnails of video files (including ‘previewing’ audio files) as well.

Like many others, I too have been using the Gnome desktop, even before ‘Totem’ had this feature. Sure it had its issues in the beginning, but nowadays, once you have installed the proper multimedia codecs, it can generate thumbnails of almost all the popular video formats without much difficulty.

However, ‘totem-video-thumbnailer’ (that is what the application is called) is not the only video thumbnail generator out there, and I cannot remember the exact time frame, I think it was around 2005-2006, there was a MPLayer based video thumbnail generator that was much, much, faster than ‘totem-video-thumbnailer’.

ffmpegthumbnailer-running-on-Linux-Mint-14

If you are looking for another one, then there is also the famous ‘ffmpegthumbnailer’, which is well known for its blistering speed! 😀 (it is not a new one and has been there for sometime now).

It used to work flawlessly in Gnome desktop based distributions in the past. But due to few changes done to ‘Totem’ in the recent past, it stopped working in operating systems like Ubuntu 11.10 and later.

I have written a simple trick to get it working, but because it has been about an year since I last bragged about it ;-), I decided to come up with a new one.

For this example, I’m using Linux Mint 14 (Cinnamon) but these same steps should work in Ubuntu 12.10 as well. For setting up ‘ffmpegthumbnailer’ please follow the below steps.

Step 1:

First, let us install the ‘ffmpegthumbnailer’ package. For that, open your Terminal window and enter the below command.

sudo apt-get install ffmpegthumbnailer

Step 2:

Now, what we are doing is simple. We are going to replace a customized configuration file of the ‘totem-video-thumbnailer’ so that every time it is being called by the file manager, it will execute ‘ffmpegthumbnailer’.

totem.thumbnailer-configuration-file-after-adding-ffmpegthumbnailer-commands

I have changed two lines of code of this original file (called ‘totem.thumbnailer’) and have uploaded it to this blog. So please download the file from here and extract its content to your ‘Home’ folder. Don’t extract it to anywhere else, otherwise the below command will not work.

Step 3:

Once that is done, open your Terminal and enter the below command.

sudo cp totem.thumbnailer /usr/share/thumbnailers/

Step 4:

For the changes to take effect, you might have to restart the file manager.

If you use ‘Nautilus’ (Ubuntu users), then enter the below command.

nautilus -q

If you ‘Nemo’ (a fork of ‘Nautilus’, used in Cinnamon), enter the below one instead.

nemo -q

That’s it. Now every time you visit a folder that has video content, ‘ffmpegthumbnailer’ will come into action and create them pretty thumbnails so fast that it would put ‘Totem’ to shame ;-).

Optional …

Rolling back the changes …

For some reason, if you wanted to get the original ‘totem-video-thumbnailer’ back (shame on you! :P), then you can do so by simply issuing the below command.

sudo apt-get install –reinstall totem

Then use the above commands to restart your file manager.

Recreating ‘failed’ thumbnails …

Sometimes ‘Totem’ fails to create video thumbnails. Thought I cannot not guarantee results, you can try forcing ‘ffmpegthumbnailer’ to recreate them.

For that, use the below command (for both Linux Mint 14 and Ubuntu 12.10 users).

rm -r ~/.cache/thumbnails/fail/gnome-thumbnail-factory

If you are lucky, the next time you open those folders, ‘ffmpegthumbnailer’ might create the thumbnail of those files, of which, ‘Nautilus’ and ‘Nemo’ had failed before.

Tweaking it …

By default, ‘ffmpegthumbnailer’ seeks 10% into a video for creating the thumbnail. If you want, you can change this by following the below steps.

Step 1:

Copy the below command (make sure to replace ’20’ accordingly, thought seeking far into a video file will slow down the thumbnail generation times).

ffmpegthumbnailer -s %s -i %i -o %o -c png -f -t 20

Step 2:

Then enter the below command to edit the configuration file.

gksudo gedit /usr/share/thumbnailers/totem.thumbnailer

Now as highlighted in the 2nd screenshot, replace the ‘ffmpegthumbnailer -s %s -i %i -o %o -c png -f’ command with the above copied one.

Once done, make sure to save your changes by clicking on the ‘Save’ button. And then close the editor’s window. That’s it.

Removing the vertical ‘movie strips’ …

It also adds two small ‘movie strips’ (vertical) into the thumbnails. If you do not like it, you can disable it by removing the ‘-f’ argument of the ‘ffmpegthumbnailer -s %s -i %i -o %o -c png -f’ command.

Once that is done, enter the below command to remove all the existing thumbnails, and the new ones will be created when you revisit those folders.

rm -r ~/.cache/thumbnails/

ffmpegthumbnailer-without-movie-strips

That’s it.

You can read about its other options by simply reading the manual. For that, use the below command.

man ffmpegthumbnailer

Good luck.

An RHCE, 'Linux' user with 14+ years of experience. Extreme lover of Linux and FOSS. He is passionate to test every Linux distribution & compare with the previous release to write in-depth articles to help the FOSS community.

18 thoughts on “Generate Video Thumbnails Faster with ‘FFmpegthumbnailer’ in Cinnamon”

  1. Nice explanation! But you don’t need to put the modified file in ‘/usr/share/thumbnailers/’. Just put it in ‘~/.local/share/thumbnailers/’ and it won’t be overwritten with every update.

    Reply
    • That’s true, but the reason I mentioned that was because I wanted it to be applied to every user. But as you said, for single user based system, putting it under ‘~/.local…’ is the perfect solution.

      Reply
  2. This also works in CentOS 7.

    I could not resolve the problem myself and your instructions really helped to track down the source of the problem.

    Thank you very much.

    Just in case if somebody wants to resolve this problem in CentOS 7 installation:
    1. ffmpegthumbnailer in available from CentOS repositories.
    2. after installing ffmpegthumbnailer, ffmpegthumbnailer.thumbnailer file can be found in /usr/share/thumbnailers
    3. selinux may block ffmpegthumbnailer, thus try to run ffmpegthumbnailer in terminal (for example, “ffmpegthumbnailer -i k.mp4 -o test1.png”)
    4. if test1.png file is successfully created, then just recreate thumbnails as shown above.
    5. however, if test1.png file has not been created and selinux throws warning messages, than follow instructions in these messages to unblock ffmpegthumbnailer.

    best wishes

    Reply
  3. This fix also works in Ubuntu Mate 15.04 which didn’t display thumbnails of any video by default in any file manager that I used great work thanks wish I had even half the knowledge you have

    Reply
  4. Thanks! It works perfect for me! I have to use your procedure because I uninstalled Totem and using instead VLC in Ubuntu 14.04. Now I have all videos thumbnails again!

    Reply
  5. Thank you been trying to replace the default movie thumbnails in Linux Mint 19 which suck for some time now.

    Your solution and script worked a treat 🙂

    Reply
  6. I appreciate a lot your work. Unfortunately it’s not working in Linux Mint 20. Any ideas? I have been looking around, and found nothing.

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.