This commit is contained in:
stax76
2017-07-12 20:11:15 +02:00
parent c525af0d28
commit db666f5bfa
17 changed files with 155 additions and 102 deletions
-1
View File
@@ -10,7 +10,6 @@ Public Class AOMEnc
Sub New()
Name = "AV1"
AutoCompCheckValue = 50
End Sub
<NonSerialized>
+1 -2
View File
@@ -13,7 +13,7 @@ Public MustInherit Class VideoEncoder
Overridable Property Passes As Integer
Overridable Property QualityMode As Boolean
Property AutoCompCheckValue As Integer = 70
Property AutoCompCheckValue As Integer = 50
Property Muxer As Muxer = New MkvMuxer
Public MustOverride Sub ShowConfigDialog()
@@ -252,7 +252,6 @@ Public MustInherit Class VideoEncoder
x264cli.OutputFileTypeValue = "h264"
x264cli.Name = "Command Line | x264"
x264cli.Muxer = New MkvMuxer()
x264cli.AutoCompCheckValue = 50
x264cli.CommandLines = """%app:x264%"" --pass 1 --bitrate %video_bitrate% --stats ""%target_temp_file%.stats"" --output NUL ""%script_file%"" || exit" + BR + """%app:x264%"" --pass 2 --bitrate %video_bitrate% --stats ""%target_temp_file%.stats"" --output ""%encoder_out_file%"" ""%script_file%"""
x264cli.CompCheckCommandLines = """%app:x264%"" --crf 18 --output ""%target_temp_file%_CompCheck.%encoder_ext%"" ""%target_temp_file%_CompCheck.%script_ext%"""
ret.Add(x264cli)
+14 -4
View File
@@ -9,7 +9,6 @@ Public Class x264Enc
Sub New()
Name = "x264"
AutoCompCheckValue = 50
Params.ApplyValues(True)
Params.ApplyValues(False)
End Sub
@@ -55,6 +54,7 @@ Public Class x264Enc
p.Script.Synchronize()
Using proc As New Proc
proc.Package = Package.x264
proc.Header = passName
proc.Priority = priority
proc.SkipStrings = {"kb/s, eta", "%]"}
@@ -129,7 +129,7 @@ Public Class x264Enc
newParams.Init(store)
newParams.ApplyValues(True)
Using f As New CommandLineForm(newParams)
Using form As New CommandLineForm(newParams)
Dim saveProfileAction = Sub()
Dim enc = ObjectHelp.GetCopy(Of x264Enc)(Me)
Dim params2 As New x264Params
@@ -140,9 +140,10 @@ Public Class x264Enc
SaveProfile(enc)
End Sub
ActionMenuItem.Add(f.cms.Items, "Save Profile...", saveProfileAction).SetImage(Symbol.Save)
ActionMenuItem.Add(form.cms.Items, "Save Profile...", saveProfileAction).SetImage(Symbol.Save)
If f.ShowDialog() = DialogResult.OK Then
If form.ShowDialog() = DialogResult.OK Then
AutoCompCheckValue = CInt(newParams.CompCheckAimedQuality.Value)
Params = newParams
ParamsStore = store
OnStateChange()
@@ -212,9 +213,17 @@ Public Class x264Params
Property CompCheck As New NumParam With {
.Name = "CompCheckQuant",
.Text = "Comp. Check",
.Help = "CRF value used as 100%",
.Value = 18,
.Config = {1, 50}}
Property CompCheckAimedQuality As New NumParam With {
.Name = "CompCheckAimedQuality",
.Text = "Aimed Quality",
.Value = 50,
.Help = "Percent value to adjusts the target file size or image size after the compressibility check accordingly.",
.Config = {1, 100}}
Property Custom As New StringParam With {
.Text = "Custom",
.AlwaysOn = True,
@@ -819,6 +828,7 @@ Public Class x264Params
DeblockA,
DeblockB,
CompCheck,
CompCheckAimedQuality,
SlowFirstpass,
New BoolParam With {.Switch = "--constrained-intra", .Text = "Constrained Intra Prediction"},
Cabac)
+11 -2
View File
@@ -10,7 +10,6 @@ Public Class x265Enc
Sub New()
Name = "x265"
AutoCompCheckValue = 50
Params.ApplyPresetDefaultValues()
Params.ApplyPresetValues()
End Sub
@@ -56,6 +55,7 @@ Public Class x265Enc
p.Script.Synchronize()
Using proc As New Proc
proc.Package = Package.x265
proc.Header = passName
proc.Encoding = Encoding.UTF8
proc.Priority = priority
@@ -146,6 +146,7 @@ Public Class x265Enc
ActionMenuItem.Add(f.cms.Items, "Save Profile...", saveProfileAction).SetImage(Symbol.Save)
If f.ShowDialog() = DialogResult.OK Then
AutoCompCheckValue = CInt(newParams.CompCheckAimedQuality.Value)
Params = newParams
ParamsStore = store
OnStateChange()
@@ -307,8 +308,16 @@ Public Class x265Params
.Name = "CompCheckQuant",
.Text = "Comp. Check",
.Value = 18,
.Help = "CRF value used as 100%",
.Config = {1, 50}}
Property CompCheckAimedQuality As New NumParam With {
.Name = "CompCheckAimedQuality",
.Text = "Aimed Quality",
.Value = 50,
.Help = "Percent value to adjusts the target file size or image size after the compressibility check accordingly.",
.Config = {1, 100}}
Property Weightp As New BoolParam With {
.Switch = "--weightp",
.NoSwitch = "--no-weightp",
@@ -849,7 +858,7 @@ Public Class x265Params
New StringParam With {.Switch = "--qpfile", .Text = "QP File", .Quotes = True, .BrowseFile = True},
New StringParam With {.Switch = "--recon", .Text = "Recon File", .Quotes = True, .BrowseFile = True},
New StringParam With {.Switch = "--scaling-list", .Text = "Scaling List", .Quotes = True},
Decoder, PsyRD, PsyRDOQ, CompCheck,
Decoder, PsyRD, PsyRDOQ, CompCheck, CompCheckAimedQuality,
New NumParam With {.Switch = "--recon-depth", .Text = "Recon Depth"},
RDpenalty)
Add("Other 2",
+4 -1
View File
@@ -2163,7 +2163,6 @@ Public Class MainForm
End If
Assistant()
g.RaiseAppEvent(ApplicationEvent.AfterSourceLoaded)
g.RaiseAppEvent(ApplicationEvent.ProjectOrSourceLoaded)
Log.Save()
@@ -5895,6 +5894,10 @@ Public Class MainForm
ProcessCommandLine(Environment.GetCommandLineArgs)
End If
'Using form As New TestForm
' form.ShowDialog()
'End Using
MyBase.OnShown(e)
End Sub
+15 -3
View File
@@ -222,12 +222,14 @@ Public Class ProcForm
NotifyIcon.Text = "StaxRip"
TaskbarButtonCreatedMessage = Native.RegisterWindowMessage("TaskbarButtonCreated")
NotifyIcon.Visible = s.MinimizeToTray
If ProcForm.IsMinimized Then
WindowState = FormWindowState.Minimized
If s.MinimizeToTray Then ShowInTaskbar = False
ShowInTaskbar = Not s.MinimizeToTray
End If
Dim posX = Registry.CurrentUser.GetInt("Software\" + Application.ProductName, "ProcForm Pos X")
If posX <> 0 Then s.WindowPositions.Positions(s.WindowPositions.GetKey(Me)) = New Point(posX, Registry.CurrentUser.GetInt("Software\" + Application.ProductName, "ProcForm Pos Y"))
End Sub
Private Sub cbShutdown_SelectedIndexChanged() Handles mbShutdown.ValueChangedUser
@@ -235,7 +237,7 @@ Public Class ProcForm
End Sub
Private Sub NotifyIcon_MouseClick() Handles NotifyIcon.MouseClick
BeginInvoke(Sub() ShowForm())
ShowForm()
End Sub
Private Sub bnJobs_Click() Handles bnJobs.Click
@@ -268,6 +270,7 @@ Public Class ProcForm
ProcForm.IsMinimized = True
If s.MinimizeToTray Then
NotifyIcon.Visible = True
Hide()
Exit Sub
End If
@@ -312,4 +315,13 @@ Public Class ProcForm
MyBase.OnHandleCreated(e)
WasHandleCreated = True
End Sub
Protected Overrides Sub OnMove(e As EventArgs)
MyBase.OnMove(e)
If Left <> 0 Then
Registry.CurrentUser.Write("Software\" + Application.ProductName, "ProcForm Pos X", Left)
Registry.CurrentUser.Write("Software\" + Application.ProductName, "ProcForm Pos Y", Top)
End If
End Sub
End Class
+9 -22
View File
@@ -22,35 +22,23 @@ Partial Class TestForm
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.ListBox1 = New System.Windows.Forms.ListBox()
Me.ListBoxEx1 = New StaxRip.UI.ListBoxEx()
Me.ListViewEx1 = New StaxRip.UI.ListViewEx()
Me.SuspendLayout()
'
'ListBox1
'ListViewEx1
'
Me.ListBox1.FormattingEnabled = True
Me.ListBox1.ItemHeight = 48
Me.ListBox1.Location = New System.Drawing.Point(30, 204)
Me.ListBox1.Name = "ListBox1"
Me.ListBox1.Size = New System.Drawing.Size(420, 340)
Me.ListBox1.TabIndex = 0
'
'ListBoxEx1
'
Me.ListBoxEx1.FormattingEnabled = True
Me.ListBoxEx1.ItemHeight = 48
Me.ListBoxEx1.Location = New System.Drawing.Point(507, 199)
Me.ListBoxEx1.Name = "ListBoxEx1"
Me.ListBoxEx1.Size = New System.Drawing.Size(405, 340)
Me.ListBoxEx1.TabIndex = 1
Me.ListViewEx1.Location = New System.Drawing.Point(317, 177)
Me.ListViewEx1.Name = "ListViewEx1"
Me.ListViewEx1.Size = New System.Drawing.Size(498, 413)
Me.ListViewEx1.TabIndex = 0
Me.ListViewEx1.UseCompatibleStateImageBehavior = False
'
'TestForm
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(288.0!, 288.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi
Me.ClientSize = New System.Drawing.Size(1108, 787)
Me.Controls.Add(Me.ListBoxEx1)
Me.Controls.Add(Me.ListBox1)
Me.Controls.Add(Me.ListViewEx1)
Me.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Name = "TestForm"
Me.ShowIcon = False
@@ -60,6 +48,5 @@ Partial Class TestForm
End Sub
Friend WithEvents ListBox1 As ListBox
Friend WithEvents ListBoxEx1 As UI.ListBoxEx
Friend WithEvents ListViewEx1 As UI.ListViewEx
End Class
+10 -4
View File
@@ -1,17 +1,23 @@
Public Class TestForm
Sub New()
InitializeComponent()
End Sub
Protected Overrides Sub OnShown(e As EventArgs)
MyBase.OnShown(e)
Dim l As New List(Of String)
Dim l As New List(Of StringBooleanPair)
For x = 0 To 1000
l.Add(x.ToString)
For x = 0 To 100000
Dim pa As New StringBooleanPair(x.ToString, x Mod 2 = 0)
l.Add(pa)
Next
ListBoxEx1.Items.AddRange(l.ToArray)
ListViewEx1.CheckBoxes = True
ListViewEx1.EnableListBoxMode()
ListViewEx1.ItemCheckProperty = NameOf(StringBooleanPair.Value)
ListViewEx1.AddItems(l)
ListViewEx1.SelectFirst()
End Sub
End Class
-2
View File
@@ -76,8 +76,6 @@ Public Class GlobalClass
Else
g.MainForm.OpenProject(jobPath, False)
End If
ProcController.Aborted = False
End Try
End Sub
+21
View File
@@ -123,6 +123,27 @@ Public Class Package
.Description = "TDeint is a bi-directionally, motion adaptive, sharp deinterlacer. It can adaptively choose between using per-field and per-pixel motion adaptivity, and can use cubic interpolation, kernel interpolation (with temporal direction switching), or one of two forms of modified ELA interpolation which help to reduce ""jaggy"" edges in moving areas where interpolation must be used.",
.AviSynthFilterNames = {"TDeint"}})
Shared Property modPlus As Package = Add(New PluginPackage With {
.Name = "modPlus",
.Filename = "modPlus.dll",
.URL = "http://www.avisynth.nl/users/vcmohan/modPlus/modPlus.html",
.Description = "This plugin has 9 functions, which modify values of color components to attenuate noise, blur or equalize input.",
.AviSynthFilterNames = {"GBlur", "MBlur", "Median", "minvar", "Morph", "SaltPepper", "SegAmp", "TweakHist", "Veed"}})
Shared Property AutoAdjust As Package = Add(New PluginPackage With {
.Name = "AutoAdjust",
.Filename = "AutoAdjust.dll",
.URL = "https://forum.doom9.org/showthread.php?t=167573",
.Description = "AutoAdjust is an automatic adjustement filter. It calculates statistics of clip, stabilizes them temporally and uses them to adjust luminance gain & color balance.",
.AviSynthFilterNames = {"AutoAdjust"}})
Shared Property SmoothAdjust As Package = Add(New PluginPackage With {
.Name = "SmoothAdjust",
.Filename = "SmoothAdjust.dll",
.URL = "https://forum.doom9.org/showthread.php?t=154971",
.Description = "SmoothAdjust is a set of 5 plugins to make YUV adjustements.",
.AviSynthFilterNames = {"SmoothTweak", "SmoothCurve", "SmoothCustom", "SmoothTools"}})
Shared Property VSRip As Package = Add(New Package With {
.Name = "VSRip",
.Filename = "VSRip.exe",
+6 -6
View File
@@ -6,9 +6,8 @@ Imports System.Runtime.InteropServices
Public Class Proc
Implements IDisposable
Property Abort As Boolean
Property IsSilent As Boolean
Property TrowAbortException As Boolean
Property ReTrowException As Boolean
Property Process As New Process
Property Wait As Boolean
Property Priority As ProcessPriorityClass = ProcessPriorityClass.Normal
@@ -217,7 +216,7 @@ Public Class Proc
Sub KillAndThrow()
Try
TrowAbortException = True
Abort = True
If Not Process.HasExited Then
If Process.ProcessName = "cmd" Then
@@ -255,12 +254,13 @@ Public Class Proc
Process.BeginOutputReadLine()
Process.BeginErrorReadLine()
End If
Catch ex As AbortException
Throw ex
Catch ex As Exception
Dim msg = ex.Message
If File <> "" Then msg += BR2 + "File: " + File
If Arguments <> "" Then msg += BR2 + "Arguments: " + Arguments
MsgError(msg)
If ReTrowException Then Throw New AbortException
End Try
Try
@@ -273,7 +273,7 @@ Public Class Proc
ExitCode = Process.ExitCode
Process.Close()
If TrowAbortException Then Throw New AbortException
If Abort Then Throw New AbortException
If AllowedExitCodes.Length > 0 AndAlso Not AllowedExitCodes.Contains(ExitCode) Then
Dim ntdllHandle = Native.LoadLibrary("NTDLL.DLL")
@@ -324,7 +324,7 @@ Public Class Proc
Throw e
End Try
If TrowAbortException Then Throw New AbortException
If Abort Then Throw New AbortException
End Sub
Private DisposedValue As Boolean = False
+39 -36
View File
@@ -40,9 +40,9 @@ Public Class ProcController
ProcForm.pnLogHost.Controls.Add(LogTextBox)
ProcForm.pnStatusHost.Controls.Add(StatusLabel)
ProcForm.flpNav.Controls.Add(CheckBox)
ProcForm.NotifyIcon.Visible = s.MinimizeToTray
AddHandler proc.ProcDisposed, AddressOf ProcDisposed
AddHandler proc.Process.OutputDataReceived, AddressOf DataReceived
AddHandler proc.Process.ErrorDataReceived, AddressOf DataReceived
End Sub
@@ -118,16 +118,6 @@ Public Class ProcController
For Each i In Procs.ToArray
i.Proc.KillAndThrow()
Next
ShowMainForm()
End Sub
Shared Sub ShowMainForm()
g.MainForm.BeginInvoke(Sub()
g.MainForm.Show()
g.MainForm.Refresh()
g.MainForm.Activate()
End Sub)
End Sub
Shared Sub Suspend()
@@ -168,10 +158,18 @@ Public Class ProcController
End Function
Sub Cleanup()
ProcForm.flpNav.Controls.Remove(CheckBox)
SyncLock Procs
Procs.Remove(Me)
ProcForm.flpNav.Controls.Remove(CheckBox)
RemoveHandler Proc.ProcDisposed, AddressOf ProcDisposed
RemoveHandler Proc.Process.OutputDataReceived, AddressOf DataReceived
RemoveHandler Proc.Process.ErrorDataReceived, AddressOf DataReceived
ProcForm.pnLogHost.Controls.Remove(LogTextBox)
ProcForm.pnStatusHost.Controls.Remove(StatusLabel)
LogTextBox.Dispose()
StatusLabel.Dispose()
For Each i In Procs
i.Deactivate()
@@ -180,23 +178,24 @@ Public Class ProcController
If Procs.Count > 0 Then Procs(0).Activate()
End SyncLock
RemoveHandler Proc.ProcDisposed, AddressOf ProcDisposed
RemoveHandler Proc.Process.OutputDataReceived, AddressOf DataReceived
RemoveHandler Proc.Process.ErrorDataReceived, AddressOf DataReceived
ProcForm.pnLogHost.Controls.Remove(LogTextBox)
ProcForm.pnStatusHost.Controls.Remove(StatusLabel)
LogTextBox.Dispose()
StatusLabel.Dispose()
If Not Proc.Succeeded Then ProcForm.Abort()
If Not Proc.Succeeded Then ProcController.Abort()
Task.Run(Sub()
Thread.Sleep(500)
SyncLock Procs
If Procs.Count = 0 Then
If ProcForm.Visible Then ProcForm.BeginInvoke(Sub() ProcForm.Hide())
If Not g.MainForm.Visible Then ShowMainForm()
ProcForm.BeginInvoke(Sub()
ProcForm.NotifyIcon.Visible = False
ProcForm.Hide()
End Sub)
g.MainForm.BeginInvoke(Sub()
g.MainForm.Show()
g.MainForm.Refresh()
g.MainForm.Activate()
ProcController.Aborted = False
End Sub)
End If
End SyncLock
End Sub)
@@ -220,9 +219,8 @@ Public Class ProcController
End Sub
Shared Sub AddProc(proc As Proc)
Dim pc As New ProcController(proc)
SyncLock Procs
Dim pc As New ProcController(proc)
Procs.Add(pc)
If Procs.Count = 1 Then
@@ -233,24 +231,29 @@ Public Class ProcController
End SyncLock
End Sub
Shared CreateProcForm As New Object
Shared Sub Start(proc As Proc)
If Aborted Then Throw New AbortException
If g.MainForm.Visible Then g.MainForm.Hide()
SyncLock CreateProcForm
SyncLock Procs
If g.ProcForm Is Nothing Then
g.ProcForm = New ProcForm
Task.Run(Sub() Application.Run(g.ProcForm))
End If
Task.Run(Sub()
g.ProcForm = New ProcForm
Application.Run(g.ProcForm)
End Sub)
While Not ProcForm.WasHandleCreated
Thread.Sleep(50)
End While
While Not ProcForm.WasHandleCreated
Thread.Sleep(50)
End While
End If
End SyncLock
g.ProcForm.Invoke(Sub()
If Not ProcForm.IsMinimized Then g.ProcForm.Show()
If Not ProcForm.IsMinimized Then
g.ProcForm.Show()
g.ProcForm.Activate()
End If
AddProc(proc)
End Sub)
End Sub
+2 -2
View File
@@ -148,12 +148,12 @@ Public Class Project
If Check(VideoEncoder, "Video Encoder", 75) Then VideoEncoder = New x264Enc
If Check(Audio0, "Audio Track 1", 36) Then
Audio0 = New GUIAudioProfile(AudioCodec.AAC, 0.35)
Audio0 = New GUIAudioProfile(AudioCodec.AAC, 0.4)
Audio0.Language = New Language(CultureInfo.CurrentCulture.TwoLetterISOLanguageName, True)
End If
If Check(Audio1, "Audio Track 2", 36) Then
Audio1 = New GUIAudioProfile(AudioCodec.AAC, 0.35)
Audio1 = New GUIAudioProfile(AudioCodec.AAC, 0.4)
Audio1.Language = New Language("en", True)
End If
+1 -1
View File
@@ -7,4 +7,4 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyCopyright("stax76")>
<Assembly: ComVisible(False)>
<Assembly: Guid("54d5dc0f-6ba7-42f0-a82f-9c71d561cb8b")>
<Assembly: AssemblyVersion("1.5.2.1")>
<Assembly: AssemblyVersion("1.5.2.3")>
+1 -5
View File
@@ -73,11 +73,7 @@ Namespace UI
End Sub
Sub RefreshItem(index As Integer)
If ItemCheckProperty <> "" Then
Items(index).Checked = CBool(Items(index).Tag.GetType.GetProperty(
ItemCheckProperty).GetValue(Items(index).Tag))
End If
If ItemCheckProperty <> "" Then Items(index).Checked = CBool(Items(index).Tag.GetType.GetProperty(ItemCheckProperty).GetValue(Items(index).Tag))
Items(index).Text = Items(index).Tag.ToString
End Sub
+5 -11
View File
@@ -466,7 +466,7 @@ Namespace UI
<Serializable()>
Public Class WindowPositions
Private Positions As New Dictionary(Of String, Point)
Public Positions As New Dictionary(Of String, Point)
Private WindowStates As New Dictionary(Of String, FormWindowState)
Sub Save(f As Form)
@@ -475,9 +475,7 @@ Namespace UI
End Sub
Private Sub SavePosition(f As Form)
If f.WindowState = FormWindowState.Normal Then
Positions(GetKey(f)) = f.Location
End If
If f.WindowState = FormWindowState.Normal Then Positions(GetKey(f)) = f.Location
End Sub
Private Sub SaveWindowState(f As Form)
@@ -511,9 +509,7 @@ Namespace UI
Sub RestorePosition(form As Form)
Dim v = GetText(form)
If Not s.WindowPositionsCenterScreen.NothingOrEmpty AndAlso
Not TypeOf form Is InputBoxForm Then
If Not s.WindowPositionsCenterScreen.NothingOrEmpty AndAlso Not TypeOf form Is InputBoxForm Then
For Each i In s.WindowPositionsCenterScreen
If v.StartsWith(i) OrElse i = "all" Then
CenterScreen(form)
@@ -522,9 +518,7 @@ Namespace UI
Next
End If
If Not s.WindowPositionsRemembered.NothingOrEmpty AndAlso
Not TypeOf form Is InputBoxForm Then
If Not s.WindowPositionsRemembered.NothingOrEmpty AndAlso Not TypeOf form Is InputBoxForm Then
For Each i In s.WindowPositionsRemembered
If v.StartsWith(i) OrElse i = "all" Then
RestorePositionInternal(form)
@@ -534,7 +528,7 @@ Namespace UI
End If
End Sub
Private Function GetKey(f As Form) As String
Function GetKey(f As Form) As String
Return f.Name + f.GetType().FullName + GetText(f)
End Function
+16
View File
@@ -12,6 +12,22 @@ https://drive.google.com/open?id=0B-gPKiJYuKuITld4dzhuTC1WWWM
https://onedrive.live.com/redir?resid=604D4754F64B0ABC!4140&authkey=!ANUm9V3vTPmEFNI&ithint=folder%2c7z
#### 1.5.2.3 unstable test build
- new: aimed quality feature of the old x264 GUI added to the x264 and x265 GUI
- fix: unable to recover processing form from tray
- fix: unable to open new files (start new processes) after the process abortion feature was used
- update: x265 2.4+99
#### 1.5.2.2 unstable test build
- new: AviSynth+ x64 plugins added: modPlus, SmoothAdjust, AutoAdjust
- update: NNEDI3 0.9.4.44
- update: KNLMeansCL 1.1.0
#### 1.5.2.1 unstable test build
- new: various new features and improvements in the apps management dialog