VideoHelp Forum




+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 41 of 41
  1. "CUDA is not available"

    Do you have Nvidia card with drivers updated ?

    Do you have the dependencies installed ?
    https://github.com/HolyWu/vs-realesrgan

    NumPy , PyTorch with cuda ?
    Quote Quote  
  2. Originally Posted by poisondeathray View Post
    "CUDA is not available"

    Do you have Nvidia card with drivers updated ?

    Do you have the dependencies installed ?
    https://github.com/HolyWu/vs-realesrgan

    NumPy , PyTorch with cuda ?
    No, I only have Intel HD Graphic 530

    Numpy and pytorch have installed
    Last edited by kienkzz; 12th Feb 2022 at 00:06.
    Quote Quote  
  3. I think you can use device_type="cpu", but it will be slower

    https://github.com/HolyWu/vs-realesrgan/blob/master/vsrealesrgan/__init__.py

    device_type: Device type on which the tensor is allocated. Must be 'cuda' or 'cpu'.

    Many anime have duplicate frames; one way to speed it up is to decimate the duplicates (VFR), instead of upscaling duplicates
    Quote Quote  
  4. Originally Posted by kienkzz View Post
    The problem is that I don't know which script to use because those are too many, so I'm here to ask you guys
    I have never done an "anime" encoding.

    I said "search on the web", because I am sure you will find the exact script you need. Doom9 guys are the real experts.
    Quote Quote  
  5. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    I said "search on the web", because I am sure you will find the exact script you need. Doom9 guys are the real experts.
    Some Doom9 experts post here too, and poisondeathray is one of them. If he's helping, there is no need to search elsewhere
    Quote Quote  
  6. Since RealESRFAN using the cpu usually is way to slow to be useful, another approach would be to use glsl filters (ignoring intro&outro) to increase the sharpness a bit.
    (using Anime4Ks Darken, DeBlur and adaptive sharpening here)
    Code:
    # Imports
    import vapoursynth as vs
    # getting Vapoursynth core
    core = vs.core
    # Loading Plugins
    core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll")
    core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
    # source: 'E:\clips\[NanakoRaws] Delicious Party♡Precure - 01 (WEB-DL 1920x1080 x264 AAC).mp4'
    # current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, fps: 29.97, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
    # Loading E:\clips\[NanakoRaws] Delicious Party♡Precure - 01 (WEB-DL 1920x1080 x264 AAC).mp4 using LibavSMASHSource
    clip = core.lsmas.LibavSMASHSource(source="E:/clips/[NanakoRaws] Delicious Party♡Precure - 01 (WEB-DL 1920x1080 x264 AAC).mp4")
    # making sure input color matrix is set as 709
    clip = core.resize.Bicubic(clip, matrix_in_s="709",range_s="limited")
    # making sure frame rate is set to 29.970
    clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
    # Setting color range to TV (limited) range.
    clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
    # adjusting color space from YUV420P8 to YUV444P16 for vsGLSLAdaptiveSharpen
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited")
    with open("I:/Hybrid/64bit/vsfilters/GLSL/parameterized/adaptive-sharpen.glsl") as glslf:
      glsl = glslf.read()
    glsl = glsl.replace('#define curve_height    1.0', '#define curve_height    1.0000')
    glsl = glsl.replace('#define anime_mode      false', '#define anime_mode    true')
    glsl = glsl.replace('#define overshoot_ctrl  false', '#define overshoot_ctrl  false')
    glsl = glsl.replace('#define video_level_out false', '#define video_level_out false')
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=1920, height=1080)
    with open("I:/Hybrid/64bit/vsfilters/GLSL/parameterized/Anime4K_Deblur_Original.glsl") as glslf:
      glsl = glslf.read()
    glsl = glsl.replace('#define REFINE_STRENGTH 1.0', '#define REFINE_STRENGTH 100')
    glsl = glsl.replace('#define REFINE_BIAS 0.0', '#define REFINE_BIAS 0')
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=1920, height=1080)
    with open("I:/Hybrid/64bit/vsfilters/GLSL/parameterized/Anime4K_Darken_HQ.glsl") as glslf:
      glsl = glslf.read()
    glsl = glsl.replace('#define STRENGTH 1.5', '#define STRENGTH 3')
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=1920, height=1080)
    # adjusting output color from:  to YUV420P10 for x265Model
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, range_s="limited")
    # set output frame rate to 29.970fps
    clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
    # Output
    clip.set_output()



    (bonus: glsl filters are usually fast and only require opengl compatible cards)

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  7. Originally Posted by Selur View Post
    Since RealESRFAN using the cpu usually is way to slow to be useful, another approach would be to use glsl filters (ignoring intro&outro) to increase the sharpness a bit.
    (using Anime4Ks Darken, DeBlur and adaptive sharpening here)
    Code:
    # Imports
    import vapoursynth as vs
    # getting Vapoursynth core
    core = vs.core
    # Loading Plugins
    core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/Support/libvs_placebo.dll")
    core.std.LoadPlugin(path="I:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
    # source: 'E:\clips\[NanakoRaws] Delicious Party♡Precure - 01 (WEB-DL 1920x1080 x264 AAC).mp4'
    # current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, fps: 29.97, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
    # Loading E:\clips\[NanakoRaws] Delicious Party♡Precure - 01 (WEB-DL 1920x1080 x264 AAC).mp4 using LibavSMASHSource
    clip = core.lsmas.LibavSMASHSource(source="E:/clips/[NanakoRaws] Delicious Party♡Precure - 01 (WEB-DL 1920x1080 x264 AAC).mp4")
    # making sure input color matrix is set as 709
    clip = core.resize.Bicubic(clip, matrix_in_s="709",range_s="limited")
    # making sure frame rate is set to 29.970
    clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
    # Setting color range to TV (limited) range.
    clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
    # adjusting color space from YUV420P8 to YUV444P16 for vsGLSLAdaptiveSharpen
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited")
    with open("I:/Hybrid/64bit/vsfilters/GLSL/parameterized/adaptive-sharpen.glsl") as glslf:
      glsl = glslf.read()
    glsl = glsl.replace('#define curve_height    1.0', '#define curve_height    1.0000')
    glsl = glsl.replace('#define anime_mode      false', '#define anime_mode    true')
    glsl = glsl.replace('#define overshoot_ctrl  false', '#define overshoot_ctrl  false')
    glsl = glsl.replace('#define video_level_out false', '#define video_level_out false')
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=1920, height=1080)
    with open("I:/Hybrid/64bit/vsfilters/GLSL/parameterized/Anime4K_Deblur_Original.glsl") as glslf:
      glsl = glslf.read()
    glsl = glsl.replace('#define REFINE_STRENGTH 1.0', '#define REFINE_STRENGTH 100')
    glsl = glsl.replace('#define REFINE_BIAS 0.0', '#define REFINE_BIAS 0')
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=1920, height=1080)
    with open("I:/Hybrid/64bit/vsfilters/GLSL/parameterized/Anime4K_Darken_HQ.glsl") as glslf:
      glsl = glslf.read()
    glsl = glsl.replace('#define STRENGTH 1.5', '#define STRENGTH 3')
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=1920, height=1080)
    # adjusting output color from:  to YUV420P10 for x265Model
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, range_s="limited")
    # set output frame rate to 29.970fps
    clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
    # Output
    clip.set_output()



    (bonus: glsl filters are usually fast and only require opengl compatible cards)

    Cu Selur
    I have tried this but...
    Image
    [Attachment 63327 - Click to enlarge]
    Quote Quote  
  8. The glsl shaders for placebo.Shader have to be in mpv compatible syntax

    The path that you're using glsl-shaders-master/sharpen... suggests to me they were from a collection of shaders, but not in mpv format , probably this one
    https://github.com/libretro/glsl-shaders

    Use this one for adaptive-sharpen.glsl
    https://gist.github.com/HolyWu/72fbe92c2b4700243adb502526a88591
    Quote Quote  
  9. Originally Posted by poisondeathray View Post
    The glsl shaders for placebo.Shader have to be in mpv compatible syntax

    The path that you're using glsl-shaders-master/sharpen... suggests to me they were from a collection of shaders, but not in mpv format , probably this one
    https://github.com/libretro/glsl-shaders

    Use this one for adaptive-sharpen.glsl
    https://gist.github.com/HolyWu/72fbe92c2b4700243adb502526a88591
    The green video:

    Image
    [Attachment 63332 - Click to enlarge]


    Code:
    # Imports
    import vapoursynth as vs
    # getting Vapoursynth core
    core = vs.core
    # Loading Plugins
    core.std.LoadPlugin(path=r"E:\Video\Script\libvs_placebo.dll")
    core.std.LoadPlugin(path=r"E:\Video\Script\L-SMASH-Works_20210423\plugins64\LSMASHSource.dll")
    # source: 'E:\Video\[NanakoRaws] Delicious Party Precure - 01 (WEB-DL 1920x1080 x264 AAC).mp4'
    # current color space: YUV420P8, bit depth: 8, resolution: 1920x1080, fps: 29.97, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
    # Loading E:\Video\[NanakoRaws] Delicious Party Precure - 01 (WEB-DL 1920x1080 x264 AAC).mp4 using LibavSMASHSource
    clip = core.lsmas.LibavSMASHSource(source="E:/Video/[NanakoRaws] Delicious Party Precure - 01 (WEB-DL 1920x1080 x264 AAC).mp4")
    # making sure input color matrix is set as 709
    clip = core.resize.Bicubic(clip, matrix_in_s="709",range_s="limited")
    # making sure frame rate is set to 29.970
    clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
    # Setting color range to TV (limited) range.
    clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
    # adjusting color space from YUV420P8 to YUV444P16 for vsGLSLAdaptiveSharpen
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16, range_s="limited")
    with open("E:/Video/Script/adaptive-sharpen.glsl") as glslf:
      glsl = glslf.read()
    glsl = glsl.replace('#define curve_height    1.0', '#define curve_height    1.0000')
    glsl = glsl.replace('#define anime_mode      false', '#define anime_mode    true')
    glsl = glsl.replace('#define overshoot_ctrl  false', '#define overshoot_ctrl  false')
    glsl = glsl.replace('#define video_level_out false', '#define video_level_out false')
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=1920, height=1080)
    with open("E:/Video/Script/Anime4K_v4.0/Anime4K_Deblur_Original.glsl") as glslf:
      glsl = glslf.read()
    glsl = glsl.replace('#define REFINE_STRENGTH 1.0', '#define REFINE_STRENGTH 100')
    glsl = glsl.replace('#define REFINE_BIAS 0.0', '#define REFINE_BIAS 0')
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=1920, height=1080)
    with open("E:/Video/Script/Anime4K_v4.0/Anime4K_Darken_HQ.glsl") as glslf:
      glsl = glslf.read()
    glsl = glsl.replace('#define STRENGTH 1.5', '#define STRENGTH 3')
    clip = core.placebo.Shader(clip=clip, shader_s=glsl, width=1920, height=1080)
    # adjusting output color from:  to YUV420P10 for x265Model
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, range_s="limited")
    # set output frame rate to 29.970fps
    clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
    # Output
    clip.set_output()
    Quote Quote  
  10. "Failed creating GPU textures"

    Not sure , that script works for me with those shaders

    BTW you should decimate to 23.976 after the source filter , for any script version
    clip = core.tivtc.TDecimate(clip)

    That particular shader combination does not improve the aliasing (the broken / jaggy line problems) . I think Selur was using it to illustrate line darkening , deblur, sharpen filters
    Quote Quote  
  11. Yes, I mainly posted this to show an alternative route.
    libplacebo should work, without cuda.
    -> try updating your gpu drivers. (Windows defaults drivers may lack some features.)

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!