bloc97 / Anime4K

A High-Quality Real Time Upscaler for Anime Video
https://bloc97.github.io/Anime4K/
MIT License
17.98k stars 1.34k forks source link

Anime4K GAN shaders cause video to freeze #174

Closed duelistgamer closed 1 year ago

duelistgamer commented 2 years ago

Describe the bug I added the following line to my mpv input.conf

CTRL+8 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Restore_GAN_UUL.glsl:~~/shaders/Anime4K_Upscale_GAN_x4_UUL.glsl:~~/shaders/Anime4K_Restore_CNN_Soft_M.glsl:~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl"; show-text "Anime4K: Mode GAN (HQ)" Upon pressing CTRL+8, the video freezes while audio continues as normal. I am not even able to control mpv as normal and instead have to kill the process on the terminal.

To Reproduce Steps to reproduce the behavior:

  1. Add the above line to your mpv config.
  2. Play a low res anime show
  3. Activate the shader
  4. See error

Expected behavior I expected the video to be upscaled to some degree.

Screenshots Unable to take screenshots as the display just completely freezes.

Desktop (please complete the following information):

Additional context This was done using the latest pull of the master branch of Anime4k.

An semi-blindly edited config based on mode A with the CNN stages replaced with GAN seems to work, although the results are not as nice as I'd want.

CTRL+7 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Clamp_Highlights.glsl:~~/shaders/Anime4K_Restore_GAN_UL.glsl:~~/shaders/Anime4K_Upscale_GAN_x2_M.glsl:~~/shaders/Anime4K_AutoDownscalePre_x2.glsl:~~/shaders/Anime4K_AutoDownscalePre_x4.glsl:~~/shaders/Anime4K_Upscale_GAN_x2_M.glsl"; show-text "Anime4K: Mode GAN"

oiG8Uchi commented 1 year ago

I have the same situation on my pc (gentoo linux, 6800xt) When switching to GAN, the playback stops. mpv does not display any valid information. At this time, I can terminate mpv playback by pressing ctrl+c twice in the terminal.

yooooooLeon commented 1 year ago

您的邮件已收到!谢谢!

bloc97 commented 1 year ago

This sounds like a shader compilation problem... Is the CPU being used when the display freezes? And how long does the display freeze for? First time shader compilation should complete at worst within ~2 minutes even with a slow, but modern CPU. Is there intermittent unfreezes or is it completely frozen solid for a long time?

oiG8Uchi commented 1 year ago

I re-tested once and after switching to GAN and waiting more than 5 minutes MPV showed: "[vo/gpu/opengl] shader link log (status=0): error: insufficient contiguous locations available for vertex shader input `vertex_texcoord15' " During this period, the cpu usage of mpv has been at 100%(my pc cpu is 5950x)

bloc97 commented 1 year ago

Maybe the latest generation of GPUs' drivers have some issues with mpv, have you tried using the Vulkan renderer --gpu-api=vulkan instead of OpenGL, or tried the new experimental backend --vo=gpu-next?

oiG8Uchi commented 1 year ago

after trying --gpu-api=vulkan it can be played normally, but the --vo=gpu-next option is not found. The version of mpv is 0.34.1

bloc97 commented 1 year ago

after trying --gpu-api=vulkan it can be played normally, but the --vo=gpu-next option is not found. The version of mpv is 0.34.1

Great, that's fine as gpu-next is currently in development and only available for testing in the latest nightly builds of mpv.

duelistgamer commented 1 year ago

Thanks for the help, --gpu-api=vulkan definitely works!