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’.
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.
First, let us install the ‘ffmpegthumbnailer’ package. For that, open your Terminal window and enter the below command.
sudo apt-get install ffmpegthumbnailer
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’.
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.
Once that is done, open your Terminal and enter the below command.
sudo cp totem.thumbnailer /usr/share/thumbnailers/
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.
If you ‘Nemo’ (a fork of ‘Nautilus’, used in Cinnamon), enter the below one instead.
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 ;-).
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.
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
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/
You can read about its other options by simply reading the manual. For that, use the below command.