From 637ee3b79d564cd40da0456c0aca34244bc9eda7 Mon Sep 17 00:00:00 2001 From: hooke007 Date: Mon, 20 Dec 2021 03:55:13 +0800 Subject: [PATCH] =?UTF-8?q?vs=EF=BC=9A=E5=87=8F=E5=B0=91=E9=95=9C=E5=A4=B4?= =?UTF-8?q?=E6=99=83=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- portable_config/input.conf | 3 +++ portable_config/stab-high.vpy | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 portable_config/stab-high.vpy diff --git a/portable_config/input.conf b/portable_config/input.conf index b2cbca6d..997f2251 100644 --- a/portable_config/input.conf +++ b/portable_config/input.conf @@ -68,6 +68,9 @@ ##开启/关闭 伽马修正为2.2,可用于校色后的调整(默认ICC校正以BT.1886为目标曲线) _ vf toggle format=gamma=gamma2.2 # 开/关 伽马修正2.2 +##开启/关闭 stab 稳定镜头方案(高开销) + + vf toggle vapoursynth="~~/stab-high.vpy" # 开/关 抗镜头晃动 + ##清除所有已加载的视频滤镜 ~ vf clr "" # 清空列表(视频滤镜) diff --git a/portable_config/stab-high.vpy b/portable_config/stab-high.vpy new file mode 100644 index 00000000..2829d613 --- /dev/null +++ b/portable_config/stab-high.vpy @@ -0,0 +1,16 @@ +## mod from HAvsFunc +## 抗源抖动脚本(此类问题常见于胶片转录作品),CPU开销很大 + +import vapoursynth as vs +core = vs.core +input = video_in + +cut1 = input +threshold = 255 << (cut1.format.bits_per_sample - 8) +temp = cut1.focus2.TemporalSoften2(7, threshold, threshold, 25, 2) +inter = core.std.Interleave([core.rgvs.Repair(temp, cut1.focus2.TemporalSoften2(1, threshold, threshold, 25, 2), mode=[1]), cut1]) +mdata = inter.mv.DepanEstimate(trust=0, dxmax=4, dymax=4) +cut2 = inter.mv.DepanCompensate(data=mdata, offset=-1, mirror=15) +output = cut2[::2] + +output.set_output()