In Vapoursynth, it is convenient to download and use plugins to change the frame rate of videos. However, it seems that using FFmpeg has more limitations (or maybe I haven't found the right method). Anime4K is a video enhancement algorithm suitable for anime and similar videos. In MPV, their plugins can be imported and used for real-time frame rate conversion.
In FFmpeg, how can I use the algorithms in glsl files to change the video frame rate, instead of using FFmpeg's built-in algorithms?
In FFmpeg, i can use libplacebo filters can also be used to apply GLSL shaders. In my tests, using command like:
libplacebo=custom_shader_path=Anime4K_Upscale_CNN_x2_VL.glsl
this leads to noticeable GPU usage, but the output video resolution remains the same as the original.
I can pass in the w and h parameters when calling the libplacebo filter:
libplacebo=w=iw*2:h=ih*2:custom_shader_path=shaders/Anime4K_Upscale_CNN_x2_VL.glsl
This achieves the purpose of super resolution, but is it essentially using anime4k for upscaling behind the processing? Is it using the upscaling algorithm in libplacebo first, before applying anime4k? How can I achieve my original goal that only use anime4k to upscale? here's my full command (in python):
[
'ffmpeg -hide_banner',
'-hwaccel', 'cuda',
'-i', '"{input_ab_path}"',
'-filter_complex',
'"[0:v]libplacebo=custom_shader_path=libplacebo=custom_shader_path=shaders/Anime4K_Upscale_CNN_x2_VL.glsl,subtitles="{sub_file}":si=0[out]"',
'-map', '0:a',
'-map', '"[out]"',
'-c:v', 'libsvtav1',
'-svtav1-params', 'scm=2:scd=1:enable-overlays=1:enable-tf=0:tune=0:preset=7:crf=18',
'-c:a', 'libvorbis',
'-qscale:a', '10',
'-pix_fmt', 'yuv420p10le',
'-y', '"{output_ab_path}"'
]