marzzzello / mpv_thumbnail_script

A Lua script to show preview thumbnails in mpv's OSC seekbar, sans external dependencies (fork)
GNU General Public License v3.0
278 stars 20 forks source link

Why is a temp directory with temp screenshot thumbnail files needed? #11

Closed Maxxee closed 2 years ago

Maxxee commented 2 years ago

I don't get it. The script(s) immediately show(s) previews when hovering above the seeker bar, I guess by jumping in the file directly. Why is it needed to generate thumbnail files and even save them to disk? Can this thumbnail save be disabled?

marzzzello commented 2 years ago

That's probably because you have the generated thumbnails already in your temp directory, so the script doesn't need to regenerate them

Maxxee commented 2 years ago

No, I start to play a completely new video file of two hours length, hover above the seeker bar at 1:55:00 and immediately a preview is shown.

Request: Would it be possible to have a version without any temp files?

marzzzello commented 2 years ago

Yes it always shows the nearest thumbnail to the hover position. But the gap between each thumbnail gets smaller as more thumbnails are generated with time. That can be fast or slow depending on your hardware. In the video (0:24) you can see how it counts up until all119 thumbnails are generated. https://youtu.be/a9cmt176WDI?t=24

Request: Would it be possible to have a version without any temp files?

No because the generated thumbnails need to be saved somewhere or you need to constantly regenerate them on the fly (which would max out the CPU quite fast). But you can auto delete old thumbnails with a cronjob like this: https://github.com/marzzzello/mpv_thumbnail_script/issues/6#issuecomment-1003547495

C0D3D3V commented 2 years ago

You see the red line that is the thumbnail that was just selected for the 1:12:59 time mark. All white strokes are thumbnails that have already been generated. In the first second, dozens of thumbnails are already generated throughout the video. How many exactly depends on the configuration. But these initial thumbnails are spread over the video with a large distance. Only after the initial generation more granular thumbnails are created, so that you don't have a picture from 5 minutes ago when hovering over the timeline bar, you can see how the bar fills from left to right white.

Maxxee commented 2 years ago

Now I understand better how it works. Thanks for the quick replies.