vivy: tv: common: use amazon vbr for dehardsubbing
This commit is contained in:
parent
61544e9ba1
commit
cbc43f8395
@ -16,6 +16,7 @@ DATAPATH: str = os.path.dirname(__file__)
|
|||||||
WAKA_RU_FILENAME: str = f"{TITLE}_{{epnum:02d}}_RU_HD.mp4"
|
WAKA_RU_FILENAME: str = f"{TITLE}_{{epnum:02d}}_RU_HD.mp4"
|
||||||
WAKA_FR_FILENAME: str = f"{TITLE}_{{epnum:02d}}_FR_HD.mp4"
|
WAKA_FR_FILENAME: str = f"{TITLE}_{{epnum:02d}}_FR_HD.mp4"
|
||||||
WAKA_DE_FILENAME: str = f"{TITLE} - Fluorite Eyes Song E{{epnum:02d}} [1080p][AAC][JapDub][GerSub][Web-DL].mkv"
|
WAKA_DE_FILENAME: str = f"{TITLE} - Fluorite Eyes Song E{{epnum:02d}} [1080p][AAC][JapDub][GerSub][Web-DL].mkv"
|
||||||
|
AMAZON_FILENAME: str = "{title_long} - {epnum:02d} (Amazon Prime VBR {resolution}p).mkv"
|
||||||
|
|
||||||
|
|
||||||
core = vs.core
|
core = vs.core
|
||||||
@ -37,11 +38,11 @@ class VivySource(source.FunimationSource):
|
|||||||
# ep1-3 have good funi video, let's just use that
|
# ep1-3 have good funi video, let's just use that
|
||||||
if self.config.epnum < 4:
|
if self.config.epnum < 4:
|
||||||
raise FileNotFoundError()
|
raise FileNotFoundError()
|
||||||
if not os.path.isfile(self.config.format_filename(source.AMAZON_FILENAME)):
|
if not os.path.isfile(self.config.format_filename(AMAZON_FILENAME)):
|
||||||
log.warn("Amazon not found, falling back to Funimation")
|
log.warn("Amazon not found, falling back to Funimation")
|
||||||
raise FileNotFoundError()
|
raise FileNotFoundError()
|
||||||
log.success("Found Amazon video")
|
log.success("Found Amazon video")
|
||||||
return core.ffms2.Source(self.config.format_filename(source.AMAZON_FILENAME))
|
return core.ffms2.Source(self.config.format_filename(AMAZON_FILENAME))
|
||||||
|
|
||||||
def get_waka_filenames(self) -> List[str]:
|
def get_waka_filenames(self) -> List[str]:
|
||||||
return [self.config.format_filename(f) for f in [
|
return [self.config.format_filename(f) for f in [
|
||||||
|
@ -16,7 +16,8 @@ core = vs.core
|
|||||||
FSRCNNX = os.path.join(os.path.dirname(__file__), "shaders/FSRCNNX_x2_56-16-4-1.glsl")
|
FSRCNNX = os.path.join(os.path.dirname(__file__), "shaders/FSRCNNX_x2_56-16-4-1.glsl")
|
||||||
|
|
||||||
|
|
||||||
def fsrcnnx_rescale(src: vs.VideoNode, noscale: Optional[List[Range]] = None) -> vs.VideoNode:
|
def fsrcnnx_rescale(src: vs.VideoNode, noscale: Optional[List[Range]] = None,
|
||||||
|
kernel: Optional[lvf.kernels.Kernel] = None) -> vs.VideoNode:
|
||||||
def _vdf_fsrcnnx(clip: vs.VideoNode, width: int, height: int) -> vs.VideoNode:
|
def _vdf_fsrcnnx(clip: vs.VideoNode, width: int, height: int) -> vs.VideoNode:
|
||||||
clip = core.std.ShufflePlanes([vsutil.depth(clip.resize.Point(vsutil.get_w(864), 864), 16),
|
clip = core.std.ShufflePlanes([vsutil.depth(clip.resize.Point(vsutil.get_w(864), 864), 16),
|
||||||
src.resize.Bicubic(vsutil.get_w(864), 864)],
|
src.resize.Bicubic(vsutil.get_w(864), 864)],
|
||||||
@ -24,7 +25,8 @@ def fsrcnnx_rescale(src: vs.VideoNode, noscale: Optional[List[Range]] = None) ->
|
|||||||
|
|
||||||
return vsutil.get_y(vsutil.depth(vdf.fsrcnnx_upscale(clip, width, height, FSRCNNX), 32))
|
return vsutil.get_y(vsutil.depth(vdf.fsrcnnx_upscale(clip, width, height, FSRCNNX), 32))
|
||||||
|
|
||||||
descale = lvf.scale.descale(src, height=864, upscaler=_vdf_fsrcnnx, kernel=lvf.kernels.Bicubic()) \
|
kernel = kernel if kernel else lvf.kernels.Bicubic()
|
||||||
|
descale = lvf.scale.descale(src, height=864, upscaler=_vdf_fsrcnnx, kernel=kernel) \
|
||||||
.resize.Bicubic(format=vs.YUV420P16)
|
.resize.Bicubic(format=vs.YUV420P16)
|
||||||
return lvf.misc.replace_ranges(descale, src, noscale) if noscale else descale
|
return lvf.misc.replace_ranges(descale, src, noscale) if noscale else descale
|
||||||
|
|
||||||
@ -34,8 +36,8 @@ def letterbox_edgefix(clip: vs.VideoNode, ranges: List[Range]) -> vs.VideoNode:
|
|||||||
return lvf.misc.replace_ranges(clip, edgefix, ranges)
|
return lvf.misc.replace_ranges(clip, edgefix, ranges)
|
||||||
|
|
||||||
|
|
||||||
def denoise(clip: vs.VideoNode) -> vs.VideoNode:
|
def denoise(clip: vs.VideoNode, sigma: float = 0.75) -> vs.VideoNode:
|
||||||
bm3d = BM3D(clip, sigma=[1.5, 0], depth=16)
|
bm3d = BM3D(clip, sigma=[sigma, 0], depth=16)
|
||||||
knl = core.knlm.KNLMeansCL(clip, d=3, a=2, h=0.4, channels="UV", device_type='gpu', device_id=0)
|
knl = core.knlm.KNLMeansCL(clip, d=3, a=2, h=0.4, channels="UV", device_type='gpu', device_id=0)
|
||||||
return core.std.ShufflePlanes([bm3d, knl], planes=[0, 1, 2], colorfamily=vs.YUV)
|
return core.std.ShufflePlanes([bm3d, knl], planes=[0, 1, 2], colorfamily=vs.YUV)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user