x264 portable mode uses --synth-lib

This commit is contained in:
Frank Skare
2021-01-31 12:30:02 +01:00
parent 89c963fc3e
commit 0cd006ca40
9 changed files with 61 additions and 53 deletions
+3 -1
View File
@@ -8,10 +8,12 @@
- NVEnc parameter fixes and option re-organisation (Dendraspis, [#468](/../../issues/468))
- x265 two parameters not set when checkbox unchecked (Dendraspis)
- Optional customized/shorter progress text while encoding for x264/x265 (Dendraspis)
- x265 avs portable mode sets --reader-options library=avs-dll-path (stax76)
- x264 portable mode uses --synth-lib (stax76)
- x265 portable mode uses --reader-options library (stax76)
- x265 3.4+65-aMod-gcc10.2.1 DJATOM Mod, avs portable support,
vs async frame requests logic overhaul ([#470](/../../issues/470))
- FFT3dGPU 0.8.6
- x264 aMod-core161-r3039+17 DJATOM (--synth-lib)
2.1.7.5 Beta (2021-01-23)
+1 -1
View File
@@ -946,7 +946,7 @@ Public Class NVEnc
Case "avs"
sourcePath = p.Script.Path
If includePaths AndAlso FrameServerHelp.IsAviSynthPortableUsed Then
If includePaths AndAlso FrameServerHelp.IsPortable Then
ret += " --avsdll " + Package.AviSynth.Path.Escape
End If
Case "nvhw"
+1 -1
View File
@@ -414,7 +414,7 @@ Public Class QSVEnc
Case "avs"
sourcePath = p.Script.Path
If includePaths AndAlso FrameServerHelp.IsAviSynthPortableUsed Then
If includePaths AndAlso FrameServerHelp.IsPortable Then
ret += " --avsdll " + Package.AviSynth.Path.Escape
End If
Case "qshw"
+1 -1
View File
@@ -240,7 +240,7 @@ Public Class VCEEnc
Case "avs"
sourcePath = p.Script.Path
If includePaths AndAlso FrameServerHelp.IsAviSynthPortableUsed Then
If includePaths AndAlso FrameServerHelp.IsPortable Then
ret += " --avsdll " + Package.AviSynth.Path.Escape
End If
Case "qs"
+25 -24
View File
@@ -1,4 +1,5 @@

Imports System.Text
Imports StaxRip.CommandLine
Imports StaxRip.UI
@@ -990,7 +991,7 @@ Public Class x264Params
ApplyValues(True)
Dim args As String
Dim sb As New StringBuilder
Dim pipeTool = If(p.Script.IsAviSynth, PipingToolAVS, PipingToolVS).ValueText
If includePaths AndAlso includeExecutable Then
@@ -1012,7 +1013,7 @@ Public Class x264Params
Case "avs2pipemod y4m"
Dim dll As String
If FrameServerHelp.IsAviSynthPortableUsed Then
If FrameServerHelp.IsPortable Then
dll = " -dll=" + Package.AviSynth.Path.Escape
End If
@@ -1020,7 +1021,7 @@ Public Class x264Params
Case "avs2pipemod raw"
Dim dll As String
If FrameServerHelp.IsAviSynthPortableUsed Then
If FrameServerHelp.IsPortable Then
dll = " -dll=" + Package.AviSynth.Path.Escape
End If
@@ -1031,37 +1032,37 @@ Public Class x264Params
pipeCmd = Package.ffmpeg.Path.Escape + If(p.Script.IsVapourSynth, " -f vapoursynth", "") + " -i " + script.Path.Escape + " -f rawvideo -strict -1 -loglevel fatal -hide_banner - | "
End Select
args += pipeCmd + Package.x264.Path.Escape
sb.Append(pipeCmd + Package.x264.Path.Escape)
End If
If Mode.Value = x264RateMode.TwoPass OrElse Mode.Value = x264RateMode.ThreePass Then
args += " --pass " & pass
sb.Append(" --pass " & pass)
If pass = 1 Then
If CustomFirstPass.Value <> "" Then
args += " " + CustomFirstPass.Value
sb.Append(" " + CustomFirstPass.Value)
End If
Else
If CustomSecondPass.Value <> "" Then
args += " " + CustomSecondPass.Value
sb.Append(" " + CustomSecondPass.Value)
End If
End If
End If
If Mode.Value = x264RateMode.Quantizer Then
If Not IsCustom(pass, "--qp") Then
args += " --qp " + CInt(Quant.Value).ToString
sb.Append(" --qp " + CInt(Quant.Value).ToString)
End If
ElseIf Mode.Value = x264RateMode.Quality Then
If Not IsCustom(pass, "--crf") Then
args += " --crf " + Quant.Value.ToInvariantString
sb.Append(" --crf " + Quant.Value.ToInvariantString)
End If
Else
If Not IsCustom(pass, "--bitrate") Then
If Bitrate.Value <> 0 Then
args += " --bitrate " & Bitrate.Value
sb.Append(" --bitrate " & Bitrate.Value)
Else
args += " --bitrate " & p.VideoBitrate
sb.Append(" --bitrate " & p.VideoBitrate)
End If
End If
End If
@@ -1069,17 +1070,17 @@ Public Class x264Params
Dim q = From i In Items Where i.GetArgs <> "" AndAlso Not IsCustom(pass, i.Switch)
If q.Count > 0 Then
args += " " + q.Select(Function(item) item.GetArgs).Join(" ")
End If
If args.Contains("%") Then
args = Macro.Expand(args)
sb.Append(" " + q.Select(Function(item) item.GetArgs).Join(" "))
End If
If includePaths Then
Dim input = If(pipeTool = "none", script.Path.Escape, "-")
Dim dmx = Demuxer.ValueText
If pipeTool = "none" AndAlso FrameServerHelp.IsPortable Then
sb.Append(" --synth-lib " + FrameServerHelp.GetSynthPath.Escape)
End If
If dmx = "automatic" Then
If pipeTool = "none" Then
dmx = ""
@@ -1092,31 +1093,31 @@ Public Class x264Params
If dmx <> "" Then
Dim info = script.GetInfo
args += $" --demuxer {dmx} --frames " & info.FrameCount
sb.Append($" --demuxer {dmx} --frames " & info.FrameCount)
If dmx = "raw" Then
args += $" --input-res {info.Width}x{info.Height}"
sb.Append($" --input-res {info.Width}x{info.Height}")
If Not args.Contains("--fps ") Then
args += $" --fps {info.FrameRateNum}/{info.FrameRateDen}"
If Not sb.ToString.Contains("--fps ") Then
sb.Append($" --fps {info.FrameRateNum}/{info.FrameRateDen}")
End If
End If
End If
If Mode.Value = x264RateMode.TwoPass OrElse Mode.Value = x264RateMode.ThreePass Then
args += " --stats " + (p.TempDir + p.TargetFile.Base + ".stats").Escape
sb.Append(" --stats " + (p.TempDir + p.TargetFile.Base + ".stats").Escape)
End If
If (Mode.Value = x264RateMode.ThreePass AndAlso (pass = 1 OrElse pass = 3)) OrElse
Mode.Value = x264RateMode.TwoPass AndAlso pass = 1 Then
args += " --output NUL " + input
sb.Append(" --output NUL " + input)
Else
args += " --output " + targetPath.Escape + " " + input
sb.Append(" --output " + targetPath.Escape + " " + input)
End If
End If
Return args.Trim.FixBreak.Replace(BR, " ")
Return Macro.Expand(sb.ToString.Trim.FixBreak.Replace(BR, " "))
End Function
Function GetPartitionsArg() As String
+4 -5
View File
@@ -1223,7 +1223,7 @@ Public Class x265Params
Select Case pipeTool
Case "avs2pipemod"
Dim chunk = If(isSingleChunk, "", $" -trim={startFrame},{endFrame}")
Dim dll = If(FrameServerHelp.IsAviSynthPortableUsed, $" -dll={Package.AviSynth.Path.Escape}", "")
Dim dll = If(FrameServerHelp.IsPortable, $" -dll={Package.AviSynth.Path.Escape}", "")
pipeString = Package.avs2pipemod.Path.Escape + dll + chunk + " -y4mp " + script.Path.Escape + " | "
sb.Append(pipeString + Package.x265.Path.Escape)
@@ -1260,6 +1260,7 @@ Public Class x265Params
pipeString = Package.ffmpeg.Path.Escape + If(p.Script.IsVapourSynth, " -f vapoursynth", "") + " -i " + script.Path.LongPathPrefix.Escape + " -f yuv4mpegpipe -strict -1 -loglevel fatal -hide_banner - | "
sb.Append(pipeString + Package.x265.Path.Escape)
If isSingleChunk Then
If Seek.Value > 0 Then
sb.Append($" --seek {Seek.Value}")
@@ -1276,10 +1277,8 @@ Public Class x265Params
Case "none"
sb.Append(pipeString + Package.x265.Path.Escape)
If p.Script.IsVapourSynth AndAlso FrameServerHelp.IsVapourSynthPortableUsed Then
sb.Append($" --reader-options library={(Package.VapourSynth.Directory + "VSScript.dll").Escape}")
ElseIf p.Script.IsAviSynth AndAlso FrameServerHelp.IsAviSynthPortableUsed Then
sb.Append($" --reader-options library={Package.AviSynth.Path.Escape}")
If FrameServerHelp.IsPortable Then
sb.Append(" --reader-options library=" + FrameServerHelp.GetSynthPath.Escape)
End If
If isSingleChunk Then
+20 -16
View File
@@ -418,6 +418,10 @@ Public Class VfwFrameServer
End Class
Public Class FrameServerHelp
Shared Function GetSynthPath() As String
Return If(IsAviSynth(), Package.AviSynth.Path, Package.VapourSynth.Directory + "VSScript.dll")
End Function
Shared Function GetAviSynthInstallPath() As String
Return Registry.ClassesRoot.GetString("CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32", Nothing)
End Function
@@ -432,17 +436,17 @@ Public Class FrameServerHelp
Next
End Function
Shared Function IsAviSynthPortableUsed() As Boolean
Return Not Package.AviSynth.Path.PathEquals(GetAviSynthInstallPath)
Shared Function IsAviSynthPortable() As Boolean
Return s.AviSynthMode = FrameServerMode.Portable
End Function
Shared Function IsVapourSynthPortableUsed() As Boolean
Return Not Package.VapourSynth.Path.PathEquals(GetVapourSynthInstallPath)
Shared Function IsVapourSynthPortable() As Boolean
Return s.VapourSynthMode = FrameServerMode.Portable
End Function
Shared Function IsPortable() As Boolean
If (IsAviSynthUsed() AndAlso IsAviSynthPortableUsed()) OrElse
(IsVapourSynthUsed() AndAlso IsVapourSynthPortableUsed()) Then
If (IsAviSynth() AndAlso IsAviSynthPortable()) OrElse
(IsVapourSynth() AndAlso IsVapourSynthPortable()) Then
Return True
End If
@@ -452,17 +456,17 @@ Public Class FrameServerHelp
Return (Folder.System + "AviSynth.dll").FileExists
End Function
Shared Function IsAviSynthUsed() As Boolean
Shared Function IsAviSynth() As Boolean
Return p.Script.IsAviSynth
End Function
Shared Function IsVapourSynthUsed() As Boolean
Shared Function IsVapourSynth() As Boolean
Return p.Script.Engine = ScriptEngine.VapourSynth
End Function
Shared Function IsVfwUsed() As Boolean
Return (IsAviSynthUsed() AndAlso s.AviSynthMode = FrameServerMode.VFW) OrElse
(IsVapourSynthUsed() AndAlso s.VapourSynthMode = FrameServerMode.VFW)
Return (IsAviSynth() AndAlso s.AviSynthMode = FrameServerMode.VFW) OrElse
(IsVapourSynth() AndAlso s.VapourSynthMode = FrameServerMode.VFW)
End Function
Shared Function IsffmpegUsed() As Boolean
@@ -476,7 +480,7 @@ Public Class FrameServerHelp
End Function
Shared Function AreAviSynthLinksRequired() As Boolean
If IsAviSynthUsed() AndAlso IsAviSynthPortableUsed() Then
If IsAviSynth() AndAlso IsAviSynthPortable() Then
If IsffmpegUsed() Then
Return True
End If
@@ -492,7 +496,7 @@ Public Class FrameServerHelp
End Function
Shared Function VerifyAviSynthLinks() As Boolean
Dim packages = {Package.ffmpeg, Package.x264}
Dim packages = {Package.ffmpeg}
Dim links = packages.Select(Function(pack) New SoftLink(
pack.Directory + "AviSynth.dll", Package.AviSynth.Path)).ToArray
@@ -505,9 +509,9 @@ Public Class FrameServerHelp
Using td As New TaskDialog(Of Boolean)
td.MainIcon = TaskDialogIcon.Shield
td.MainInstruction = "AviSynth Portable Mode"
td.Content = "The current configuration uses AviSynth portable mode with AviSynth tools " +
"that do not support portable mode, to workaround this it's required to " +
"create soft links that are pointing to the location of portable AviSynth."
td.Content = "The current configuration uses AviSynth portable mode With AviSynth tools " +
"that Do Not support portable mode, To workaround this it's required to " +
"create soft links that are pointing to the location of portable AviSynth."
td.AddCommand("Create portable AviSynth soft links", True)
If td.Show Then
@@ -518,7 +522,7 @@ Public Class FrameServerHelp
Return SoftLink.AreLinksValid(links)
End If
ElseIf Not IsAviSynthPortableUsed() Then
ElseIf Not IsAviSynthPortable() Then
Try
SoftLink.DeleteLinks(links)
Catch ex As Exception
+3 -1
View File
@@ -888,6 +888,8 @@ Public Class Package
.Name = "FFT3DGPU",
.Filename = "FFT3dGPU.dll",
.Description = "Similar algorithm to FFT3DFilter, but uses graphics hardware for increased speed.",
.WebURL = "https://github.com/pinterf/FFT3dGPU",
.DownloadURL = "https://github.com/pinterf/FFT3dGPU/releases",
.HelpURL = "https://htmlpreview.github.io/?https://github.com/pinterf/FFT3dGPU/blob/master/FFT3dGPU/documentation/fft3dgpu.htm",
.AvsFilterNames = {"FFT3DGPU"},
.AvsFiltersFunc = Function() {New VideoFilter("Noise", "FFT3DFilter | FFT3DGPU", "FFT3DGPU(sigma=1.5, bt=3, bw=32, bh=32, ow=16, oh=16, sharpen=0.4, NVPerf=$select:msg:Enable Nvidia Function;True;False$)")}})
@@ -2330,7 +2332,7 @@ Public Class Package
End Function
Shared Function GetPythonHintDir() As String
If Not FrameServerHelp.IsVapourSynthPortableUsed Then
If Not FrameServerHelp.IsVapourSynthPortable Then
Dim exePath As String
For Each key In {Registry.CurrentUser, Registry.LocalMachine}
+3 -3
View File
@@ -127,8 +127,8 @@ Tools
"SVT-AV1","Console App","SvtAv1EncApp.exe","0.8.6","2020-11-29"
"VCEEnc","Console App","VCEEncC64.exe","6.07","2020-11-23"
"vspipe","Console App","vspipe.exe","r52","2020-08-20"
"x264","Console App","x264.exe","M-0.161.3027-4121277-x64-gcc10.2.0 Patman","2020-12-16"
"x265","Console App","x265.exe","3.4+65-aMod-gcc10.2.1 DJATOM Mod","2021-01-24"
"x264","Console App","x264.exe","aMod-core161-r3039+17 DJATOM","2021-01-27"
"x265","Console App","x265.exe","3.4+65-aMod-gcc10.2.1 DJATOM Mod","2021-01-25"
"xvid_encraw","Console App","xvid_encraw.exe","1.3.7",""
"BDSup2Sub++","GUI App","bdsup2sub++.exe","1.0.3","2018-05-09"
"chapterEditor","GUI App","chapterEditor.exe","1.25","2020-10-04"
@@ -790,7 +790,7 @@ Similar algorithm to FFT3DFilter, but uses graphics hardware for increased speed
Filters: FFT3DGPU
https://github.com/pinterf/FFT3dGPU
flash3kyuu_deband