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

smoother thumbnail? #65

Open
tmpm697 opened this issue Nov 7, 2022 · 14 comments
Open

smoother thumbnail? #65

tmpm697 opened this issue Nov 7, 2022 · 14 comments

Comments

@tmpm697
Copy link

tmpm697 commented Nov 7, 2022

I use this config:

# Socket path (leave empty for auto)
socket=

# Thumbnail path (leave empty for auto)
thumbnail=

# Maximum thumbnail size in pixels (scaled down to fit)
# Values are scaled when hidpi is enabled
max_height=200
max_width=200

# Overlay id
overlay_id=42

# Spawn thumbnailer on file load for faster initial thumbnails
spawn_first=yes

# Enable on network playback
network=no

# Enable on audio playback
audio=no

# Enable hardware decoding
hwdec=vaapi

# Windows only: use native Windows API to write to pipe (requires LuaJIT)
direct_io=no

Basically I want thumbnails as fast as possible and real smooth when surf progress bar. I'm ok with current state of how thumbnails processed but still find it a bit not so smooth -- this is purely my experience and it's biased.

I'm thinking of if we can allow multi-threads to process thumbnails faster (threads=10) --> considering the machine's power is not limited. Other users with limited pc's hardware can turn it off.

I've tested with 60G 4k mkv file and thumbnails took a lot of time to generate frames/images.

from your video/gif in README, thumbnails look really smooth with small size / low video quality but in case of 4k or 8k video, how to have thumbfast generate thumbnails faster and smoother when surf progress bar?

  1. again, can we enable multi-threads to process thumbnails?
  2. can we give option to choose the quality of each frame/images to give faster experinece? like if you're with 4k video, and choose thumbnails frames/images with quality really low, it'll help to speed up user's experience.

Update: just confirmed that it's unusable with 4k video (tried with size of 64G and 38G video), when I surf progress bar, it always show same frame/image.

@po5
Copy link
Owner

po5 commented Nov 7, 2022

direct_io=yes will likely help if you're on Windows.

In #49 we changed vd-lavc-threads to 2, but I realize that should probably be tweakable through an option.

However if it's a hard drive speed issue there is nothing we can do.
We already optimize decoding by disabling quality options, and downscale directly to the final thumbnail resolution.

@hooke007
Copy link
Contributor

hooke007 commented Nov 7, 2022

hwdec=vaapi

The value of this option only support yes or no
You cannot use native hwdec in encoding mode. And vd-lavc-threads usually cannot limit hwdec’s decoding threads.(It only works for software-decoidng.)

@tmpm697
Copy link
Author

tmpm697 commented Nov 7, 2022

I changed hwdec=yes and retried, pretty much same result. No usable with 4k video, able with 4k rip, and ok with 1080p, and I believe it would only smooth with 720p mkv video.

with 4k, only one image show when you move to progress bar and then surf it.
with 4k rip, images display but not keep up with mouse movment, feeling a bit slow.
with 1080p, it's there but can be smoother.

I compare the smooth with any kind of online movie service that support thumbnails, and they're really fast and smooth, I don't know if streaming videos would reduce the quality that come with more light weight work for thumbnail process.

tbh, I really appreciate the work put here and hope it would keep up better.

@tmpm697
Copy link
Author

tmpm697 commented Nov 7, 2022

Just worked now for me -- no idea, can render even with 4k mkv native, can be limit to disk but a bit images still need somehow to keep up with mouse movement, how can we improve this?

I use this thumbnails with this, maybe there's a bottleneck?

@po5
Copy link
Owner

po5 commented Nov 7, 2022

Just worked now for me -- no idea, can render even with 4k mkv native

Then that's a disk speed issue and nothing I can help you with. Your OS caches the most common disk hits after some initial scrubbing.

@christoph-heinrich
Copy link
Contributor

We could maybe experiment with pregenerating keyframe images with ffmpeg for local files. https://superuser.com/a/1153483
People report pretty fast generation in the comments, but the images are not guaranteed to be in the correct order and associating them to timestamps is also hacky. It would probably be best to ask in the ffmpeg irc if they know how to embed the timestamp into the filename, because I couldn't find anything from a quick search.

@tmpm697
Copy link
Author

tmpm697 commented Nov 8, 2022

As my comment here and a demo of lagging thumbnails:

screencast-latest.mp4

@BhaturaGuy
Copy link

Same issue here.

@barolo
Copy link

barolo commented May 19, 2023

Same issue, displays only one thumbnail with 4k HDR files, on nvme drive

@po5
Copy link
Owner

po5 commented May 20, 2023

@barolo That is not the issue described here, please make a new issue with your OS and mpv version info.

@barolo
Copy link

barolo commented May 21, 2023

@barolo That is not the issue described here, please make a new issue with your OS and mpv version info.

How it is different when OP states Update: just confirmed that it's unusable with 4k video (tried with size of 64G and 38G video), when I surf progress bar, it always show same frame/image. ?

@tmpm697
Copy link
Author

tmpm697 commented May 22, 2023

As my comment here and a demo of lagging thumbnails:

screencast-latest.mp4

this issue related to lagging preview images when playing large media file.

@da3dsoul1
Copy link

As my comment here and a demo of lagging thumbnails:

screencast-latest.mp4

Hey, could you please tell what osc/progress bar are you using? looks slick

@christoph-heinrich
Copy link
Contributor

We could maybe experiment with pregenerating keyframe images with ffmpeg for local files.

--vd-lavc-skipframe=nonkey --no-audio --untimed can be used to run though the keyframes of a video fairly quickly, but just like with ffmpeg I don't know how we could associate those with their timestamps :/
Maybe a script on the spawned process that observes time-pos and then renames the generated file with a timestamp? Could be worth a try.

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

7 participants