5
0

tensura: s2: bd: vol1 zoning and vol2

This commit is contained in:
louis f 2021-06-03 19:48:41 -04:00
parent 1a96b0f09e
commit 010673efa4
Signed by: louis
GPG Key ID: 44D7E1DE4E23D6F2
19 changed files with 781 additions and 27 deletions

View File

@ -1,8 +1,8 @@
import vapoursynth as vs
from tensura_common import TenSuraConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner
from yt_common.automation import SelfRunner, Zone
from yt_common.chapters import Chapter
from yt_common.source import FileTrim, SimpleSource
@ -15,7 +15,7 @@ from typing import List, Tuple
import os
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
CONFIG: TenSuraConfig = TenSuraConfig(EPNUM)
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(EPNUM)
BDMV: str = "../bdmv/[BDMV][210326][Tensei Shitara Slime Datta Ken 2nd Season][Vol.1]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource(
FileTrim(os.path.join(BDMV, "00006.m2ts"), (24, -50))
@ -35,6 +35,11 @@ NOD3: List[Range] = [
(33926, 34045),
]
ZONES: List[Zone] = [
]
ZONES += [Zone(r, 0.75) for r in NOD3 if isinstance(r, tuple)]
AA_STRONG: List[Range] = [
(15605, 15772),
]
@ -88,6 +93,6 @@ def filter() -> vs.VideoNode:
if __name__ == "__main__":
SelfRunner(CONFIG, SOURCE, filter, chapters=CHAPTERS)
SelfRunner(CONFIG, SOURCE, filter, chapters=CHAPTERS, zones=ZONES)
else:
filter()

View File

@ -1,6 +1,6 @@
import vapoursynth as vs
from tensura_common import TenSuraConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner
from yt_common.chapters import Chapter
@ -14,7 +14,7 @@ from typing import List
import os
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
CONFIG: TenSuraConfig = TenSuraConfig(EPNUM)
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(EPNUM)
BDMV: str = "../bdmv/[BDMV][210326][Tensei Shitara Slime Datta Ken 2nd Season][Vol.1]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource(
FileTrim(os.path.join(BDMV, "00007.m2ts"), (None, -49))

View File

@ -1,8 +1,8 @@
import vapoursynth as vs
from tensura_common import TenSuraConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner
from yt_common.automation import SelfRunner, Zone
from yt_common.chapters import Chapter
from yt_common.source import FileTrim, SimpleSource
@ -14,7 +14,7 @@ from typing import List
import os
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
CONFIG: TenSuraConfig = TenSuraConfig(EPNUM)
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(EPNUM)
BDMV: str = "../bdmv/[BDMV][210326][Tensei Shitara Slime Datta Ken 2nd Season][Vol.1]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource(
FileTrim(os.path.join(BDMV, "00008.m2ts"), (None, -50))
@ -34,6 +34,11 @@ NOD3: List[Range] = [
(33926, 34045),
]
ZONES: List[Zone] = [
]
ZONES += [Zone(r, 0.75) for r in NOD3 if isinstance(r, tuple)]
AA_STRONG: List[Range] = [
(3084, 3125),
]
@ -60,6 +65,6 @@ def filter() -> vs.VideoNode:
if __name__ == "__main__":
SelfRunner(CONFIG, SOURCE, filter, chapters=CHAPTERS)
SelfRunner(CONFIG, SOURCE, filter, chapters=CHAPTERS, zones=ZONES)
else:
filter()

View File

@ -1,6 +1,6 @@
import vapoursynth as vs
from tensura_common import TenSuraConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner
from yt_common.chapters import Chapter
@ -15,7 +15,7 @@ from typing import List, Tuple
import os
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
CONFIG: TenSuraConfig = TenSuraConfig(EPNUM)
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(EPNUM)
BDMV: str = "../bdmv/[BDMV][210326][Tensei Shitara Slime Datta Ken 2nd Season][Vol.1]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource(
FileTrim(os.path.join(BDMV, "00009.m2ts"), (None, -51))

View File

