-
Notifications
You must be signed in to change notification settings - Fork 36
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
Seek by file #42
base: master
Are you sure you want to change the base?
Seek by file #42
Conversation
0c64bb0
to
c117398
Compare
Isn't this a roundabout way to say spawning a subprocess is inefficient? |
The videos should be proof enough 😉. Try it out. For me there is 0 stutter now, where as before, every time a seek command gets sent, it stutters a little. I don't know how it is on windows, as I'm on linux and so #35 also makes no difference to me. stutter.mp4 |
How is it saying that? It still spawns the subprocess, the only difference is how the subprocess receives it's seek commands. As I have pointed out in #40 (comment), sending via socket is what's causing the stuttering, so I found a different way of doing it. |
It can be confirmed that #35 is much better on Windows. |
The issue isn't sockets it's that we spawn another process to send anything to it. |
This would be a performant cross platform solution. Since I can't test #35 I don't know if it works as well as this, but even if it does, it's still windows only. |
Sorry |
Currently it only checks for seeks every 100ms, that shouldn't be a problem even on windows. And it stops looking for updates if the file hasn't been written to in 100ms. The timer gets activated again when the title gets set via the socket (wake up signal), so it only checks while you're moving around and then stops pretty much immediately afterwards. |
I only now realized that you probably mean the thumbnail generation is faster. That is not what this is about at all. If I don't cripple my cpu by locking it to it's lowest frequency, I also get faster generation 😆. not.throttled.cpu.mp4And if that's still too slow for you, reducing the 100ms is also an option. We could even make it configurable. check.more.often.mp4But this PR is about the stuttering of the video playback while seeking around with thumbnails and not about the speed of thumbnail generation. |
Guilty as charged. Having actually tried thumbfast-seek-by-file.lua myself instead of relying on the initial video, I have to say I don't think #35 is any faster when it comes to thumbnail generation. I don't get any stuttering with #35 either when rapidly seeking for a longish amount of time on a 4k video but, yeah, Windows only. Sorry, I only felt compelled to comment because this being merged would've meant I wouldn't be able to use #35 but now I guess it doesn't matter. |
c117398
to
e11d240
Compare
After playing around with some small fast to decode files, there was some benefit to halving the file check rate from 100ms to 50ms (3/60s), but lower then that gives no practical benefit even for files with near instant seeking. But with recent complaints about cpu usage, maybe we should make it configurable? Also I've encountered cases where the timer got killed prematurely, so I gave it one additional period of slack to make sure that doesn't happen. |
e11d240
to
fbf8e0a
Compare
fb347e5
to
b0d498d
Compare
Will revisit this to allow seeking on mpv <0.33.0 on Linux without socat installed. |
5906691
to
8aa6faf
Compare
Note for myself, this way of getting the script path likely doesn't work with mpv <0.35.0 (before this commit mpv-player/mpv@84821db). |
Just like in my previous PR #41 I'm removing the interval and thumbnail count things because since we're not generating thumbnails in advance, they don't really make sense. Also removing them enables us to do exact seeks at the end of dragging.
Instead of seeking via commands sent through the socket, seek requests are now written to a file that is then read by the sub process. Not going though the socket has massive performance benefits.
Look how smooth it is now and compare it to the videos in #40.
smooth.mp4