Skip to content

Commit

Permalink
2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Revan654 committed Jan 18, 2019
1 parent 070476d commit 82e5ae8
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 28 deletions.
7 changes: 5 additions & 2 deletions General/ApplicationSettings.vb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ Public Class ApplicationSettings
AviSynthFilterPreferences.Add("ts m2ts mts m2t", "DGSource")
AviSynthFilterPreferences.Add("wmv", "DSS2")
AviSynthFilterPreferences.Add("avi vdr", "AviSource")
AviSynthFilterPreferences.Add("webm", "FFVideoSource")
End If
Else
If Check(AviSynthFilterPreferences, "AviSynth Source Filter Preferences", 1) Then
Expand All @@ -142,12 +143,13 @@ Public Class ApplicationSettings
AviSynthFilterPreferences.Add("d2v", "MPEG2Source")
AviSynthFilterPreferences.Add("dgi", "DGSource")
AviSynthFilterPreferences.Add("dgim", "DGSourceIM")
AviSynthFilterPreferences.Add("mp4 m4v mov", "LSMASHVideoSource")
AviSynthFilterPreferences.Add("mp4 m4v mov webm", "LSMASHVideoSource")
AviSynthFilterPreferences.Add("ts m2ts mts m2t", "LWLibavVideoSource")
AviSynthFilterPreferences.Add("wmv", "DSS2")
AviSynthFilterPreferences.Add("avi vdr", "AviSource")
End If
End If

If Path.GetDirectoryName(Folder.Startup).Contains("Revan") Then
If Check(VapourSynthFilterPreferences, "VapourSynth Source Filter Preference", 3) Then
VapourSynthFilterPreferences = New StringPairList
Expand All @@ -159,6 +161,7 @@ Public Class ApplicationSettings
VapourSynthFilterPreferences.Add("ts m2ts mts m2t", "DGSource")
VapourSynthFilterPreferences.Add("d2v", "d2vsource")
VapourSynthFilterPreferences.Add("dgi", "DGSource")
VapourSynthFilterPreferences.Add("webm", "ffms2")
End If
Else
If Check(VapourSynthFilterPreferences, "VapourSynth Source Filter Preference", 3) Then
Expand All @@ -167,7 +170,7 @@ Public Class ApplicationSettings
VapourSynthFilterPreferences.Add("264 h264 avc", "LWLibavSource")
VapourSynthFilterPreferences.Add("265 h265 hevc hvc", "LWLibavSource")
VapourSynthFilterPreferences.Add("avi avs vdr", "AVISource")
VapourSynthFilterPreferences.Add("mp4 m4v mov", "LibavSMASHSource")
VapourSynthFilterPreferences.Add("mp4 m4v mov webm", "LibavSMASHSource")
VapourSynthFilterPreferences.Add("ts m2ts mts m2t", "LWLibavSource")
VapourSynthFilterPreferences.Add("d2v", "d2vsource")
VapourSynthFilterPreferences.Add("dgi", "DGSource")
Expand Down
2 changes: 1 addition & 1 deletion General/General.vb
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ table {
IsClosed = True

Writer.WriteRaw("<p>&nbsp;</p>" + BR)
Writer.WriteRaw("<h5 align=""center"">Copyright &copy; 2002-" & DateTime.Now.Year & " stax76. All rights reserved.</h5><br>")
Writer.WriteRaw("<h5 align=""center"">Copyright &copy; 2002-" & DateTime.Now.Year & "</h5><br>")
Writer.WriteEndElement() 'body
Writer.WriteEndElement() 'html
Writer.Close()
Expand Down
39 changes: 23 additions & 16 deletions General/GlobalClass.vb
Original file line number Diff line number Diff line change
Expand Up @@ -581,22 +581,29 @@ Public Class GlobalClass
If p.SourceFile <> "" Then
p.TempDir = Macro.Expand(p.TempDir)

If p.TempDir = "" Then
Try
If p.SourceFile.Dir.EndsWith("_temp\") Then
p.TempDir = p.SourceFile.Dir
End If
Catch ex As Exception
'Only
'Previous Versions of Windows(Below Windows 10)
'Earlier dotnet that doesn't target 4.6+,
'Harddrive is not NTFS
'Requires Shorter Paths.
Dim base = p.SourceFile.Base
base = base.Shorten(15) + "..."
p.TempDir = p.SourceFile.Dir + base + "_temp\"
End Try
End If
Try
If p.SourceFile.Dir.EndsWith("_temp\") Then
p.TempDir = p.SourceFile.Dir
'Else
' Dim base = p.SourceFile.Base
' If base.Length > 30 Then base = base.Shorten(15) + "..."
' p.TempDir = p.SourceFile.Dir + base + "_temp\"
End If
Catch ex As Exception
MsgInfo(ex.Message)
'Only
'Previous Versions of Windows(Below Windows 10)
'Also well if the Harddrive is not NTFS
'Requires Shorter Paths.
End Try
'Else
' Try
' Dim base = p.SourceFile.Base
' base = base.Shorten(15) + "..."
' p.TempDir = p.SourceFile.Dir + base + "_temp\"
' Catch ex As Exception
' End Try
'End If

'Source Code Running Windows 7 & 8.1, Just incase Code needs to reverted Back:

Expand Down
37 changes: 33 additions & 4 deletions General/Package.vb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ Public Class Package
.HelpURL = "http://www.ffmpeg.org/ffmpeg-all.html",
.Description = "Versatile audio video converter."})

Shared Property HB As Package = Add(New Package With {
.Name = "HB",
.Filename = "HBCli.exe",
.DirPath = "Encoders\HB",
.WebURL = "https://handbrake.fr/",
.HelpURL = "https://handbrake.fr/docs/en/1.2.0/cli/command-line-reference.html",
.Description = "HandBrake is a tool for converting video from nearly any format to a selection of modern, widely supported codecs."})

Shared Property Haali As Package = Add(New HaaliSplitter)

Shared Property MediaInfo As Package = Add(New Package With {
Expand Down Expand Up @@ -812,7 +820,7 @@ Public Class Package
.AvsFiltersFunc = Function() {
New VideoFilter("Noise", "NLMeans | xNLMeans", "xnlmeans(a=4,h=2.2,vcomp=0.5,s=1)")}})

'Add(New PluginPackage With { 'Will be Removed, Code does no longer work with Latest filters.
'Add(New PluginPackage With { 'Removed Since it can longer run on any newer systems.
' .Name = "XAA",
' .Filename = "xaa.avsi",
' .WebURL = "http://avisynth.nl/index.php/xaa",
Expand Down Expand Up @@ -1030,7 +1038,6 @@ Public Class Package
New VideoFilter("Noise", "MCTemporalDenoise | MCTemporalDenoise", "MCTemporalDenoise(settings=""medium"")"),
New VideoFilter("Noise", "MCTemporalDenoise | MCTemporalDenoisePP", "source=last" + BR + "denoised=FFT3Dfilter()" + BR + "MCTemporalDenoisePP(denoised)")}})