@ -1,6 +1,6 @@
import vapoursynth as vs
from tensura_common import TenSuraConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner
from yt_common.chapters import Chapter
@ -15,7 +15,7 @@ from typing import List, Tuple
import os
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
CONFIG: TenSuraConfig = TenSuraConfig(EPNUM)
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(EPNUM)
BDMV: str = "../bdmv/[BDMV][210326][Tensei Shitara Slime Datta Ken 2nd Season][Vol.1]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource(
FileTrim(os.path.join(BDMV, "00010.m2ts"), (None, -24))

View File

@ -1,8 +1,8 @@
import vapoursynth as vs
from tensura_common import TenSuraConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner
from yt_common.automation import SelfRunner, Zone
from yt_common.chapters import Chapter
from yt_common.source import FileTrim, SimpleSource
@ -15,7 +15,7 @@ from typing import List, Tuple
import os
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
CONFIG: TenSuraConfig = TenSuraConfig(EPNUM)
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(EPNUM)
BDMV: str = "../bdmv/[BDMV][210326][Tensei Shitara Slime Datta Ken 2nd Season][Vol.1]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource(
FileTrim(os.path.join(BDMV, "00011.m2ts"), (24, -25))
@ -35,6 +35,11 @@ NOD3: List[Range] = [
(33927, 34046),
]
ZONES: List[Zone] = [
]
ZONES += [Zone(r, 0.75) for r in NOD3 if isinstance(r, tuple)]
AA_STRONG: List[Range] = [
(11640, 11685),
(12437, 12488),
@ -85,6 +90,6 @@ def filter() -> vs.VideoNode:
if __name__ == "__main__":
SelfRunner(CONFIG, SOURCE, filter, chapters=CHAPTERS)
SelfRunner(CONFIG, SOURCE, filter, chapters=CHAPTERS, zones=ZONES)
else:
filter()

View File

@ -0,0 +1,74 @@
import vapoursynth as vs
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner, Zone
from yt_common.chapters import Chapter
from yt_common.source import FileTrim, SimpleSource
from lvsfunc.mask import BoundingBox
from lvsfunc.misc import replace_ranges
from lvsfunc.types import Range
from typing import List, Tuple
import os
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(EPNUM)
BDMV: str = "../bdmv/[BDMV][210526][Tensei Shitara Slime Datta Ken 2nd Season][Vol.2]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource(
FileTrim(os.path.join(BDMV, "00006.m2ts"), (24, -50))
)
CHAPTERS: List[Chapter] = [
Chapter("Intro", 0),
Chapter("OP", 408),
Chapter("Part A", 2566),
Chapter("Part B", 14745),
Chapter("ED", 31768),
Chapter("Next", 33926),
]
NOD3: List[Range] = [
(12870, 13394),
(33926, 34045),
]
ZONES: List[Zone] = [
]
ZONES += [Zone(r, 0.75) for r in NOD3 if isinstance(r, tuple)]
AA_STRONG: List[Range] = [
(15848, 15925),
]
SANGNOM: List[Tuple[Range, List[BoundingBox]]] = [
]
DEBAND_NUCLEAR: List[Range] = [
]
core = vs.core
def filter() -> vs.VideoNode:
src = SOURCE.source()
ef = edgefix(src)
den = denoise(ef)
descaled = descale(den)
deb = deband(descaled, nuclear=DEBAND_NUCLEAR)
deb = replace_ranges(deb, src, NOD3)
aa = antialias(deb, strong=AA_STRONG, sangnom=SANGNOM)
grain = regrain(aa)
final = finalize(grain)
src.set_output(1)
final.set_output(0)
return final
if __name__ == "__main__":
SelfRunner(CONFIG, SOURCE, filter, chapters=CHAPTERS, zones=ZONES)
else:
filter()

View File

@ -0,0 +1,77 @@
import vapoursynth as vs
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner, Zone
from yt_common.chapters import Chapter
from yt_common.source import FileTrim, SimpleSource
from lvsfunc.mask import BoundingBox
from lvsfunc.misc import replace_ranges
from lvsfunc.types import Range
from typing import List, Tuple
import os
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(EPNUM)
BDMV: str = "../bdmv/[BDMV][210526][Tensei Shitara Slime Datta Ken 2nd Season][Vol.2]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource(
FileTrim(os.path.join(BDMV, "00007.m2ts"), (None, -51))
)
CHAPTERS: List[Chapter] = [
Chapter("Intro", 0),
Chapter("OP", 3237),
Chapter("Part A", 5395),
Chapter("Part B", 16255),
Chapter("ED", 31767),
Chapter("Next", 33925),
]
NOD3: List[Range] = [
(20345, 20471),
(23716, 23971),
(26714, 26869),
(33925, 34044),
]
ZONES: List[Zone] = [
]
ZONES += [Zone(r, 0.75) for r in NOD3 if isinstance(r, tuple)]
AA_STRONG: List[Range] = [
(8606, 8677),
(26138, 26245),
]
SANGNOM: List[Tuple[Range, List[BoundingBox]]] = [
]
DEBAND_NUCLEAR: List[Range] = [
]
core = vs.core
def filter() -> vs.VideoNode:
src = SOURCE.source()
ef = edgefix(src)
den = denoise(ef)
descaled = descale(den)
deb = deband(descaled, nuclear=DEBAND_NUCLEAR)
deb = replace_ranges(deb, src, NOD3)
aa = antialias(deb, strong=AA_STRONG, sangnom=SANGNOM)
grain = regrain(aa)
final = finalize(grain)
src.set_output(1)
final.set_output(0)
return final
if __name__ == "__main__":
SelfRunner(CONFIG, SOURCE, filter, chapters=CHAPTERS, zones=ZONES)
else:
filter()

View File

@ -0,0 +1,67 @@
import vapoursynth as vs
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner
from yt_common.chapters import Chapter
from yt_common.source import FileTrim, SimpleSource
from lvsfunc.mask import BoundingBox
from lvsfunc.misc import replace_ranges
from lvsfunc.types import Range
from typing import List, Tuple
import os
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(EPNUM)
BDMV: str = "../bdmv/[BDMV][210526][Tensei Shitara Slime Datta Ken 2nd Season][Vol.2]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource(
FileTrim(os.path.join(BDMV, "00008.m2ts"), (None, -50))
)
CHAPTERS: List[Chapter] = [
Chapter("Intro", 0),
Chapter("OP", 384),
Chapter("Part A", 2542),
Chapter("Part B", 17766),
Chapter("ED", 31768),
Chapter("Next", 33926),
]
NOD3: List[Range] = [
(33926, 34045),
]
AA_STRONG: List[Range] = [
]
SANGNOM: List[Tuple[Range, List[BoundingBox]]] = [
]
DEBAND_NUCLEAR: List[Range] = [
]
core = vs.core
def filter() -> vs.VideoNode:
src = SOURCE.source()
ef = edgefix(src)
den = denoise(ef)
descaled = descale(den)
deb = deband(descaled, nuclear=DEBAND_NUCLEAR)
deb = replace_ranges(deb, src, NOD3)
aa = antialias(deb, strong=AA_STRONG, sangnom=SANGNOM)
grain = regrain(aa)
final = finalize(grain)
src.set_output(1)
final.set_output(0)
return final
if __name__ == "__main__":
SelfRunner(CONFIG, SOURCE, filter, chapters=CHAPTERS)
else:
filter()

View File

@ -0,0 +1,87 @@
import vapoursynth as vs
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner
from yt_common.chapters import Chapter, Edition
from yt_common.source import FileTrim, SimpleSource
from lvsfunc.mask import BoundingBox
from lvsfunc.misc import replace_ranges
from lvsfunc.types import Range
from typing import List, Tuple
import os
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(EPNUM)
BDMV: str = "../bdmv/[BDMV][210526][Tensei Shitara Slime Datta Ken 2nd Season][Vol.2]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource([
FileTrim(os.path.join(BDMV, "00009.m2ts"), (None, None)),
FileTrim(os.path.join(BDMV, "00010.m2ts"), (None, -49)),
FileTrim(os.path.join(BDMV, "00016.m2ts"), (13348, 15699)),
FileTrim(os.path.join(BDMV, "00016.m2ts"), (17721, 17982)),
], asrc=[
# NC version has different (quieter) audio, so make sure we use the regular version
FileTrim(os.path.join(BDMV, "00009.m2ts"), (None, None)),
FileTrim(os.path.join(BDMV, "00010.m2ts"), (None, -49)),
FileTrim(os.path.join(BDMV, "00010.m2ts"), (13348, 15699)),
FileTrim(os.path.join(BDMV, "00010.m2ts"), (17721, 17982)),
])
EDITIONS: List[Edition] = [
Edition(chapters=[
Chapter("Intro", 0),
Chapter("OP", 2134),
Chapter("Part A", 4293),
Chapter("Part B", 16065),
Chapter("Next", 34047, 34167),
], default=True, ordered=True),
Edition(chapters=[
Chapter("Intro", 0),
Chapter("OP", 2134),
Chapter("Part A", 4293),
Chapter("Part B", 16065, 29413),
Chapter("Part B - NC", 34167, 36518),
Chapter("Part B", 31764, 33786),
Chapter("Part B - NC", 36518, -1),
Chapter("Next", 34047, 34167),
], default=False, ordered=True),
]
NOD3: List[Range] = [
(34047, 34166),
]
AA_STRONG: List[Range] = [
]
SANGNOM: List[Tuple[Range, List[BoundingBox]]] = [
]
DEBAND_NUCLEAR: List[Range] = [
]
core = vs.core
def filter() -> vs.VideoNode:
src = SOURCE.source()
ef = edgefix(src)
den = denoise(ef)
descaled = descale(den)
deb = deband(descaled, nuclear=DEBAND_NUCLEAR)
deb = replace_ranges(deb, src, NOD3)
aa = antialias(deb, strong=AA_STRONG, sangnom=SANGNOM)
grain = regrain(aa)
final = finalize(grain)
src.set_output(1)
final.set_output(0)
return final
if __name__ == "__main__":
SelfRunner(CONFIG, SOURCE, filter, editions=EDITIONS)
else:
filter()

View File

@ -0,0 +1,101 @@
import vapoursynth as vs
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner, Zone
from yt_common.chapters import Chapter, Edition
from yt_common.source import FileTrim, SimpleSource
from lvsfunc.mask import BoundingBox
from lvsfunc.misc import replace_ranges
from lvsfunc.types import Range
from typing import List, Tuple
import os
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(EPNUM)
BDMV: str = "../bdmv/[BDMV][210526][Tensei Shitara Slime Datta Ken 2nd Season][Vol.2]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource([
FileTrim(os.path.join(BDMV, "00011.m2ts"), (None, -49)),
FileTrim(os.path.join(BDMV, "00017.m2ts"), (None, 3158)),
FileTrim(os.path.join(BDMV, "00017.m2ts"), (33342, 33927)),
], asrc=[
# NC version has different (quieter) audio, so make sure we use the regular version
FileTrim(os.path.join(BDMV, "00011.m2ts"), (None, -49)),
FileTrim(os.path.join(BDMV, "00011.m2ts"), (None, 3158)),
FileTrim(os.path.join(BDMV, "00011.m2ts"), (33342, 33927)),
])
EDITIONS: List[Edition] = [
Edition(chapters=[
Chapter("Intro", 0),
Chapter("Part A", 840),
Chapter("Part B", 13980),
Chapter("Next", 33927, 34047),
], default=True, ordered=True),
Edition(chapters=[
Chapter("Intro - NC", 34047),
Chapter("Part A - NC", 34887, 37205),
Chapter("Part A", 3158),
Chapter("Part B", 13980, 33342),
Chapter("Part B - NC", 37205, -1),
Chapter("Next", 33927, 34047),
], default=False, ordered=True),
]
NOD3: List[Range] = [
(4862, 5023),
(8264, 8692),
(10200, 10576),
(17993, 18828),
(33927, 34046),
]
NODEN: List[Range] = [
(16484, 17992),
(18829, 19528),
]
ZONES: List[Zone] = [
]
ZONES += [Zone(r, 0.75) for r in NOD3 + NODEN if isinstance(r, tuple)]
AA_STRONG: List[Range] = [
(14544, 14588),
(14716, 14763),
(15493, 15633),
(19529, 19600),
]
SANGNOM: List[Tuple[Range, List[BoundingBox]]] = [
]
DEBAND_NUCLEAR: List[Range] = [
]
core = vs.core
def filter() -> vs.VideoNode:
src = SOURCE.source()
ef = edgefix(src)
den = denoise(ef)
replace_ranges(den, src, NODEN)
descaled = descale(den)
deb = deband(descaled, nuclear=DEBAND_NUCLEAR)
deb = replace_ranges(deb, src, NOD3)
aa = antialias(deb, strong=AA_STRONG, sangnom=SANGNOM)
grain = regrain(aa)
final = finalize(grain)
src.set_output(1)
final.set_output(0)
return final
if __name__ == "__main__":
SelfRunner(CONFIG, SOURCE, filter, editions=EDITIONS, zones=ZONES)
else:
filter()

View File

@ -0,0 +1,81 @@
import vapoursynth as vs
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner, Zone
from yt_common.chapters import Chapter
from yt_common.source import FileTrim, SimpleSource
from lvsfunc.mask import BoundingBox
from lvsfunc.misc import replace_ranges
from lvsfunc.types import Range
from typing import List, Tuple
import os
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(EPNUM)
BDMV: str = "../bdmv/[BDMV][210526][Tensei Shitara Slime Datta Ken 2nd Season][Vol.2]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource(
FileTrim(os.path.join(BDMV, "00012.m2ts"), (None, -26))
)
CHAPTERS: List[Chapter] = [
Chapter("Intro", 0),
Chapter("OP", 1272),
Chapter("Part A", 3429),
Chapter("Part B", 10549),
Chapter("ED", 31768),
]
NOD3: List[Range] = [
(3705, 3733),
(5329, 5360),
(7234, 7449),
]
NODEN: List[Range] = [
(3734, 3842),
(5361, 6372),
(26183, 27055),
]
ZONES: List[Zone] = [
]
ZONES += [Zone(r, 0.75) for r in NOD3 + NODEN if isinstance(r, tuple)]
AA_STRONG: List[Range] = [
(9805, 10155),
]
SANGNOM: List[Tuple[Range, List[BoundingBox]]] = [
]
DEBAND_NUCLEAR: List[Range] = [
]
core = vs.core
def filter() -> vs.VideoNode:
src = SOURCE.source()
ef = edgefix(src)
den = denoise(ef)
den = replace_ranges(den, src, NODEN)
descaled = descale(den)
deb = deband(descaled, nuclear=DEBAND_NUCLEAR)
deb = replace_ranges(deb, src, NOD3)
aa = antialias(deb, strong=AA_STRONG, sangnom=SANGNOM)
grain = regrain(aa)
final = finalize(grain)
src.set_output(1)
final.set_output(0)
return final
if __name__ == "__main__":
SelfRunner(CONFIG, SOURCE, filter, chapters=CHAPTERS, zones=ZONES)
else:
filter()

View File

@ -0,0 +1,60 @@
import vapoursynth as vs
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner
from yt_common.source import FileTrim, SimpleSource
from lvsfunc.mask import BoundingBox
from lvsfunc.misc import replace_ranges
from lvsfunc.types import Range
from typing import List, Tuple
import os
DESC: str = os.path.basename(os.path.splitext(__file__)[0])
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(DESC)
BDMV: str = "../bdmv/[BDMV][210526][Tensei Shitara Slime Datta Ken 2nd Season][Vol.2]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource(
FileTrim(os.path.join(BDMV, "00015.m2ts"), (24, -24))
)
NOD3: List[Range] = [
]
NODEN: List[Range] = [
]
AA_STRONG: List[Range] = [
]
SANGNOM: List[Tuple[Range, List[BoundingBox]]] = [
]
DEBAND_NUCLEAR: List[Range] = [
]
core = vs.core
def filter() -> vs.VideoNode:
src = SOURCE.source()
ef = edgefix(src)
den = denoise(ef)
den = replace_ranges(den, src, NODEN)
descaled = descale(den)
deb = deband(descaled, nuclear=DEBAND_NUCLEAR)
deb = replace_ranges(deb, src, NOD3)
aa = antialias(deb, strong=AA_STRONG, sangnom=SANGNOM)
grain = regrain(aa)
final = finalize(grain)
src.set_output(1)
final.set_output(0)
return final
if __name__ == "__main__":
SelfRunner(CONFIG, SOURCE, filter)
else:
filter()

View File

@ -0,0 +1,60 @@
import vapoursynth as vs
from tensura_common import TenSuraS2BDConfig, antialias, deband, denoise, descale, edgefix, finalize, regrain
from yt_common.automation import SelfRunner
from yt_common.source import FileTrim, SimpleSource
from lvsfunc.mask import BoundingBox
from lvsfunc.misc import replace_ranges
from lvsfunc.types import Range
from typing import List, Tuple
import os
DESC: str = os.path.basename(os.path.splitext(__file__)[0])
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(DESC)
BDMV: str = "../bdmv/[BDMV][210526][Tensei Shitara Slime Datta Ken 2nd Season][Vol.2]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource(
FileTrim(os.path.join(BDMV, "00014.m2ts"), (24, -24))
)
NOD3: List[Range] = [
]
NODEN: List[Range] = [
]
AA_STRONG: List[Range] = [
]
SANGNOM: List[Tuple[Range, List[BoundingBox]]] = [
]
DEBAND_NUCLEAR: List[Range] = [
]
core = vs.core
def filter() -> vs.VideoNode:
src = SOURCE.source()
ef = edgefix(src)
den = denoise(ef)
den = replace_ranges(den, src, NODEN)
descaled = descale(den)
deb = deband(descaled, nuclear=DEBAND_NUCLEAR)
deb = replace_ranges(deb, src, NOD3)
aa = antialias(deb, strong=AA_STRONG, sangnom=SANGNOM)
grain = regrain(aa)
final = finalize(grain)
src.set_output(1)
final.set_output(0)
return final
if __name__ == "__main__":
SelfRunner(CONFIG, SOURCE, filter)
else:
filter()

View File

@ -0,0 +1,99 @@
import vapoursynth as vs
from tensura_common import (TenSuraS2BDConfig, antialias, deband, denoise, descale,
edgefix, finalize, megurumono_scenefilter, regrain)
from yt_common.automation import SelfRunner, Zone
from yt_common.chapters import Chapter
from yt_common.source import FileTrim, SimpleSource
from lvsfunc.mask import BoundingBox
from lvsfunc.misc import replace_ranges
from lvsfunc.types import Range
from typing import List, Tuple
import os
DESC: str = os.path.basename(os.path.splitext(__file__)[0])
CONFIG: TenSuraS2BDConfig = TenSuraS2BDConfig(DESC)
BDMV: str = "../bdmv/[BDMV][210326][Tensei Shitara Slime Datta Ken 2nd Season][Vol.1]/BDMV/STREAM"
SOURCE: SimpleSource = SimpleSource(
FileTrim(os.path.join(BDMV, "00013.m2ts"), (24, -24))
)
MEGURUMONO: Tuple[int, int] = (2873, 5034)
CHAPTERS: List[Chapter] = [
Chapter("Intro", 0),
Chapter("OP", MEGURUMONO[0]),
Chapter("Part A", MEGURUMONO[1]+1),
Chapter("Part B", 22561),
Chapter("ED", 31883),
]
NOD3: List[Range] = [
]
NODEN: List[Range] = [
(21749, 21849),
]
ZONES: List[Zone] = [
]
ZONES += [Zone(r, 0.75) for r in NOD3 + NODEN if isinstance(r, tuple)]
AA_STRONG: List[Range] = [
]
SANGNOM: List[Tuple[Range, List[BoundingBox]]] = [
]
DEBAND_STRONG: List[Range] = [
(0, 500),
(11519, 11615),
(14845, 14906),
(15137, 15234),
(15667, 15817),
(18848, 19536),
(19897, 20004),
(20749, 20814),
(21013, 21340),
(21485, 21748),
(22812, 22894),
(26719, 26769),
(31307, 31426),
(31596, 31882),
]
DEBAND_NUCLEAR: List[Range] = [
]
core = vs.core
def filter() -> vs.VideoNode:
src = SOURCE.source()
ef = edgefix(src)
den = denoise(ef)
den = replace_ranges(den, src, NODEN)
descaled = descale(den)
deb = deband(descaled, strong=DEBAND_STRONG, nuclear=DEBAND_NUCLEAR)
deb = replace_ranges(deb, src, NOD3)
aa = antialias(deb, strong=AA_STRONG, sangnom=SANGNOM)
grain = regrain(aa)
scenefilter = grain
if MEGURUMONO:
megurumono = megurumono_scenefilter(src, MEGURUMONO[0])
scenefilter = replace_ranges(scenefilter, megurumono, MEGURUMONO)
final = finalize(scenefilter)
src.set_output(1)
final.set_output(0)
return final
if __name__ == "__main__":
SelfRunner(CONFIG, SOURCE, filter, chapters=CHAPTERS, zones=ZONES)
else:
filter()

View File

@ -1,2 +1,3 @@
from .config import TenSuraConfig # noqa: F401
from .filter import antialias, deband, denoise, descale, edgefix, finalize, regrain # noqa: F401
from .config import TenSuraS2Config, TenSuraS2BDConfig, TenSuraS1BDConfig # noqa: F401
from .filter import (antialias, deband, denoise, descale, edgefix, finalize, # noqa: F401
megurumono_scenefilter, regrain)

View File

@ -1,21 +1,34 @@
from yt_common.config import Config, FlacMixin
from yt_common.config import Config, FlacMixin, OpusMixin
from typing import Union
import os
TITLE: str = "TenSura S2"
TITLE_LONG: str = "Tensei Shitara Slime Datta Ken S2"
RESOLUTION: int = 1080
DATAPATH: str = os.path.dirname(__file__)
class TenSuraConfig(FlacMixin, Config):
class TenSuraS1BDConfig(OpusMixin, Config):
def __init__(self, desc: Union[str, int]) -> None:
super().__init__(
desc,
TITLE,
TITLE_LONG,
"TenSura",
"Tensei Shitara Slime Datta Ken",
RESOLUTION,
DATAPATH
)
class TenSuraS2Config(Config):
def __init__(self, desc: Union[str, int]) -> None:
super().__init__(
desc,
"TenSura S2",
"Tensei Shitara Slime Datta Ken S2",
RESOLUTION,
DATAPATH
)
class TenSuraS2BDConfig(FlacMixin, TenSuraS2Config):
pass

View File

@ -101,3 +101,22 @@ def regrain(clip: vs.VideoNode) -> vs.VideoNode:
def finalize(clip: vs.VideoNode) -> vs.VideoNode:
return depth(clip, 10)
def megurumono_scenefilter(clip: vs.VideoNode, start: Optional[int] = None) -> vs.VideoNode:
if start is None:
return clip
DEBAND_STRONG: List[Range] = [
(start+12, start+256),
(start+778, start+1007),
(start+1025, start+1059),
(start+1217, start+1322),
(start+1368, start+1437),
]
ef = edgefix(clip)
den = denoise(ef)
descaled = descale(den)
deb = deband(descaled, strong=DEBAND_STRONG)
aa = antialias(deb)
grain = regrain(aa)
return grain

View File

@ -1 +1 @@
x265 --input - --y4m --input-depth 10 --output-depth 10 --input-csp i420 --profile main10 --colormatrix bt709 --colorprim bt709 --transfer bt709 --preset slower --rc-lookahead 72 --keyint 360 --min-keyint 23 --subme 5 --qcomp 0.7 --crf 15 --aq-mode 3 --aq-strength 0.9 --bframes 16 --psy-rd 2.0 --psy-rdoq 1.8 --rdoq-level 1 --deblock -2:-2 --no-sao --no-open-gop --no-strong-intra-smoothing --frames {frames:d} --output {filename:s}.h265
x265 --input - --y4m --input-depth 10 --output-depth 10 --input-csp i420 --profile main10 --colormatrix bt709 --colorprim bt709 --transfer bt709 --preset slower --rc-lookahead 72 --keyint 360 --min-keyint 23 --subme 5 --qcomp 0.7 --crf 15 --aq-mode 3 --aq-strength 0.9 --bframes 16 --psy-rd 2.0 --psy-rdoq 1.8 --rdoq-level 1 --deblock -2:-2 --no-sao --no-open-gop --no-strong-intra-smoothing --frames {frames:d} $QPFILE $ZONES --output {filename:s}.h265