排长
- 大洋
- 8446
- 阅读权限
- 30
|
本帖最后由 lyglay1991 于 18-6-17 08:21 编辑
脚本平台:vapoursynth
脚本处理环境:16bit
脚本输出环境:10bit
处理思路:降噪 防ring/halo band等
源滤镜加载:
一.肉酱盘处理:
选择正确的mpls作为源文件加载,所用到的滤镜为:ReadMpls
下载地址:
https://github.com/HomeOfVapourS ... apourSynth-ReadMpls
写法:
以超凡战队为例:
路径为:
E:\BaiduYunDownload\Power.Rangers.2017.Repack.BluRay.1080p.AVC.Atmos.TrueHD7.1-MTeam超凡战队BD为肉酱盘,正确的mpls为:00988.mpls
所以源加载就这样写:
mpls = core.mpls.Read(r'E:\BaiduYunDownload\Power.Rangers.2017.Repack.BluRay.1080p.AVC.Atmos.TrueHD7.1-MTeam\BDMV\PLAYLIST\00988.mpls')
ret = core.std.Splice([core.lsmas.LWLibavSource(mpls['clip']) for i in range(mpls['count'])])
二.非肉酱盘:
core.lsmas.LWLibavSource(r'm2ts', threads=1)
16bit环境转换:
1.Mpls加载的:
core.mpls.Read(r'E:\BaiduYunDownload\Power.Rangers.2017.Repack.BluRay.1080p.AVC.Atmos.TrueHD7.1-MTeam\BDMV\PLAYLIST\00988.mpls')
ret = core.std.Splice([core.lsmas.LWLibavSource(mpls['clip']) for i in range(mpls['count'])])
src16=mvf.Depth(ret,depth=16)
2.m2ts加载的:
src=core.lsmas.LWLibavSource(r"m2ts", threads=1)
src16=mvf.Depth(src,depth=16)
画质处理:
一.噪点
一般视频都会带噪点,所以这里也给出2种处理方法:
1:去掉一部分(大部分) 保留一部分(小部分)
我这里给出的降噪滤镜为:SMDegrain
写法:
nr=haf.SMDegrain(src16, tr=1, prefilter=1)
nr=haf.SMDegrain(nr, tr=1, prefilter=1)
nr=haf.SMDegrain(nr, tr=2, prefilter=0)
2:全去
nr=haf.SMDegrain(src16)
PS:降噪滤镜不止这一个,我个人一般是用这个为主,其他降噪滤镜:
http://www.vapoursynth.com/doc/pluginlist.html#denoising
二.防ring/halo band等
一般处理滤镜以HQDeringmod、f3kdb等为主
写法:
dering=haf.HQDeringmod(nr3)
res=core.f3kdb.Deband(dering,10,40,32,32,0,0)
res2=core.f3kdb.Deband(res,20,30,20,20,0,0)
res3=core.f3kdb.Deband(res2,20,30,20,20,0,0)
PS:deband的参数根据片子情况以及喜好自行调整
三.其他处理
一般是对画面进行的一些优化,如:抗锯齿、补偿性锐化、锐化等
抗锯齿写法(简单的):taa=taa.TAAmbk()
补偿性锐化(建议放在降噪之后加上):
noise=core.std.MakeDiff(src16,nr)
blur=core.rgvs.RemoveGrain(nr, 11)
diff=core.std.MakeDiff(nr,blur)
diff=core.rgvs.Repair(diff,noise,1)
mergeDiff=core.std.MergeDiff(nr,diff)
锐化(简单的):cs=cs.CSMOD()
喜欢切边的话可以使用这个进行切边:
http://www.vapoursynth.com/doc/functions/crop.html
建议处理顺序:
视频加载→转16bit→降噪→(补偿性锐化/锐化)→防ring→(抗锯齿)→防band→10bit输出
10bit输出:
output=core.fmtc.bitdepth(res3,bits=10)
所以完整写法(例子):
写法1:
import vapoursynth as vs
import mvsfunc as mvf
import havsfunc as haf
import vsTAAmbk as taa
import CSMOD as cs
import nnedi3_resample as nnrs
import adjust
core = vs.get_core(threads=0)
core.max_cache_size = 10240
mpls = core.mpls.Read(r'E:\BaiduYunDownload\Power.Rangers.2017.Repack.BluRay.1080p.AVC.Atmos.TrueHD7.1-MTeam\BDMV\PLAYLIST\00988.mpls')
ret = core.std.Splice([core.lsmas.LWLibavSource(mpls['clip']) for i in range(mpls['count'])])
src16=mvf.Depth(ret,depth=16)
crop = core.std.crop(src16, left=0, top=140, right=0, bottom=140)
nr=haf.SMDegrain(crop)
dering=haf.HQDeringmod(nr)
taa=taa.TAAmbk(dering)
res=core.f3kdb.Deband(taa,10,40,32,32,0,0)
res2=core.f3kdb.Deband(res,20,30,20,20,0,0)
dedand=core.f3kdb.Deband(res2,20,30,20,20,0,0)
output=core.fmtc.bitdepth(dedand,bits=10)
output.set_output()
写法2:
import vapoursynth as vs
import mvsfunc as mvf
import havsfunc as haf
import vsTAAmbk as taa
import CSMOD as cs
import nnedi3_resample as nnrs
import adjust
core = vs.get_core(threads=0)
core.max_cache_size = 10240
mpls = core.mpls.Read(r'E:\BaiduYunDownload\Power.Rangers.2017.Repack.BluRay.1080p.AVC.Atmos.TrueHD7.1-MTeam\BDMV\PLAYLIST\00988.mpls')
ret = core.std.Splice([core.lsmas.LWLibavSource(mpls['clip']) for i in range(mpls['count'])])
src16=mvf.Depth(ret,depth=16)
crop = core.std.crop(src16, left=0, top=140, right=0, bottom=140)
nr=haf.SMDegrain(crop)
noise=core.std.MakeDiff(src16,nr)
blur=core.rgvs.RemoveGrain(nr, 11)
diff=core.std.MakeDiff(nr,blur)
diff=core.rgvs.Repair(diff,noise,1)
mergeDiff=core.std.MergeDiff(nr,diff)
dering=haf.HQDeringmod(mergeDiff)
res=core.f3kdb.Deband(dering,10,40,32,32,0,0)
res2=core.f3kdb.Deband(res,20,30,20,20,0,0)
dedand=core.f3kdb.Deband(res2,20,30,20,20,0,0)
output=core.fmtc.bitdepth(dedand,bits=10)
output.set_output()
此处理思路(脚本)适用于大部分电影/真人电视剧等 |
评分
-
查看全部评分
|