Add(New PluginPackage With {
.Name = "L-SMASH-Works",
.Filename = "LSMASHSource.dll",
Expand All @@ -1053,6 +1060,18 @@ Public Class Package
New VideoFilter("Source", "LibavSMASHSource", "clip = core.lsmas.LibavSMASHSource(r""%source_file%"")"),
New VideoFilter("Source", "LWLibavSource", "clip = core.lsmas.LWLibavSource(r""%source_file%"")")}})

Add(New PluginPackage With {
.Name = "vsrawsource",
.Filename = "vsrawsource.dll",
.DirPath = "Plugins\VS\vsRawSource",
.Description = "VapourSynth source filter based on Libav supporting a wide range of input formats.",
.HelpURL = "http://github.com/VFR-maniac/L-SMASH-Works/blob/master/VapourSynth/README",
.WebURL = "http://avisynth.nl/index.php/LSMASHSource",
.VSFilterNames = {"lsmas.LibavSMASHSource", "lsmas.LWLibavSource"},
.VSFiltersFunc = Function() {
New VideoFilter("Source", "LibavSMASHSource", "clip = core.lsmas.LibavSMASHSource(r""%source_file%"")"),
New VideoFilter("Source", "LWLibavSource", "clip = core.lsmas.LWLibavSource(r""%source_file%"")")}})

Add(New PluginPackage With {
.Name = "Deblock",
.Filename = "Deblock.dll",
Expand Down Expand Up @@ -1204,6 +1223,16 @@ Public Class Package
.URL = "https://github.com/HomeOfVapourSynthEvolution/VapourSynth-DCTFilter",
.VSFilterNames = {"dctf.DCTFilter"}})

