po5 / thumbfast

High-performance on-the-fly thumbnailer script for mpv
Mozilla Public License 2.0
758 stars 34 forks source link

Only first thumbnail is shown with spawn_first=yes #74

Closed 2084x closed 1 year ago

2084x commented 1 year ago

I'm using thumbfast with mfpbar.

When playing (local) vp9 files I'm getting very inconsistent thumbnailing.

Sometimes it works perfectly. Other times it will only show the first frame of the file. Occasionally it's just slow and only shows a few thumbnails at large intervals. There are never any errors in the log.

I cannot consistently reproduce the issue, it just seems to happen randomly and regardless of config options. Although I have noticed that if the cursor is moved to the timeline as soon as the file is opened, thumbnailing is more likely to not work properly.

Other common codecs thumbnail flawlessly 99% of the time.

I had similar issues when using mpv_thumbnail_script, so it might be an issue with mpv or the codec itself rather than this script.

po5 commented 1 year ago

Do you have sample files? Are these YouTube encodes?

I am also curious how the remaining 1% of common codecs fail for you.

2084x commented 1 year ago

Do you have sample files? Are these YouTube encodes?

Yes they are YouTube encodes I've downloaded with yt-dlp. Webm-vp9s I've encoded myself seem to be working fine but I haven't tested much. Here's an example of the vp9 issues: https://files.catbox.moe/xlfi88.webm

Thumbnailing works for the first two files and gets stuck on the first frame for the last two files. If I tried this again in an hour it could be the other way round. Completely random.

I am also curious how the remaining 1% of common codecs fail for you.

I meant that they only fail 1% of the time. Here's an example with h264 mkv failing: https://files.catbox.moe/t1rjal.webm

Thumbnailing fails the first time (presumably because I hovered over the bar too quickly?) and the second time I wait a second longer and it works fine. This one is less of an issue but still worth investigating.

christoph-heinrich commented 1 year ago

Based on those video I think you're using spawn_first=yes. Does it also happen with spawn_first=no?

2084x commented 1 year ago

Yeah I was using spawn_first=yes. Switching to spawn_first=no has solved the issue. I thought I had tried that already :facepalm: . Thanks!

N-R-K commented 1 year ago

Yeah I was using spawn_first=yes. Switching to spawn_first=no has solved the issue.

That's more of a workaround than a solution. As far as I see, that option is merely an optimization to make the initial thumbnail generation faster - it shouldn't be making things buggy.

christoph-heinrich commented 1 year ago

There is also the problem from #45 that might have something to do with this. I suspect that fixing one will also fix the other one.

Nosirus commented 1 year ago

I have the same problem, except that it's on all my files, the first image that I fly over and generate well then nothing more then I set spawn_first=no

po5 commented 1 year ago

@2084x @Nosirus Is it fixed for you with the latest updates? Keep in mind you need socat installed if you are on Linux and your mpv version is older than 0.33.0.

po5 commented 1 year ago

Please reopen if you encounter this again.

2084x commented 1 year ago

I've just spent the last 10 minutes opening and closing files and the preview only got stuck once. So that's a major improvement.

I'm still experiencing thumbnail glitches on certain files only when spawn_first=yes. There was a separate issue for this that got closed as a duplicate of mine but it looks likes it's been deleted. I believe it was #77. Here's what they look like: pic-window-230505-2007-39 Again, it's far less often now, but still present.

btw apparently I can't reopen the issue if you closed it.