mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.63k stars 2.92k forks source link

mpv framerate tanks after resizing window #8613

Open alvv-z opened 3 years ago

alvv-z commented 3 years ago

Important Information

Provide following Information:

Reproduction steps

I have narrowed it down to being a one of cscale=ewa_lanczossharp, scale=ewa_lanczossharp and video-sync=display-resample. It sometimes happens with one enabled, and other times only with all. I have set hwdec=cuda, profile=gpu-hq, tscale=oversample, interpolation and ytdl-format=bestvideo[fps=60]+bestaudio/best in my mpv.conf

  1. stream a 60fps video
  2. resize window (e.g. fullscreen)
  3. wait

Expected behavior

Log file

Log

haasn commented 3 years ago

Can you open the stats overlay (shift+i) while mpv is slow, switch to the second screen (2), and take a picture of that? Would help figuring out if there's some specific shader causing problems for you.

alvv-z commented 3 years ago

I have uploaded the screenshot here. This was with estimated 40fps. The slowdown seems to happen much faster when streaming a livestream (1 - 10mins) than a video (45mins - 2hours).

haasn commented 3 years ago

That screenshot shows the average performance being fine but it seems to randomly spike up to very high frame latencies. Do you know what could be causing those spikes?

alvv-z commented 3 years ago

No clue, it happens even when mpv is the only thing running in the foreground

Dudemanguy commented 1 year ago

Does this issue still occur?

Jules-A commented 1 year ago

Does this issue still occur?

Don't know about this specific issue but I've noticed small permanent framerate decreases after resizing sometimes and also if I resize quickly in succession a few times it can cause large frame-rate decreases rarely. Using local file/Win10/DX11 hwdec.

Dudemanguy commented 1 year ago

small permanent framerate decreases after resizing sometimes

That sounds unexpected and bizarre assuming that you aren't resizing the window to some size your GPU can't handle.

if I resize quickly in succession a few times it can cause large frame-rate decreases rarely

This sounds a bit more normal. If you resize a bunch quickly, yeah it can potentially tank the frame rate. As long as you recover it should be fine.

Anyways, OPs issue sounds like something that shouldn't normally happen (his GPU certainly isn't weak or anything). It could just be a driver issue that hopefully is fixed by now given that this issue is fairly old.

Jules-A commented 1 year ago

That sounds unexpected and bizarre assuming that you aren't resizing the window to some size your GPU can't handle.

Might have something to do with my settings, they usually use around 60% of my GPU ``` profile=gpu-hq hwdec=auto-safe scale=ewa_lanczossharp cscale=ewa_lanczossharp dscale=mitchell tscale=oversample video-sync=display-resample interpolation cursor-autohide=320 #fullscreen #gpu-api=vulkan #vo=gpu-next snap-window geometry=2560x1400 no-border cache=yes cache-pause-initial=yes cache-pause-wait=2 cache-secs=480 demuxer-max-bytes=120000KiB demuxer-readahead-secs=480 demuxer-hysteresis-secs=90 prefetch-playlist=yes volume-max=100 deband=yes deband-iterations=2 deband-threshold=48 deband-range=18 deband-grain=2 sub-auto=fuzzy slang=en,enUS,en-US,en-ja sub-scale=0.5 sub-ass-override=no save-position-on-quit [morethan540p] profile-desc=Shaders for >540p profile-cond=height > 540 glsl-shaders="~~/shaders/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K_Denoise_Bilateral_Median3.glsl;~~/shaders/Anime4K_Restore_CNN_S.glsl;~~/shaders/Anime4K_DarkLines_HQ3.glsl;~~/shaders/Anime4K_ThinLines_HQ3.glsl;~~/shaders/Anime4K_Restore_CNN_Soft_L.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_L.glsl" [540p] profile-desc=Shaders for ~540p profile-cond=height <= 540 profile-cond=height > 480 glsl-shaders="~~/shaders/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K_Restore_CNN_VL.glsl;~~/shaders/Anime4K_ThinLines_HQ4.glsl;~~/shaders/Anime4K_Restore_CNN_Soft_VL.glsl;~~/shaders/Anime4K_AutoDownscalePre_x2.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl;~~/shaders/Anime4K_Restore_CNN_Soft_VL.glsl" [480p] profile-desc=Shaders for ~480p profile-cond=height <= 480 profile-cond=height > 360 glsl-shaders="~~/shaders/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K_Restore_CNN_VL.glsl;~~/shaders/Anime4K_ThinLines_HQ4.glsl;~~/shaders/Anime4K_Restore_CNN_Soft_VL.glsl;~~/shaders/Anime4K_AutoDownscalePre_x2.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl;~~/shaders/Anime4K_Restore_CNN_Soft_VL.glsl;~~/shaders/Anime4K_AutoDownscalePre_x2.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_L.glsl" [360p] profile-desc=Shaders for 360p or lower profile-cond=height <= 360 glsl-shaders="~~/shaders/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K_Restore_CNN_VL.glsl;~~/shaders/Anime4K_ThinLines_HQ4.glsl;~~/shaders/Anime4K_Restore_CNN_Soft_VL.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_VL.glsl;~~/shaders/Anime4K_Restore_CNN_Soft_VL.glsl" ```

This sounds a bit more normal. If you resize a bunch quickly, yeah it can potentially tank the frame rate. As long as you recover it should be fine.

Ah no, sometimes it doesn't recover, although I haven't seen it happen in a while but usually I just restart MPV.

alvv-z commented 1 year ago

Does this issue still occur?

Yep. Additionally, sometimes my DE crashes and boots me to the login screen when going to full-screen, but this seems to be a more recent development.

Dudemanguy commented 1 year ago

Additionally, sometimes my DE crashes and boots me to the login screen when going to full-screen, but this seems to be a more recent development.

I think we can safely blame our friends at NVIDIA for that one at least. There's no way we could be causing that.