Add(New PluginPackage With {
.Name = "FixTelecinedFades",
.Filename = "libftf_em64t_avx_fma.dll",
.DirPath = "Plugins\VS\FixTelecinedFades",
.Description = "InsaneAA Anti-Aliasing Script.",
.URL = "https://github.com/IFeelBloated/Fix-Telecined-Fades",
.VSFilterNames = {"ftf.FixFades"},
.VSFiltersFunc = Function() {
New VideoFilter("Restoration", "RCR | Fix Telecined Fades", "clip = core.fmtc.bitdepth (clip, bits=32)" + BR + "clip = core.ftf.FixFades(clip)" + BR + "clip = core.fmtc.bitdepth (clip, bits=8)")}})

Add(New PluginPackage With {
.Name = "vcmod",
.Filename = "vcmod.dll",
Expand Down Expand Up @@ -1559,15 +1588,15 @@ Public Class Package
.Description = "Motion vectors search plugin is a deeply refactored and modified version of MVTools2 Avisynth plugin",
.Filename = "svpflow1_vs64.dll",
.WebURL = "https://www.svp-team.com/wiki/Manual:SVPflow",
.VSFilterNames = {"core.svp1.Super", "core.svp1.Analyse"}})
.VSFilterNames = {"core.svp1.Super", "core.svp1.Analyse", "core.svp1.Convert"}})

Add(New PluginPackage With {
.Name = "SVPFlow 2",
.DirPath = "Plugins\VS\SVPFlow",
.Description = "Motion vectors search plugin is a deeply refactored and modified version of MVTools2 Avisynth plugin",
.Filename = "svpflow2_vs64.dll",
.WebURL = "https://www.svp-team.com/wiki/Manual:SVPflow",
.VSFilterNames = {"core.svp2.SmoothFps", "core.svp2.Convert"}})
.VSFilterNames = {"core.svp2.SmoothFps"}})

Add(New PluginPackage With {
.Name = "Dither",
Expand Down
12 changes: 7 additions & 5 deletions General/VideoScript.vb
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,11 @@ clip.set_output()
script.Engine = ScriptEngine.VapourSynth
script.Filters.Add(New VideoFilter("Source", "Automatic", "# can be configured at: Tools > Settings > Source Filters"))
script.Filters.Add(New VideoFilter("Crop", "Crop", "clip = core.std.Crop(clip, %crop_left%, %crop_right%, %crop_top%, %crop_bottom%)", False))
script.Filters.Add(New VideoFilter("Noise", "DFTTest", "clip = core.dfttest.DFTTest(clip, sigma=6, tbsize=3,opt=3)", False))
script.Filters.Add(New VideoFilter("Field", "QTGMC Medium", $"clip = core.std.SetFieldBased(clip, 2) # 1 = BFF, 2 = TFF{BR}clip = havsfunc.QTGMC(clip, TFF = True, Preset = 'Medium')", False))
script.Filters.Add(New VideoFilter("Noise", "DFTTest", "clip = core.dfttest.DFTTest(clip, sigma=6, tbsize=1)", False))
script.Filters.Add(New VideoFilter("Resize", "Spline64Resize", "clip = resamplehq.resamplehq(clip, %target_width%, %target_height%, kernel=""Spline64"")", False))
script.Filters.Add(New VideoFilter("Misc", "UnSpec", "clip = core.resize.Point(clip, matrix_in_s=""unspec"",range_s=""limited"")" + BR + "clip = core.std.AssumeFPS(clip, fpsnum = int(%media_info_video:FrameRate% * 1000), fpsden = 1000)" + BR + "clip = core.std.SetFrameProp(clip=clip, prop=""_ColorRange"", intval=1)", False))
script.Filters.Add(New VideoFilter("Misc", "Respec", "clip = core.fmtc.resample (clip, css=""444"")" + BR + "clip = core.fmtc.matrix (clip, mats=""709"", matd=""709"")" + BR + "clip = core.fmtc.resample (clip, css=""420"")" + BR + "clip = core.fmtc.bitdepth (clip, bits=10)", False))
script.Filters.Add(New VideoFilter("Resize", "Spline64Resize", "clip = core.fmtc.resample(clip, kernel=""spline64"", w=%target_width%, h=%target_height%)", False))
ret.Add(script)

Return ret
Expand Down Expand Up @@ -646,7 +648,7 @@ Public Class FilterCategory
Dim framerate As New FilterCategory("FrameRate")
framerate.Filters.Add(New VideoFilter(framerate.Name, "AssumeFPS | AssumeFPS Source File", "AssumeFPS(%media_info_video:FrameRate%)"))
framerate.Filters.Add(New VideoFilter(framerate.Name, "AssumeFPS | AssumeFPS", "AssumeFPS($select:msg:Select a frame rate;24000/1001|24000, 1001;24;25;30000/1001|30000, 1001;30;50;60000/1001|60000, 1001;60;120;144;240$)"))
framerate.Filters.Add(New VideoFilter(framerate.Name, "ConvertFPS...", "ConvertFPS($select:msg:Select a frame rate;24;25;29.970;50;59.970;60;120;144;240;$)"))
framerate.Filters.Add(New VideoFilter(framerate.Name, "ConvertFPS...", "ConvertFPS($select:msg:Select a frame rate;24;25;29.970;30;50;59.940;60;120;144;240;$)"))
framerate.Filters.Add(New VideoFilter(framerate.Name, "SVPFlow", "Threads=8" + BR + "super_params=""{pel:2,gpu:1}""" + BR + "analyse_params=""""""{block:{w:16,h:16}, main:{search:{coarse:{distance:-10}}}, refine:[{thsad:200}]}"""""" " + BR + "smoothfps_params=""{rate:{num:4,den:2},algo:23,cubic:1}""" + BR + "super = SVSuper(super_params)" + BR + "vectors = SVAnalyse(super, analyse_params)" + BR + "SVSmoothFps(super, vectors, smoothfps_params, mt=threads)" + BR + "#Prefetch(threads) must be added at the end of the script and Threads=9 after the source" + BR + "Prefetch(threads)"))
ret.Add(framerate)

Expand Down Expand Up @@ -734,7 +736,7 @@ Public Class FilterCategory
framerate.Filters.Add(New VideoFilter(framerate.Name, "AssumeFPS | AssumeFPS...", "clip = core.std.AssumeFPS(clip, None, $select:msg:Select a frame rate.;24000/1001|24000, 1001;24|24, 1;25|25, 1;30000/1001|30000, 1001;30|30, 1;50|50, 1;60000/1001|60000, 1001;60|60, 1$)"))
framerate.Filters.Add(New VideoFilter(framerate.Name, "InterFrame", "clip = havsfunc.InterFrame(clip, Preset=""Medium"", Tuning=""$select:msg:Select the Tuning Preset;Animation;Film;Smooth;Weak$"", NewNum=$enter_text:Enter the NewNum Value$, NewDen=$enter_text:Enter the NewDen Value$, OverrideAlgo=$select:msg:Which Algorithm Do you Wish to Use?;Strong Predictions|2;Intelligent|13;Smoothest|23$, GPU=$select:msg:Enable GPU Feature?;True;False$)"))
framerate.Filters.Add(New VideoFilter(framerate.Name, "SVPFlow | SVPFlowMV", "sup = core.mv.Super(clip, pel=2, hpad=0, vpad=0)" + BR + "bvec = core.mv.Analyse(sup, blksize=16, isb=True, chroma=True, search=3, searchparam=1)" + BR + "fvec = core.mv.Analyse(sup, blksize=16, isb=False, chroma=True, search=3, searchparam=1)" + BR + "$select:msg:Select FPS Filter to Use;FlowFPS|clip = core.mv.FlowFPS(clip, sup, bvec, fvec, mask=2;BlockFPS|clip = core.mv.BlockFPS(clip, sup, bvec, fvec, mode=3, thscd2=12$, num=$enter_text:Enter The Num Value$, den=$enter_text:Enter The Den Value$)"))
framerate.Filters.Add(New VideoFilter(framerate.Name, "SVPFlow | SVPFlow", "crop_string = """"" + BR + "resize_string = """"" + BR + "super_params = ""{pel:1,scale:{up:0},gpu:1,full:false,rc:true}""" + BR + "analyse_params = ""{block:{w:32},main:{search:{coarse:{type:2,distance:-6,bad:{sad:2000,range:24}},type:2}},refine:[{thsad:250}]}""" + BR + "smoothfps_params = ""{gpuid:0,linear:true,rate:{num:4,den:2},algo:23,mask:{area:200},scene:{}}""" + BR + "def interpolate(clip):" + BR + " input = clip" + BR + " if crop_string!='':" + BR + " input = eval(crop_string)" + BR + " if resize_string!='':" + BR + " input = eval(resize_string)" + BR + " super = core.svp1.Super(input,super_params)" + BR + " vectors = core.svp1.Analyse(super[""clip""],super[""data""],input,analyse_params)" + BR + " smooth = core.svp2.SmoothFps(input,super[""clip""],super[""data""],vectors[""clip""],vectors[""data""],smoothfps_params,src=clip)" + BR + " smooth = core.std.AssumeFPS(smooth,fpsnum=smooth.fps_num,fpsden=smooth.fps_den)" + BR + " return smooth" + BR + "clip = interpolate(clip)"))
framerate.Filters.Add(New VideoFilter(framerate.Name, "SVPFlow | SVPFlow", "crop_string = """"" + BR + "resize_string = """"" + BR + "super_params = ""{pel:1,scale:{up:0},gpu:1,full:false,rc:true}""" + BR + "analyse_params = ""{block:{w:16},main:{search:{coarse:{type:2,distance:-6,bad:{sad:2000,range:24}},type:2}},refine:[{thsad:250}]}""" + BR + "smoothfps_params = ""{gpuid:11,linear:true,rate:{num:4,den:2},algo:23,mask:{area:200},scene:{}}""" + BR + "def interpolate(clip):" + BR + " input = clip" + BR + " if crop_string!='':" + BR + " input = eval(crop_string)" + BR + " if resize_string!='':" + BR + " input = eval(resize_string)" + BR + " super = core.svp1.Super(input,super_params)" + BR + " vectors = core.svp1.Analyse(super[""clip""],super[""data""],input,analyse_params)" + BR + " smooth = core.svp2.SmoothFps(input,super[""clip""],super[""data""],vectors[""clip""],vectors[""data""],smoothfps_params,src=clip)" + BR + " smooth = core.std.AssumeFPS(smooth,fpsnum=smooth.fps_num,fpsden=smooth.fps_den)" + BR + " return smooth" + BR + "clip = interpolate(clip)"))
ret.Add(framerate)

Dim color As New FilterCategory("Color")
Expand All @@ -743,7 +745,7 @@ Public Class FilterCategory
color.Filters.Add(New VideoFilter(color.Name, "Dither | SmoothGrad", "clip = muvsfunc.GradFun3(src=clip, mode=6, smode=1)"))
color.Filters.Add(New VideoFilter(color.Name, "Dither | Stack", "$select:Native to Stack16|clip = core.fmtc.nativetostack16(clip);Stack16 to Native|clip = fmtc.stack16tonative(clip)$"))
color.Filters.Add(New VideoFilter(color.Name, "Dither | To RGB / YUV", "clip = $select:To RGB|mvsfunc.ToRGB;To YUV|mvsfunc.ToYUV$(clip,matrix=""$select:msg:Select Matrix;470bg;240;709;2020;2020cl;bt2020c$"")"))
color.Filters.Add(New VideoFilter(color.Name, "ColorSpace | Conversion", "clip = core.fmtc.resample (clip, css=""444"")" + BR + "clip = core.fmtc.matrix (clip, mats=""$select:msg:Select Input Colorspace;240;601;709;2020$"", matd=""$select:msg:Select Output Colorspace;240;601;709;2020$"")" + BR + "clip = core.fmtc.resample (clip, css=""420"")" + BR + "clip = core.fmtc.bitdepth (clip, bits=8)"))
color.Filters.Add(New VideoFilter(color.Name, "ColorSpace | Respec", "clip = core.fmtc.resample (clip, css=""444"")" + BR + "clip = core.fmtc.matrix (clip, mats=""$select:msg:Select Input Colorspace;240;601;709;2020$"", matd=""$select:msg:Select Output Colorspace;240;601;709;2020$"")" + BR + "clip = core.fmtc.resample (clip, css=""420"")" + BR + "clip = core.fmtc.bitdepth (clip, bits=8)"))
color.Filters.Add(New VideoFilter(color.Name, "ColorSpace | Matrix", "clip = core.fmtc.matrix(clip, mat=""$select:msg:Select Matrix;Linear;470m;470bg;240m;SRGB;709;2020$"")"))
color.Filters.Add(New VideoFilter(color.Name, "ColorSpace | Primaries", "clip = core.fmtc.primaries(clip, prims=""$select:msg:Select Input;470m;470bg;240m;SRGB;709;2020$"", primd=""$select:msg:Select Output;Linear;470m;470bg;240m;SRGB;709;2020$"")"))
color.Filters.Add(New VideoFilter(color.Name, "ColorSpace | Transfer", "clip = core.fmtc.transfer(clip, transs=""$select:msg:Select Input;Linear;470m;470bg;240m;SRGB;709;2020;2084$"", transd=""$select:msg:Select Output;Linear;470m;470bg;240m;SRGB;709;2020;2084$"")"))
Expand Down

0 comments on commit 82e5ae8

Please sign in to comment.