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

cache loading speed #213

Open
thcehocai opened this issue Nov 14, 2024 · 16 comments
Open

cache loading speed #213

thcehocai opened this issue Nov 14, 2024 · 16 comments
Labels
feature request New feature or request planned Implementation of this behavior will be added in the future

Comments

@thcehocai
Copy link

Expected behavior of the wanted feature

May I ask if the cache loading speed can be displayed? For example, 1MB/s?

@thcehocai thcehocai added the feature request New feature or request label Nov 14, 2024
@Samillion
Copy link
Owner

Samillion commented Nov 14, 2024

Technically it might be possible, but this needs to be requested at mpv.

Since yt-dlp already shows download speed, ie:

[download]   0.5% of  247.24MiB at 30.59MiB/s ETA 00:30

mpv would need to add a property to display such information. ie: ytdl/current/speed and ytdl/current/eta

If one exists though, let me know and I'll gladly implement it

@thcehocai
Copy link
Author

Sorry, I'm not very familiar with everything about MPV, but the official documentation includes cache speed: Current I/O read speed between the cache and the lower layer (like network) This gives the number bytes per second over a 1 second window (using the type MPV_FORM-INT64 for the client API). I don't know how to call this parameter to display it.

@Samillion
Copy link
Owner

Oh, true! https://mpv.io/manual/master/#command-interface-cache-speed

I'll play around with it and come up with an implementation soon.

@thcehocai
Copy link
Author

Thank you very much!

@Samillion Samillion added the planned Implementation of this behavior will be added in the future label Nov 14, 2024
@thcehocai
Copy link
Author

thcehocai commented Nov 14, 2024

Also, how to set OSC not to display when the mouse is moved to the top of the screen? I have removed all the controls at the top of the screen and set bottomhover=yes, so the movement of the mouse at the top and in the middle should not trigger the display of OSC,But it will still trigger.

@Keith94
Copy link
Contributor

Keith94 commented Nov 14, 2024

movement of the mouse at the top and in the middle should not trigger the display of OSC,But it will still trigger.

Definitely an oversight possibly carried over from previous forks. Would have to be fixed in the code or as part of #212

On the topic of cache maybe could add cache duration as well and combine it together with cache speed? Like show duration as a tooltip of it or vice versa.

Don't know how Sam plans to add it, either with text element before the remaining/total timestamp or something else.

@Samillion
Copy link
Owner

Don't know how Sam plans to add it, either with text element before the remaining/total timestamp or something else.

Exactly what I was thinking. My initial idea was to add the same cache element as stock osc (cached time), and next to it a cache speed element.

Displayed as:

[cached time] / [cache speed] • [remaining time]

Options:

cache_time = true,
cache_speed = true,

@Samillion
Copy link
Owner

Also, how to set OSC not to display when the mouse is moved to the top of the screen? I have removed all the controls at the top of the screen and set bottomhover=yes, so the movement of the mouse at the top and in the middle should not trigger the display of OSC,But it will still trigger.

Nice catch! Should be fixed soon. #216

@Keith94
Copy link
Contributor

Keith94 commented Nov 14, 2024

I think it would work well, since the text should be pretty small and wouldn't take up a lot of room even in a theoretical "compact mode," or it could be adjusted as necessary for different layouts.

@thcehocai
Copy link
Author

There is another issue. When I use external subtitles, some subtitles are too low or too high. I adjust the sub position for a more comfortable viewing experience. However, if I set raise_subtitles=yes, the sub position will return to the default 100% position after OSC is hidden, which forces me to adjust it again. Is there any way to solve it?

@Keith94
Copy link
Contributor

Keith94 commented Nov 15, 2024

It seems the function adjust_subtitles modifies sub-pos value and doesn't properly take into account if you use hotkeys like r and R to change the sub-pos.

ModernZ/modernz.lua

Lines 1967 to 1968 in 3135a35

elseif user_opts.raise_subtitles then
mp.commandv("set", "sub-pos", 100)

Looks like it's setting it back to 100 I believe.

Temporary workaround, you can add sub-margin-y=<value> in mpv.conf. This property should have no issues when using raise_subtitles

@Keith94
Copy link
Contributor

Keith94 commented Nov 15, 2024

There should probably be additional logic added to the function so that raise_subtitles doesn't do anything if subtitles are already positioned high enough (maybe a threshold of x amount of pixels or percentage) above the OSC.

@thcehocai
Copy link
Author

thcehocai commented Nov 15, 2024

Is it possible to keep subtitles at a fixed distance from the bottom when they are raised, without relying on sub_position? Alternatively, if you want to use sub_position, add a setting to use a user-defined parameter when raising subtitles. For example, if the user sets this parameter to sub_position=80%, it will be used when raising subtitles.In this case, a variable needs to be used to record the sub-position of the user during normal viewing, such as sub-position=103%, in order to return to it when hiding OSC.

@Keith94
Copy link
Contributor

Keith94 commented Nov 15, 2024

It's a good idea; have to wait for the owner @Samillion to fix that at some point 😄

@Samillion
Copy link
Owner

There is another issue. When I use external subtitles, some subtitles are too low or too high. I adjust the sub position for a more comfortable viewing experience. However, if I set raise_subtitles=yes, the sub position will return to the default 100% position after OSC is hidden, which forces me to adjust it again. Is there any way to solve it?

Could you open another bug issue about this, please? Otherwise I might forget due to workload.

@Samillion
Copy link
Owner

Also, how to set OSC not to display when the mouse is moved to the top of the screen? I have removed all the controls at the top of the screen and set bottomhover=yes, so the movement of the mouse at the top and in the middle should not trigger the display of OSC,But it will still trigger.

I've applied a fix for it in #220

In modernz.conf if you set

window_top_bar=no

or

window_title=no
window_controls=no

It will not show osc if you hover in the top window area

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request planned Implementation of this behavior will be added in the future
Projects
None yet
Development

No branches or pull requests

3 participants