Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On-demand thumbnail #445

Closed
escapezn opened this issue Feb 1, 2023 · 8 comments
Closed

On-demand thumbnail #445

escapezn opened this issue Feb 1, 2023 · 8 comments

Comments

@escapezn
Copy link

escapezn commented Feb 1, 2023

For some videos there is no need to generate and show thumbnails, the only way to stop thumbfast.lua is not loading it on mpv startup. It would be nice if thumbfast.lua could be toggled with interaction, for example right click on progress bar (like deus0ww's thumbnail and osc scripts).

@hooke007
Copy link
Contributor

hooke007 commented Feb 1, 2023

Shouldn't it be requested in thumbfast's issue tracker?

@tomasklaen
Copy link
Owner

The development/maintenance time, additional configuration/setup bloat, and annoying UX this would cause (always having to press something to update the thumbnail) would only make sense if there was any issue with generating and showing thumbnails. But afaik there's not, so I don't see myself considering this.

Shouldn't it be requested in thumbfast's issue tracker?

No, it's uosc that requests thumbnails to be generated. thumbfast is just a thumbnail server.

@hooke007
Copy link
Contributor

hooke007 commented Feb 1, 2023

No, it's uosc that requests thumbnails to be generated. thumbfast is just a thumbnail server.

thumbfast could stop generating thumbs if it would receive a fake vid=no

We don't need do it at uosc side.

@tomasklaen
Copy link
Owner

But how would thumbfast implement the specific example use case described in OP? Meaning: you right click a timeline to get a thumbnail. thumbfast doesn't know the time to seek in this scenario. It could only try using the time from the last received request, but that'd be just guessing that it's the correct one.

This would have to be implemented in uosc.

Or is the right click meant to toggle global thumbnail generation from that point onward, and not just to get a single thumbnail? That could just be a thumbfast toggle.

@hooke007
Copy link
Contributor

hooke007 commented Feb 1, 2023

Or is the right click meant to toggle global thumbnail generation from that point onward, and not just to get a single thumbnail? That could just be a thumbfast toggle.

Yeah that's what I meant. If thumbfast could add a keybing to toggle its function. Nothing we need to do here.
Even though he really want "right click on progress bar", we only need to add the less codes to link to thumbfast's internal keybinding.

edit: Here is a new stupid and simple implementation in thumbfast.

test.mp4

@po5
Copy link
Contributor

po5 commented Feb 3, 2023

Submit the issue here po5/thumbfast, this should be a script-binding if implemented.

@FichteFoll
Copy link

Created an issue at po5/thumbfast#82 because I'm also interested in this but primarily for manually requesting thumbnails for network videos.

@maliayas
Copy link

Apart from the discussion about where this belongs to, I'd like to share my quick hack to toggle thumbnails for those who need this feature until next releases:

diff --git a/scripts/uosc_shared/elements/Timeline.lua b/scripts/uosc_shared/elements/Timeline.lua
index 97f4224..8635612 100644
--- a/scripts/uosc_shared/elements/Timeline.lua
+++ b/scripts/uosc_shared/elements/Timeline.lua
@@ -150,6 +150,10 @@ end
 function Timeline:on_wheel_up() mp.commandv('seek', options.timeline_step) end
 function Timeline:on_wheel_down() mp.commandv('seek', -options.timeline_step) end
 
+bind_command('toggle-thumbnails', function()
+	thumbnail.disabled = not thumbnail.disabled
+end)
+
 function Timeline:render()
 	if self.size_max == 0 then return end
 

Then the key binding:

t script-binding uosc/toggle-thumbnails

Disclaimer: Probably this should be handled in a better way. Use with care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants