pripri: bd: vol6
This commit is contained in:
parent
2e97ee65e8
commit
143bec20bc
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,3 +25,4 @@ ffmpeg2pass*.log
|
||||
**/bdmv/
|
||||
**/bdpremux/
|
||||
**/sub/
|
||||
*.txt
|
||||
|
41
Princess Principal/11/11.vpy
Normal file
41
Princess Principal/11/11.vpy
Normal file
@ -0,0 +1,41 @@
|
||||
import vapoursynth as vs
|
||||
|
||||
from pripri_common import PriPriConfig, edgefix, denoise, descale, antialias, regrain, scenefilter_ed, finalize
|
||||
|
||||
from yt_common.automation import SelfRunner
|
||||
from yt_common.source import FileTrim, SimpleSource
|
||||
|
||||
from typing import Optional
|
||||
|
||||
import os
|
||||
|
||||
core = vs.core
|
||||
|
||||
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
|
||||
CONFIG: PriPriConfig = PriPriConfig(EPNUM)
|
||||
SOURCE: SimpleSource = SimpleSource(
|
||||
FileTrim("../bdmv/[180223][BDMV] プリンセス・プリンシパル VI/PRINCESS_PRINCIPAL_6/BDMV/STREAM/00006.m2ts", (0, -24))
|
||||
)
|
||||
ED: Optional[int] = 32608
|
||||
|
||||
|
||||
def filter() -> vs.VideoNode:
|
||||
src = SOURCE.source()
|
||||
if ED is not None:
|
||||
src = src.std.FreezeFrames(first=[src.num_frames-4], last=[src.num_frames-1], replacement=[src.num_frames-5])
|
||||
ef = edgefix(src)
|
||||
den = denoise(ef)
|
||||
rescale = descale(den)
|
||||
aa = antialias(rescale)
|
||||
grain = regrain(aa)
|
||||
ed = scenefilter_ed(grain, src, ED)
|
||||
final = finalize(ed)
|
||||
src.set_output(1)
|
||||
final.set_output(0)
|
||||
return final
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
SelfRunner(CONFIG, SOURCE, filter, audio_codec=["-c:a", "libopus", "-b:a", "192k", "-sample_fmt", "s16"])
|
||||
else:
|
||||
filter()
|
44
Princess Principal/12/12.vpy
Normal file
44
Princess Principal/12/12.vpy
Normal file
@ -0,0 +1,44 @@
|
||||
import vapoursynth as vs
|
||||
|
||||
from pripri_common import PriPriConfig, edgefix, denoise, descale, antialias, regrain, scenefilter_ed, finalize
|
||||
|
||||
from yt_common.automation import SelfRunner
|
||||
from yt_common.source import FileTrim, SimpleSource
|
||||
|
||||
from lvsfunc.misc import replace_ranges
|
||||
|
||||
from typing import Optional
|
||||
|
||||
import os
|
||||
|
||||
core = vs.core
|
||||
|
||||
EPNUM: int = int(os.path.basename(os.path.splitext(__file__)[0]))
|
||||
CONFIG: PriPriConfig = PriPriConfig(EPNUM)
|
||||
SOURCE: SimpleSource = SimpleSource(
|
||||
FileTrim("../bdmv/[180223][BDMV] プリンセス・プリンシパル VI/PRINCESS_PRINCIPAL_6/BDMV/STREAM/00007.m2ts", (0, -48))
|
||||
)
|
||||
ED: Optional[int] = None
|
||||
|
||||
|
||||
def filter() -> vs.VideoNode:
|
||||
src = SOURCE.source()
|
||||
if ED is not None:
|
||||
src = src.std.FreezeFrames(first=[src.num_frames-4], last=[src.num_frames-1], replacement=[src.num_frames-5])
|
||||
ef = edgefix(src)
|
||||
den = denoise(ef)
|
||||
rescale = descale(den)
|
||||
aa = antialias(rescale)
|
||||
grain = regrain(aa)
|
||||
ed = scenefilter_ed(grain, src, ED)
|
||||
cr = replace_ranges(ed, src, [(29971, 32128)])
|
||||
final = finalize(cr)
|
||||
src.set_output(1)
|
||||
final.set_output(0)
|
||||
return final
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
SelfRunner(CONFIG, SOURCE, filter, audio_codec=["-c:a", "libopus", "-b:a", "192k", "-sample_fmt", "s16"])
|
||||
else:
|
||||
filter()
|
34
Princess Principal/nced/nced.vpy
Normal file
34
Princess Principal/nced/nced.vpy
Normal file
@ -0,0 +1,34 @@
|
||||
import vapoursynth as vs
|
||||
|
||||
from pripri_common import PriPriConfig, scenefilter_ed, finalize
|
||||
|
||||
from yt_common.automation import SelfRunner
|
||||
from yt_common.source import FileTrim, SimpleSource
|
||||
|
||||
from typing import Optional
|
||||
|
||||
import os
|
||||
|
||||
core = vs.core
|
||||
|
||||
DESC: str = os.path.basename(os.path.splitext(__file__)[0])
|
||||
CONFIG: PriPriConfig = PriPriConfig(DESC)
|
||||
SOURCE: SimpleSource = SimpleSource(
|
||||
FileTrim("../bdmv/[180223][BDMV] プリンセス・プリンシパル VI/PRINCESS_PRINCIPAL_6/BDMV/STREAM/00013.m2ts", (24, -24))
|
||||
)
|
||||
ED: Optional[int] = 0
|
||||
|
||||
|
||||
def filter() -> vs.VideoNode:
|
||||
src = SOURCE.source()
|
||||
ed = scenefilter_ed(src, src, ED, mask=False)
|
||||
final = finalize(ed)
|
||||
src.set_output(1)
|
||||
final.set_output(0)
|
||||
return final
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
SelfRunner(CONFIG, SOURCE, filter, audio_codec=["-c:a", "libopus", "-b:a", "192k", "-sample_fmt", "s16"])
|
||||
else:
|
||||
filter()
|
35
Princess Principal/ncop/ncop.vpy
Normal file
35
Princess Principal/ncop/ncop.vpy
Normal file
@ -0,0 +1,35 @@
|
||||
import vapoursynth as vs
|
||||
|
||||
from pripri_common import PriPriConfig, edgefix, denoise, descale, antialias, regrain, finalize
|
||||
|
||||
from yt_common.automation import SelfRunner
|
||||
from yt_common.source import FileTrim, SimpleSource
|
||||
|
||||
import os
|
||||
|
||||
core = vs.core
|
||||
|
||||
DESC: str = os.path.basename(os.path.splitext(__file__)[0])
|
||||
CONFIG: PriPriConfig = PriPriConfig(DESC)
|
||||
SOURCE: SimpleSource = SimpleSource(
|
||||
FileTrim("../bdmv/[180223][BDMV] プリンセス・プリンシパル VI/PRINCESS_PRINCIPAL_6/BDMV/STREAM/00012.m2ts", (24, -24))
|
||||
)
|
||||
|
||||
|
||||
def filter() -> vs.VideoNode:
|
||||
src = SOURCE.source()
|
||||
ef = edgefix(src)
|
||||
den = denoise(ef)
|
||||
rescale = descale(den)
|
||||
aa = antialias(rescale)
|
||||
grain = regrain(aa)
|
||||
final = finalize(grain)
|
||||
src.set_output(1)
|
||||
final.set_output(0)
|
||||
return final
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
SelfRunner(CONFIG, SOURCE, filter, audio_codec=["-c:a", "libopus", "-b:a", "192k", "-sample_fmt", "s16"])
|
||||
else:
|
||||
filter()
|
@ -74,17 +74,18 @@ def regrain(clip: vs.VideoNode) -> vs.VideoNode:
|
||||
return grain
|
||||
|
||||
|
||||
def scenefilter_ed(clip: vs.VideoNode, src: vs.VideoNode, ed: Optional[int]) -> vs.VideoNode:
|
||||
def scenefilter_ed(clip: vs.VideoNode, src: vs.VideoNode, ed: Optional[int], mask: bool = True) -> vs.VideoNode:
|
||||
if ed is None:
|
||||
return clip
|
||||
nc = depth(core.lsmas.LWLibavSource(NCED)[24:-24], 16)
|
||||
den = denoise(src)
|
||||
dehalo = MaskedDHA(den, rx=2, darkstr=0.1, brightstr=0.75)
|
||||
edc = replace_ranges(den, dehalo, [(ed+2121, ed+2159)])
|
||||
edc = antialias(edc)
|
||||
edc = regrain(edc)
|
||||
mask = diff_creditless_mask(src, src[ed:], nc, ed, 6425, prefilter=True)
|
||||
edc = core.std.MaskedMerge(edc, den, mask)
|
||||
if mask:
|
||||
nc = depth(core.lsmas.LWLibavSource(NCED)[24:-24], 16)
|
||||
dcm = diff_creditless_mask(src, src[ed:], nc, ed, 6425, prefilter=True)
|
||||
edc = core.std.MaskedMerge(edc, den, dcm)
|
||||
return replace_ranges(clip, edc, [(ed, ed+2159)])
|
||||
|
||||
|
||||
|
@ -207,7 +207,7 @@ class SelfRunner():
|
||||
|
||||
self.clip = workraw_filter() if workraw_filter and self.workraw else final_filter()
|
||||
|
||||
start = args.start if args.start is not None else 0
|
||||
start = args.start or 0
|
||||
if args.end is not None:
|
||||
if args.end < 0:
|
||||
end = self.clip.num_frames + args.end
|
||||
@ -215,6 +215,9 @@ class SelfRunner():
|
||||
end = args.end + 1
|
||||
else:
|
||||
end = self.clip.num_frames
|
||||
# audio needs to be trimmed relative to source,
|
||||
# acsuite can do the conversions itself but is end-exclusive
|
||||
audio_end = args.end + 1 if args.end and args.end > 0 else args.end
|
||||
|
||||
if start < 0:
|
||||
raise ValueError("Start frame cannot be less than 0!")
|
||||
@ -231,7 +234,7 @@ class SelfRunner():
|
||||
|
||||
if args.audio_only:
|
||||
out_name += ".mka"
|
||||
self._do_audio(start, end, audio_codec, out_name=out_name)
|
||||
self._do_audio(start, audio_end, audio_codec, out_name=out_name)
|
||||
self.audio.do_cleanup()
|
||||
log.success("--- AUDIO ENCODE COMPLETE ---")
|
||||
return
|
||||
@ -266,7 +269,7 @@ class SelfRunner():
|
||||
self.timecodes = [round(float(1e9*f*(1/self.clip.fps)))/1e9 for f in range(0, self.clip.num_frames + 1)] \
|
||||
if self.clip.fps_den != 0 and len(self.timecodes) == 0 else self.timecodes
|
||||
|
||||
self._do_audio(start, end, audio_codec)
|
||||
self._do_audio(start, audio_end, audio_codec)
|
||||
|
||||
try:
|
||||
log.status("--- MUXING FILE ---")
|
||||
|
Loading…
x
Reference in New Issue
Block a user