Skip to content

Commit

Permalink
vs:减少镜头晃动
Browse files Browse the repository at this point in the history
  • Loading branch information
hooke007 committed Dec 19, 2021
1 parent 6f2b77e commit 637ee3b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions portable_config/input.conf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
##开启/关闭 伽马修正为2.2,可用于校色后的调整(默认ICC校正以BT.1886为目标曲线) <shift+->
_ vf toggle format=gamma=gamma2.2 # 开/关 伽马修正2.2

##开启/关闭 stab 稳定镜头方案(高开销)
+ vf toggle vapoursynth="~~/stab-high.vpy" # 开/关 抗镜头晃动

##清除所有已加载的视频滤镜 <shift+`>
~ vf clr "" # 清空列表(视频滤镜)

Expand Down
16 changes: 16 additions & 0 deletions portable_config/stab-high.vpy
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 637ee3b

Please sign in to comment.