diff --git a/README.md b/README.md index f3f290b..0b755c3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # rav1e_gui [![Travis Build Status](https://travis-ci.org/moisesmcardona/rav1e_gui.svg?branch=master)](https://travis-ci.org/moisesmcardona/rav1e_gui) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/moisesmcardona/rav1e_gui?branch=master&svg=true)](https://ci.appveyor.com/project/moisesmcardona/rav1e-gui) A GUI to convert video files to AV1 using rav1e -![Main Window Screenshot](https://moisescardona.me/wp-content/uploads/2019/04/rav1e-GUI-v1.12-Main-Window.png) +![Main Window Screenshot](https://moisescardona.me/wp-content/uploads/2019/07/rav1e-GUI-v1.13.png) ![Advanced Encoder Options Window Screenshot](https://moisescardona.me/wp-content/uploads/2019/04/rav1e-GUI-v1.11-Advanced-Options.png) diff --git a/rav1e_gui/Form1.Designer.vb b/rav1e_gui/Form1.Designer.vb index 91159d5..85b22a3 100644 --- a/rav1e_gui/Form1.Designer.vb +++ b/rav1e_gui/Form1.Designer.vb @@ -34,12 +34,12 @@ Partial Class Form1 Me.Label5 = New System.Windows.Forms.Label() Me.Label6 = New System.Windows.Forms.Label() Me.GroupBox1 = New System.Windows.Forms.GroupBox() + Me.videoBitrate = New System.Windows.Forms.NumericUpDown() Me.UseTilingCheckbox = New System.Windows.Forms.CheckBox() Me.twoPass = New System.Windows.Forms.CheckBox() Me.Label16 = New System.Windows.Forms.Label() Me.ShowPSNRMetrics = New System.Windows.Forms.CheckBox() Me.CPUThreads = New System.Windows.Forms.NumericUpDown() - Me.videoBitrate = New System.Windows.Forms.TextBox() Me.Label15 = New System.Windows.Forms.Label() Me.useBitrate = New System.Windows.Forms.RadioButton() Me.AdvancedEncoderOptionsButton = New System.Windows.Forms.Button() @@ -70,6 +70,7 @@ Partial Class Form1 Me.ClearLogBtn = New System.Windows.Forms.Button() Me.SaveLogBtn = New System.Windows.Forms.Button() Me.GroupBox1.SuspendLayout() + CType(Me.videoBitrate, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.CPUThreads, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.quantizer, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.MaxKeyFrameInterval, System.ComponentModel.ISupportInitialize).BeginInit() @@ -188,19 +189,19 @@ Partial Class Form1 Me.Label6.Name = "Label6" Me.Label6.Size = New System.Drawing.Size(34, 13) Me.Label6.TabIndex = 12 - Me.Label6.Text = "v1.12" + Me.Label6.Text = "v1.13" ' 'GroupBox1 ' Me.GroupBox1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.GroupBox1.Controls.Add(Me.videoBitrate) Me.GroupBox1.Controls.Add(Me.UseTilingCheckbox) Me.GroupBox1.Controls.Add(Me.twoPass) Me.GroupBox1.Controls.Add(Me.Label16) Me.GroupBox1.Controls.Add(Me.ShowPSNRMetrics) Me.GroupBox1.Controls.Add(Me.CPUThreads) - Me.GroupBox1.Controls.Add(Me.videoBitrate) Me.GroupBox1.Controls.Add(Me.Label15) Me.GroupBox1.Controls.Add(Me.useBitrate) Me.GroupBox1.Controls.Add(Me.AdvancedEncoderOptionsButton) @@ -225,6 +226,16 @@ Partial Class Form1 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Encoder Options" ' + 'videoBitrate + ' + Me.videoBitrate.Location = New System.Drawing.Point(65, 84) + Me.videoBitrate.Maximum = New Decimal(New Integer() {999999, 0, 0, 0}) + Me.videoBitrate.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) + Me.videoBitrate.Name = "videoBitrate" + Me.videoBitrate.Size = New System.Drawing.Size(68, 20) + Me.videoBitrate.TabIndex = 37 + Me.videoBitrate.Value = New Decimal(New Integer() {10000, 0, 0, 0}) + ' 'UseTilingCheckbox ' Me.UseTilingCheckbox.AutoSize = True @@ -248,7 +259,7 @@ Partial Class Form1 'Label16 ' Me.Label16.AutoSize = True - Me.Label16.Location = New System.Drawing.Point(131, 90) + Me.Label16.Location = New System.Drawing.Point(133, 90) Me.Label16.Name = "Label16" Me.Label16.Size = New System.Drawing.Size(30, 13) Me.Label16.TabIndex = 8 @@ -276,13 +287,6 @@ Partial Class Form1 Me.CPUThreads.TabIndex = 34 Me.CPUThreads.Value = New Decimal(New Integer() {1, 0, 0, 0}) ' - 'videoBitrate - ' - Me.videoBitrate.Location = New System.Drawing.Point(65, 85) - Me.videoBitrate.Name = "videoBitrate" - Me.videoBitrate.Size = New System.Drawing.Size(60, 20) - Me.videoBitrate.TabIndex = 7 - ' 'Label15 ' Me.Label15.AutoSize = True @@ -615,6 +619,7 @@ Partial Class Form1 Me.Text = "rav1e GUI" Me.GroupBox1.ResumeLayout(False) Me.GroupBox1.PerformLayout() + CType(Me.videoBitrate, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.CPUThreads, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.quantizer, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.MaxKeyFrameInterval, System.ComponentModel.ISupportInitialize).EndInit() @@ -673,10 +678,10 @@ Partial Class Form1 Friend WithEvents PauseResumeButton As Button Friend WithEvents quantizer As NumericUpDown Friend WithEvents Label16 As Label - Friend WithEvents videoBitrate As TextBox Friend WithEvents useBitrate As RadioButton Friend WithEvents useQuantizer As RadioButton Friend WithEvents twoPass As CheckBox Friend WithEvents ffmpegVersionLabel As Label Friend WithEvents UseTilingCheckbox As CheckBox + Friend WithEvents videoBitrate As NumericUpDown End Class diff --git a/rav1e_gui/Form1.vb b/rav1e_gui/Form1.vb index 15a10e5..368da5f 100644 --- a/rav1e_gui/Form1.vb +++ b/rav1e_gui/Form1.vb @@ -77,7 +77,6 @@ Public Class Form1 ShowPSNRMetrics.Enabled = False CPUThreads.Enabled = False SaveLogBtn.Enabled = False - ClearLogBtn.Enabled = False PauseResumeButton.Enabled = True twoPass.Enabled = False useQuantizer.Enabled = False @@ -167,7 +166,7 @@ Public Class Form1 UpdateLog("Video Segments Encoded") concatenate_video_files(tempLocationPath.Text + "\rav1e-concatenate-list.txt", tempLocationPath.Text) merge_audio_video(OutputTxt.Text, tempLocationPath.Text) - If RemoveTempFiles.Checked Then clean_temp_folder(tempLocationPath.Text) + If RemoveTempFiles.Checked Then clean_temp_folder(tempLocationPath.Text) Else IO.File.Delete(tempLocationPath.Text + "\lock") StartBtn.BeginInvoke(Sub() StartBtn.Enabled = True audioBitrate.Enabled = True @@ -186,7 +185,6 @@ Public Class Form1 ShowPSNRMetrics.Enabled = True CPUThreads.Enabled = True SaveLogBtn.Enabled = True - ClearLogBtn.Enabled = True PauseResumeButton.Enabled = False twoPass.Enabled = True useQuantizer.Enabled = True @@ -198,7 +196,7 @@ Public Class Form1 End Sub) MsgBox("Finished") End Sub - Private Function Run_rav1e(Input_File As String, Output_File As String) + Private Function Run_rav1e(Input_File As String, Output_File As String, Optional SecondPass As Boolean = False) UpdateLog("Encoding Video part " + IO.Path.GetFileName(Input_File)) Using rav1eProcess As New Process() rav1eProcess.StartInfo.FileName = "rav1e.exe" @@ -211,16 +209,20 @@ Public Class Form1 If UseTilingCheckbox.Checked Then VideoBitrateString += " --threads " + My.Settings.CPUThreads.ToString() + " --tile-rows-log2 " + My.Settings.TilingRows.ToString() + " --tile-cols-log2 " + My.Settings.TilingColumns.ToString() End If - rav1eProcess.StartInfo.Arguments = """" + Input_File + """ -o """ + Output_File + """ " + VideoBitrateString + " -s " + My.Settings.speed.ToString() + " -i " + My.Settings.minKeyInt.ToString() + " -I " + My.Settings.maxKeyInt.ToString() + " --tune " + My.Settings.Tune.ToLower() + " --primaries " + My.Settings.ColorPrimaries.ToLower() + " --content_light " + My.Settings.ContentLight + " --matrix " + My.Settings.MatrixCoefficients.ToLower() + " --range " + My.Settings.Range + " --transfer " + My.Settings.TransferCharacteristics.ToLower() + " -v" + If My.Settings.twoPass And Not SecondPass Then + UpdateLog("Doing first pass for video part " + IO.Path.GetFileName(Input_File) + "") + rav1eProcess.StartInfo.Arguments = """" + Input_File + """ --first-pass """ + Output_File + ".first-pass-arg-output"" -o """ + Output_File + ".first-pass.ivf"" " + VideoBitrateString + " -s " + My.Settings.speed.ToString() + " -i " + My.Settings.minKeyInt.ToString() + " -I " + My.Settings.maxKeyInt.ToString() + " --tune " + My.Settings.Tune.ToLower() + " --primaries " + My.Settings.ColorPrimaries.ToLower() + " --content_light " + My.Settings.ContentLight + " --matrix " + My.Settings.MatrixCoefficients.ToLower() + " --range " + My.Settings.Range + " --transfer " + My.Settings.TransferCharacteristics.ToLower() + " -v" + ElseIf My.Settings.twoPass And SecondPass Then + rav1eProcess.StartInfo.Arguments = """" + Input_File + """ --second-pass """ + Output_File + ".first-pass-arg-output"" -o """ + Output_File + """ " + VideoBitrateString + " -s " + My.Settings.speed.ToString() + " -i " + My.Settings.minKeyInt.ToString() + " -I " + My.Settings.maxKeyInt.ToString() + " --tune " + My.Settings.Tune.ToLower() + " --primaries " + My.Settings.ColorPrimaries.ToLower() + " --content_light " + My.Settings.ContentLight + " --matrix " + My.Settings.MatrixCoefficients.ToLower() + " --range " + My.Settings.Range + " --transfer " + My.Settings.TransferCharacteristics.ToLower() + " -v" + Else + rav1eProcess.StartInfo.Arguments = """" + Input_File + """ -o """ + Output_File + """ " + VideoBitrateString + " -s " + My.Settings.speed.ToString() + " -i " + My.Settings.minKeyInt.ToString() + " -I " + My.Settings.maxKeyInt.ToString() + " --tune " + My.Settings.Tune.ToLower() + " --primaries " + My.Settings.ColorPrimaries.ToLower() + " --content_light " + My.Settings.ContentLight + " --matrix " + My.Settings.MatrixCoefficients.ToLower() + " --range " + My.Settings.Range + " --transfer " + My.Settings.TransferCharacteristics.ToLower() + " -v" + End If If My.Settings.lowlat Then rav1eProcess.StartInfo.Arguments += " --low_latency" End If If My.Settings.ShowPSNRMetrics Then rav1eProcess.StartInfo.Arguments += " --psnr" End If - If My.Settings.twoPass Then - rav1eProcess.StartInfo.Arguments += " -p 2" - End If rav1eProcess.StartInfo.CreateNoWindow = True rav1eProcess.StartInfo.RedirectStandardOutput = True rav1eProcess.StartInfo.RedirectStandardError = True @@ -240,11 +242,19 @@ Public Class Form1 rav1eProcess.BeginOutputReadLine() rav1eProcess.BeginErrorReadLine() rav1eProcess.WaitForExit() - UpdateLog("Video part " + IO.Path.GetFileName(Input_File) + " Encoding complete.") - If Not Exiting Then - IO.File.Delete(Input_File) + + If My.Settings.twoPass And Not SecondPass Then + UpdateLog("Video part " + IO.Path.GetFileName(Input_File) + " First pass encoding complete.") + Run_rav1e(Input_File, Output_File, True) + Else + UpdateLog("Video part " + IO.Path.GetFileName(Input_File) + " encoding complete.") + If Not Exiting Then + IO.File.Delete(Input_File) + If IO.File.Exists(Output_File + ".first-pass-arg-output") Then IO.File.Delete(Output_File + ".first-pass-arg-output") + If IO.File.Exists(Output_File + ".first-pass-file-output.ivf") Then IO.File.Delete(Output_File + ".first-pass-file-output.ivf") + End If + ProgressBar1.BeginInvoke(Sub() ProgressBar1.PerformStep()) End If - ProgressBar1.BeginInvoke(Sub() ProgressBar1.PerformStep()) End Using Return True End Function @@ -335,7 +345,7 @@ Public Class Form1 CPUThreads.Maximum = Environment.ProcessorCount If My.Settings.CPUThreads > 0 Then CPUThreads.Value = My.Settings.CPUThreads Else CPUThreads.Value = CPUThreads.Maximum quantizer.Value = My.Settings.quantizer - videoBitrate.Text = My.Settings.VideoBitrate + videoBitrate.Value = My.Settings.VideoBitrate useQuantizer.Checked = My.Settings.useQuantizer useBitrate.Checked = My.Settings.useBitrate twoPass.Checked = My.Settings.twoPass @@ -374,7 +384,7 @@ Public Class Form1 Dim rav1eProcessInfo As New ProcessStartInfo Dim rav1eProcess As Process rav1eProcessInfo.FileName = "rav1e.exe" - rav1eProcessInfo.Arguments = "-V" + rav1eProcessInfo.Arguments = "-0" rav1eProcessInfo.CreateNoWindow = True rav1eProcessInfo.RedirectStandardOutput = True rav1eProcessInfo.UseShellExecute = False @@ -563,9 +573,9 @@ Public Class Form1 videoBitrate.Enabled = False End Sub - Private Sub VideoBitrate_TextChanged(sender As Object, e As EventArgs) Handles videoBitrate.TextChanged + Private Sub VideoBitrate_ValueChanged(sender As Object, e As EventArgs) Handles videoBitrate.ValueChanged If GUILoaded Then - My.Settings.VideoBitrate = videoBitrate.Text + My.Settings.VideoBitrate = videoBitrate.Value My.Settings.Save() End If End Sub diff --git a/rav1e_gui/My Project/AssemblyInfo.vb b/rav1e_gui/My Project/AssemblyInfo.vb index 52d5ff1..43546ea 100644 --- a/rav1e_gui/My Project/AssemblyInfo.vb +++ b/rav1e_gui/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + +