goorawin
2nd February 2015, 03:42
Is there any way to write the two passes required by deshaker into the one Avisynth script ?
It would require completing the first pass before starting the second.
I do use Deshaker in Virtual Dub now and it works well. I have automated the process of colour correction, clip enhancing, noise reduction and stabilization through Virtual Dub. So I can set up a batch to do as many clips as required and let the computer do all the work unattended. I have done thousands of clips this way very successfully. Interestingly I have found that less than 5% need to be manually corrected, which is very easy to do anyway.
However I would like to do the stabilization before any other image processing. Through the testing I have done there appears to be a slight improvement in both image quality and processing speed when I do this.
So my question is, is it possible to write such a script, if so how?
Script 1 - Working:
SetMemoryMax(256)
SetMTMode(5,6)
Clip="G:\Europe 2014\Video\Raw\Part02 Final\00293.MTS"
V1=avss_26_DSS2(Clip, fps = 50)
A1=FFAudioSource(Clip,track = -1)
AudioDub(V1, A1)
SetMTMode(2,0)
a = frfun7(lambda=1.80, T=2.3, Tuv=2.0, P=0)
b = a.frfun7()
SeeSaw(a, b)
SetMTMode(1,0)
Autoadjust(auto_gain= true, input_tv=false, dark_limit= 1.10, dark_exclude=0.95, bright_limit=5.00, bright_exclude=0.00001, gain_mode= 0, auto_balance=true, chroma_process=0, balance_str=0.45, output_tv=true, high_quality=True, high_bitdepth=False, debug_view=false)
Smoothlevels(input_low=0,gamma=1.01,input_high=230,output_low=0,output_high=255, chroma=100,limiter= 2,Lmode= 3, darkSTR=80,brightSTR=90,Ecurve= 1,Ecenter=155,protect=16,dither=50,useMT=4,useOPT= 1)
SmoothTweak(Saturation=1.20,hue1=1,hue2=1)
Script 2 - Avisynth deshaker Pass 1 Working
LoadVirtualDubPlugin ("C:\Virtual Dub\plugins32\Deshaker.vdf", "deshaker", preroll=0)
Clip=("G:\Europe 2014\Video\Raw\Part01 Raw\00134.MTS")
V1=avss_26_DSS2(Clip, fps = 50)
A1=FFAudioSource(Clip,track = -1)
AudioDub(V1, A1).ConvertToRGB32(matrix="PC.709").AdvancedMultiTrim("0,-50")
Deshaker("19|1|30|4|1|0|1|0|640|480|1|2|1000|1000|1000|1000|4|1|3|2|8|30|300|4|C:\\Users\\Peter\\AppData\\Local\\Deshaker\\Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|10|10|5|10|0|0|30|30|0|0|1|0|1|1|0|10|1000|1|90|1|1|20|5000|100|20|1|0|ff00ff")
Script 3 - Avisynth deshaker Pass 2 Working
SetMemoryMax(500)
SetMTMode(3,4)
LoadVirtualDubPlugin ("C:\Virtual Dub\plugins32\Deshaker.vdf", "deshaker", preroll=0)
Clip=("G:\Europe 2014\Video\Raw\Part02 Final Raw\00301.MTS")
V1=avss_26_DSS2(Clip, fps = 50)
A1=FFAudioSource(Clip,track = -1)
AudioDub(V1, A1)
AdvancedMultiTrim("0,-100")
SetMTMode(2,0)
ConvertToRGB32()
Deshaker("19|2|30|4|1|0|1|0|640|480|1|2|1000|1000|1000|1000|4|1|3|2|8|30|300|4|C:\\Users\\Peter\\AppData\\Local\\Deshaker\\Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|10|10|5|10|0|0|30|30|0|0|1|0|1|1|0|10|1000|1|90|1|1|20|5000|100|20|1|0|ff00ff")
ConvertToYV12()
Script 4 to be added to the end of script 3
SetMTMode(2,0)
a = frfun7(lambda=1.80, T=2.3, Tuv=2.0, P=0)
b = a.frfun7()
SeeSaw(a, b)
SetMTMode(1,0)
Autoadjust(auto_gain= true, input_tv=false, dark_limit= 1.10, dark_exclude=0.95, bright_limit=5.00, bright_exclude=0.00001, gain_mode= 0, auto_balance=true, chroma_process=0, balance_str=0.45, output_tv=true, high_quality=True, high_bitdepth=False, debug_view=false)
Smoothlevels(input_low=0,gamma=1.01,input_high=230,output_low=0,output_high=255, chroma=100,limiter= 2,Lmode= 3, darkSTR=80,brightSTR=90,Ecurve= 1,Ecenter=155,protect=16,dither=50,useMT=4,useOPT= 1)
SmoothTweak(Saturation=1.20,hue1=1,hue2=1)
How to combine scripts 2, 3 and 4 into one working script????????
It would require completing the first pass before starting the second.
I do use Deshaker in Virtual Dub now and it works well. I have automated the process of colour correction, clip enhancing, noise reduction and stabilization through Virtual Dub. So I can set up a batch to do as many clips as required and let the computer do all the work unattended. I have done thousands of clips this way very successfully. Interestingly I have found that less than 5% need to be manually corrected, which is very easy to do anyway.
However I would like to do the stabilization before any other image processing. Through the testing I have done there appears to be a slight improvement in both image quality and processing speed when I do this.
So my question is, is it possible to write such a script, if so how?
Script 1 - Working:
SetMemoryMax(256)
SetMTMode(5,6)
Clip="G:\Europe 2014\Video\Raw\Part02 Final\00293.MTS"
V1=avss_26_DSS2(Clip, fps = 50)
A1=FFAudioSource(Clip,track = -1)
AudioDub(V1, A1)
SetMTMode(2,0)
a = frfun7(lambda=1.80, T=2.3, Tuv=2.0, P=0)
b = a.frfun7()
SeeSaw(a, b)
SetMTMode(1,0)
Autoadjust(auto_gain= true, input_tv=false, dark_limit= 1.10, dark_exclude=0.95, bright_limit=5.00, bright_exclude=0.00001, gain_mode= 0, auto_balance=true, chroma_process=0, balance_str=0.45, output_tv=true, high_quality=True, high_bitdepth=False, debug_view=false)
Smoothlevels(input_low=0,gamma=1.01,input_high=230,output_low=0,output_high=255, chroma=100,limiter= 2,Lmode= 3, darkSTR=80,brightSTR=90,Ecurve= 1,Ecenter=155,protect=16,dither=50,useMT=4,useOPT= 1)
SmoothTweak(Saturation=1.20,hue1=1,hue2=1)
Script 2 - Avisynth deshaker Pass 1 Working
LoadVirtualDubPlugin ("C:\Virtual Dub\plugins32\Deshaker.vdf", "deshaker", preroll=0)
Clip=("G:\Europe 2014\Video\Raw\Part01 Raw\00134.MTS")
V1=avss_26_DSS2(Clip, fps = 50)
A1=FFAudioSource(Clip,track = -1)
AudioDub(V1, A1).ConvertToRGB32(matrix="PC.709").AdvancedMultiTrim("0,-50")
Deshaker("19|1|30|4|1|0|1|0|640|480|1|2|1000|1000|1000|1000|4|1|3|2|8|30|300|4|C:\\Users\\Peter\\AppData\\Local\\Deshaker\\Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|10|10|5|10|0|0|30|30|0|0|1|0|1|1|0|10|1000|1|90|1|1|20|5000|100|20|1|0|ff00ff")
Script 3 - Avisynth deshaker Pass 2 Working
SetMemoryMax(500)
SetMTMode(3,4)
LoadVirtualDubPlugin ("C:\Virtual Dub\plugins32\Deshaker.vdf", "deshaker", preroll=0)
Clip=("G:\Europe 2014\Video\Raw\Part02 Final Raw\00301.MTS")
V1=avss_26_DSS2(Clip, fps = 50)
A1=FFAudioSource(Clip,track = -1)
AudioDub(V1, A1)
AdvancedMultiTrim("0,-100")
SetMTMode(2,0)
ConvertToRGB32()
Deshaker("19|2|30|4|1|0|1|0|640|480|1|2|1000|1000|1000|1000|4|1|3|2|8|30|300|4|C:\\Users\\Peter\\AppData\\Local\\Deshaker\\Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|10|10|5|10|0|0|30|30|0|0|1|0|1|1|0|10|1000|1|90|1|1|20|5000|100|20|1|0|ff00ff")
ConvertToYV12()
Script 4 to be added to the end of script 3
SetMTMode(2,0)
a = frfun7(lambda=1.80, T=2.3, Tuv=2.0, P=0)
b = a.frfun7()
SeeSaw(a, b)
SetMTMode(1,0)
Autoadjust(auto_gain= true, input_tv=false, dark_limit= 1.10, dark_exclude=0.95, bright_limit=5.00, bright_exclude=0.00001, gain_mode= 0, auto_balance=true, chroma_process=0, balance_str=0.45, output_tv=true, high_quality=True, high_bitdepth=False, debug_view=false)
Smoothlevels(input_low=0,gamma=1.01,input_high=230,output_low=0,output_high=255, chroma=100,limiter= 2,Lmode= 3, darkSTR=80,brightSTR=90,Ecurve= 1,Ecenter=155,protect=16,dither=50,useMT=4,useOPT= 1)
SmoothTweak(Saturation=1.20,hue1=1,hue2=1)
How to combine scripts 2, 3 and 4 into one working script????????