Page 1 of 2

Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 04 Apr 2023 03:49
by o7blue
I have my entire media library on my NAS, and since it's a network location I don't get thumbnails for video files (mp4/webm/mkv/etc), it just shows the video player icon. Now if there is a way to get thumbnails for videos on network drives, I'm a big dumdum, but I still think the idea would be nice (if it's even possible).

So in order to get thumbnails in my network locations I just save a screenshot of the video next to the video file itself (easy enough to do in mpv with one keybind and setting up the naming pattern). For example:

video.webm
video.thumb.png

This gives me a nice preview, but it does lead to clutter. I was wondering if it's possible to override the thumbnail of video.webm with the thumbnail of video.thumb.png. I could then just set up a ghost filter for *.thumb.png, and reap the benefits of thumbnails on network drives.

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 04 Apr 2023 12:31
by klownboy
Take a look at the scripting command "setthumb" in the help file. You should be able to use an alternate image for your thumbnails. Also look for the "deep injection" parameter for setthumb. On deep injection the thumbnails injected via setthumb or thumbnails mapfile behave more like original thumbnails Please read all the remarks.

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 04 Apr 2023 12:49
by admin
I like the general idea (as an optional fallback) but I would include the extension:

Code: Select all

video.webm
video.webm.thumb.png

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 04 Apr 2023 18:07
by o7blue
Ok, so I played a bit with 'setthumb' and it works well on a static file/thumb pair.

In 'Custom Event Actions>Changing Locations>After browsing a folder' I set it to run the following script:

Code: Select all

setthumb "video.webm", "<curpath>\video.webm.thumb.png";
With the ghost filter on (hiding *.webm.thumb.png) both the webm and the parent folder get the thumbnail without any extra clutter, so that's nice.
But I'm a little lost as to how to go about pattern matching. It seems like I would need to use a map, but in all the examples in the help file they resolve to a single thumbnail (eg *.webm > E:\video.webm.thumb.png).
Is it possible to do achieve name matching that's many-to-many, instead of many-to-one? (without resorting to looping over the contents of the folder, that would be quite the performance hit)

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 04 Apr 2023 18:16
by admin
What I meant by my last post: I could add something so that file xxxxxx.ext would always use file xxxxxx.ext.thumb.png as thumbnail if it exists. That would be a generic solution.

Concerning your specific task I have no time to go into this now. Maybe any of the pro scripters here read this...

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 04 Apr 2023 18:25
by o7blue
Ah, gotcha. It would be a nice feature to have in the future. Thanks for considering it!

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 05 Apr 2023 06:50
by jupe
Why don't normal thumbnails work for you anyway? Are you saying you get a thumbnail if you copy one of the files you mention to a local disk, and only when the exact same file is on the NAS it shows no thumbnail? That's weird. Because I would say you might just need Icaros installed depending on the codecs used in those videos. Try temporarily disabling the XY thumbnail cache as a troubleshooting step, so none of the child settings are relevant.

Show a screenshot of your thumbnail config.

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 05 Apr 2023 09:33
by o7blue
jupe wrote: 05 Apr 2023 06:50 Are you saying you get a thumbnail if you copy one of the files you mention to a local disk, and only when the exact same file is on the NAS it shows no thumbnail?
Yup, exactly so- no thumbnail on SMB share (left pane), thumbnails when the file lives on local disc (right pane):

Image

I refreshed the thumbnails with 'Cache thumbnails on disk' turned off, but it didn't change anything. My regular config looks like this:

Image

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 05 Apr 2023 09:38
by admin
Weird. There is no XY setting that excludes thumbnails from network locations. Must be the thumbnail handler's decision.

Are these 64-bit thumbnails? (Do they stop working even in local locations if you remove them from this list: extlist("thumbs64");)

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 05 Apr 2023 10:26
by jupe
Have you got MysticThumbs or SageThumbs or Icaros installed, it could be a setting in those.

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 05 Apr 2023 12:28
by o7blue
jupe wrote: 05 Apr 2023 10:26 Have you got MysticThumbs or SageThumbs or Icaros installed, it could be a setting in those.
No, I don't have any of those. The only thumbnail related thing in my system I can think of (that I modified) is local group policy for File Explorer (to turn off thumbnail display and thumbs.db creation). But that shouldn't affect XY:

Image

admin wrote: 05 Apr 2023 09:38 Weird. There is no XY setting that excludes thumbnails from network locations. Must be the thumbnail handler's decision.

Are these 64-bit thumbnails? (Do they stop working even in local locations if you remove them from this list: extlist("thumbs64");)
I'm not sure how to get at the list you mentioned. Is that 'Thumbs64Ext' in the .ini or is it something different?
That said it looks like this:

Code: Select all

Thumbs64Ext=afphoto.afdesign.afpub.sldasm.slddrw.sldprt.skp.layout

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 05 Apr 2023 12:34
by admin
Paste it into the address bar and press ENTER: extlist("thumbs64");

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 05 Apr 2023 13:02
by o7blue
Ah, I tried that initially with ::extlist("thumbs64"); and got an error. But without the colons is also giving me an error:

Image

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 05 Apr 2023 13:06
by highend
Update to the current beta?

Re: Override video file thumbnail/icon in network location with a png that matches name pattern

Posted: 05 Apr 2023 13:09
by o7blue
And here I thought I was good because I updated to the latest stable yesterday haha. I'll update to the beta in a few hours, got a backup operation in progress right now.