Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Fedora, custom LFS, Ubuntu Studio (RT)
Posts: 37
Rep:
Static thumbnail cache
When using file preview mode in konqueror within a folder with movies the system automatically generates snapshots with an app called "kffmpegthumbnailer" (10% into the movies). Say I'd like to create my own thumbnails for files that do not get a good representation automatically, where do I put these thumbnails?
Apparently Konqueror uses the folder "~/.thumbnails" as a cache storage. (if this is deleted, all thumbnail previews are regenerated). But when I try to supply my own thumbnail into this directory, it won't get used, instead a default one gets generated (even though the thumbnail type, size and name are identical).
How can I trick the cache functionality into using my own prepared samples instead of generating them. I would have thought there was a logical override, for example by supplying your own ".thumbnail" folder for files you'd like more control over, but this does not seem to be the case.
Distribution: Fedora, custom LFS, Ubuntu Studio (RT)
Posts: 37
Original Poster
Rep:
After browsing the KDE source code ("previewjob.cpp") it seems as if the handler is relying on meta-information embedded in the png thumbnail files. I see there are references to at least file name, size and modification time in there. That would certainly explain why the preview handler is overriding my own attempts to override the default behaviour.
Does anybody know exactly what information needs to be included in a thumbnail file so that the preview handler will load it without failing? Is there a good application for editing png meta information?
Distribution: Fedora, custom LFS, Ubuntu Studio (RT)
Posts: 37
Original Poster
Rep:
Ok, I think I'm getting a bit closer.
From the source code it seems as though the preview handler does the following checks to see if a cached thumbnail can be loaded:
- is there a .thumbnail folder
- is there a png-file in that folder with the correct name (an md5 hash of the path to the movie)
- does the png contain a chunk (metadata) containing the correct timestamp
- does the png contain a chunk with the full path to the movie
From experimenting with "ffmpegthumbnailer" I can create png's with these tags, but the entries do not appear exactly as when the KDE handler creates them. For example, KDE requires a full "file:///path/to/movie" string in the header. But when I try:
ffmpegthumbnailer -i file:///full/path/...
it complains about not being able to "stat" the file and thus leaves out the timestamp (which means that the KDE preview handler can't use it at all).
Distribution: Fedora, custom LFS, Ubuntu Studio (RT)
Posts: 37
Original Poster
Rep:
So ... I downloaded and modified the "ffmpegthumbnailer" source code. Two minor (hackish-ugly) changes were enough to create png files capable of fooling the KDE handler, so it was indeed down to the metainformation embedded in the png file.
This whole episode have left me pondering about two things:
- why include a feature like movie thumbnailing if there isn't a way to customize it?
- why have such a strong and obscure binary format dependency?
Both of these seem un-linux like to me. Wouldn't it be much easier just to rely on the thumbnail hashed name and official timestamp for verification. An small hook in the KDE code scanning for a local .thumbnail directory before the system cache would also be my preferred way of doing it. Maybe I'm missing something in the big picture.
Still hoping someone will chip in with a solution involving "vanilla" tools.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.