diff --git a/Encoding/VideoEncoder.vb b/Encoding/VideoEncoder.vb index 8e7869a5..92fbdbf2 100644 --- a/Encoding/VideoEncoder.vb +++ b/Encoding/VideoEncoder.vb @@ -291,9 +291,6 @@ Public MustInherit Class VideoEncoder Dim ffmpeg = New ffmpegEnc() - Dim Animation = New AnimationEnc - ret.Add(Animation) - Dim xvid As New BatchEncoder() xvid.OutputFileTypeValue = "avi" xvid.Name = "XviD" @@ -308,13 +305,13 @@ Public MustInherit Class VideoEncoder ret.Add(ffmpeg2) Next - Dim Gif As New BatchEncoder() - Gif.OutputFileTypeValue = "gif" - Gif.Name = "Command Line | Gif Maker" - Gif.QualityMode = True - Gif.Muxer = New NullMuxer("No Muxing") - Gif.CommandLines = "ffmpeg -i ""%script_file%"" -vf ""fps=15,scale=%target_width%:-1:flags=spline,palettegen=stats_mode=diff"" -loglevel quiet -y ""%target_temp_file%.png"" || exit" + BR + "ffmpeg -i ""%script_file%"" -i ""%target_temp_file%.png"" -lavfi ""fps=15,scale=%target_width%:-1:flags=spline [x]; [x][1:v] paletteuse=dither=floyd_steinberg"" -loglevel quiet -y ""%target_file%""" - ret.Add(Gif) + ' Dim Gif As New BatchEncoder() + 'Gif.OutputFileTypeValue = "gif" + ' Gif.Name = "Command Line | Gif Maker" + 'Gif.QualityMode = True + 'Gif.Muxer = New NullMuxer("No Muxing") + ' Gif.CommandLines = "ffmpeg -i ""%script_file%"" -vf ""fps=15,scale=%target_width%:-1:flags=spline,palettegen=stats_mode=diff"" -loglevel quiet -y ""%target_temp_file%.png"" || exit" + BR + "ffmpeg -i ""%script_file%"" -i ""%target_temp_file%.png"" -lavfi ""fps=15,scale=%target_width%:-1:flags=spline [x]; [x][1:v] paletteuse=dither=floyd_steinberg"" -loglevel quiet -y ""%target_file%""" + 'ret.Add(Gif) Dim x264cli As New BatchEncoder() x264cli.OutputFileTypeValue = "h264" diff --git a/Forms/MainForm.vb b/Forms/MainForm.vb index 780021ee..009de49f 100644 --- a/Forms/MainForm.vb +++ b/Forms/MainForm.vb @@ -4322,10 +4322,6 @@ Public Class MainForm ret.Add("Tools|Advanced|MediaInfo Folder View...", NameOf(ShowMediaInfoFolderViewDialog), Symbol.Info) ret.Add("Tools|Advanced|Reset Setting...", NameOf(ResetSettings)) ret.Add("Tools|Advanced|Check For Update", NameOf(g.DefaultCommands.StartTool), {"Update"}) - 'ret.Add("Tools|Advanced|Thumbnails|", Symbol.fa_th_large) - 'ret.Add("Tools|Advanced|Thumbnails|StaxRip Thumbnail Generator", NameOf(ShowBatchGenerateThumbnailsDialog), Symbol.fa_th_large) - 'ret.Add("Tools|Advanced|Thumbnails|MTN Thumbnail Generator", NameOf(g.DefaultCommands.StartTool), Symbol.fa_th, {"MTNWindows"}) - 'ret.Add("Tools|Advanced|Thumbnails|VCS Thumbnail Generator", NameOf(g.DefaultCommands.StartTool), Symbol.fa_th, {"VCSPython"}) ret.Add("Tools|Scripts", NameOf(DynamicMenuItem), Symbol.Code, {DynamicMenuItemID.Scripts}) ret.Add("Tools|Edit Menu...", NameOf(ShowMainMenuEditor)) @@ -4343,9 +4339,8 @@ Public Class MainForm ret.Add("Apps|Subtitles|VSRip", NameOf(g.DefaultCommands.StartTool), {"VSRip"}) ret.Add("Apps|Thumbnails|", Symbol.fa_th) ret.Add("Apps|Thumbnails|StaxRip Thumbnail Generator", NameOf(ShowBatchGenerateThumbnailsDialog), Symbol.fa_th_large) - ret.Add("Apps|Thumbnails|MTN Thumbnail Generator", NameOf(g.DefaultCommands.StartTool), Symbol.fa_th, {"MTNWindows"}) - ' ret.Add("Apps|Thumbnails|StaxRip Thumbnail Generator", NameOf(Animation)) - ret.Add("Apps|Gif Creation", NameOf(GifCreation)) + ret.Add("Apps|Thumbnails|MTN Thumbnail Generator", NameOf(MTNThumbnailCreator), Symbol.fa_th) + ret.Add("Apps|Gif Creator", NameOf(GifCreation)) ret.Add("Apps|-") ret.Add("Apps|Manage...", NameOf(ShowAppsDialog)) @@ -5550,7 +5545,7 @@ Public Class MainForm Dim Time = ui.AddNum() Time.Text = "Starting Time:" Time.Config = {1, 3600} - Time.NumEdit.Value = s.Storage.GetInt("Time", 15) + Time.NumEdit.Value = s.Storage.GetInt("Time", 25) Time.NumEdit.SaveAction = Sub(value) s.Storage.SetInt("Time", CInt(value)) ''How long Should the Animated Gif Be @@ -5560,6 +5555,7 @@ Public Class MainForm Length.NumEdit.Value = s.Storage.GetInt("Length", 4) Length.NumEdit.SaveAction = Sub(value) s.Storage.SetInt("Length", CInt(value)) + Dim FrameRate = ui.AddNum() FrameRate.Text = "FrameRate:" FrameRate.Config = {15, 60} @@ -5572,6 +5568,13 @@ Public Class MainForm Scale.NumEdit.Value = s.Storage.GetInt("Scale", 480) Scale.NumEdit.SaveAction = Sub(value) s.Storage.SetInt("Scale", CInt(value)) + Dim Status_Mode = ui.AddMenu(Of String) + Status_Mode.Text = "Palettegen Mode:" + Status_Mode.Add("Full", "full") + Status_Mode.Add("Difference", "diff") + Status_Mode.Button.Value = s.Storage.GetString("Status", "diff") + Status_Mode.Button.SaveAction = Sub(value) s.Storage.SetString("Status", value) + Dim Compression = ui.AddMenu(Of String) Compression.Text = "Dither:" Compression.Add("Bayer Scale 1", "dither=bayer:bayer_scale=1") @@ -5595,20 +5598,112 @@ Public Class MainForm Dim Seek = s.Storage.GetInt("Time") Dim Duration = s.Storage.GetInt("Length") Dim Size = s.Storage.GetInt("Scale") + Dim Mode = s.Storage.GetInt("Status") Dim Dither = s.Storage.GetInt("Dither") p.SourceFile = fd.FileName For Each i In fd.FileNames Try - g.DefaultCommands.ExecuteCommandLine(Package.Items("ffmpeg").Path.Escape + " -ss " & Seek & ".0 -t " & Duration & ".0 -i " + fd.FileName + " -vf " + """" + "fps=" & Rate & ",scale=" & Size & ":-1:flags=spline,palettegen=stats_mode=diff"" -y " + cachePath, True, True, True) + g.DefaultCommands.ExecuteCommandLine(Package.Items("ffmpeg").Path.Escape + " -ss " & Seek & ".0 -t " & Duration & ".0 -i " + fd.FileName + " -vf " + """" + "fps=" & Rate & ",scale=" & Size & ":-1:flags=spline,palettegen=stats_mode=" & Mode & """ -hide_banner -y " + cachePath, True, True, False) + g.DefaultCommands.ExecuteCommandLine(Package.Items("ffmpeg").Path.Escape + " -ss " & Seek & ".0 -t " & Duration & ".0 -i " + fd.FileName + " -i " + cachePath + " -lavfi " + """" + "fps=" & Rate & ",scale=" & Size & ":-1:flags=spline [x]; [x][1:v] paletteuse=" & Dither & """ -hide_banner -y " + OutPutPath, True, True, False) Catch ex As Exception g.ShowException(ex) End Try Next - g.DefaultCommands.ExecuteCommandLine(Package.Items("ffmpeg").Path.Escape + " -ss " & Seek & ".0 -t " & Duration & ".0 -i " + fd.FileName + " -vf " + """" + "fps=" & Rate & ",scale=" & Size & ":-1:flags=spline,palettegen=stats_mode=diff"" -y " + cachePath, True, True, True) - g.DefaultCommands.ExecuteCommandLine(Package.Items("ffmpeg").Path.Escape + " -ss " & Seek & ".0 -t " & Duration & ".0 -i " + fd.FileName + " -i " + cachePath + " -lavfi " + """" + "fps=" & Rate & ",scale=" & Size & ":-1:flags=spline [x]; [x][1:v] paletteuse=" & Dither & """ -y " + OutPutPath, False, False, True) - 'g.StartProcess(fd.FileName.Dir) + g.StartProcess(fd.FileName.Dir) + + End If + End Using + End If + End Using + + End Sub + + + Sub MTNThumbnailCreator() + Using fd As New OpenFileDialog + fd.Title = "Select files" + fd.Multiselect = False + + Dim proj As Project + If proj Is Nothing Then + proj = New Project + proj.Init() + proj.SourceFile = fd.FileName + End If + + proj.Log.WriteHeader("Saving Thumbnails") + proj.Log.WriteLine(fd.FileName) + proj.Log.Save(proj) + + If fd.ShowDialog = DialogResult.OK Then + Using f As New SimpleSettingsForm("Thumbnail Options") + f.ScaleClientSize(27, 15) + + Dim ui = f.SimpleUI + Dim page = ui.CreateFlowPage("main page") + ui.Store = s + page.SuspendLayout() + + Dim Column = ui.AddNum() + Column.Text = "Number of Columns:" + Column.Config = {1, 12} + Column.NumEdit.Value = s.Storage.GetInt("Column", 4) + Column.NumEdit.SaveAction = Sub(value) s.Storage.SetInt("Column", CInt(value)) + + Dim Row = ui.AddNum() + Row.Text = "Number of Rows:" + Row.Config = {1, 12} + Row.NumEdit.Value = s.Storage.GetInt("Row", 6) + Row.NumEdit.SaveAction = Sub(value) s.Storage.SetInt("Row", CInt(value)) + + Dim Quality = ui.AddNum() + Quality.Text = "JPG Quality:" + Quality.Config = {25, 100} + Quality.NumEdit.Value = s.Storage.GetInt("Quality", 95) + Quality.NumEdit.SaveAction = Sub(value) s.Storage.SetInt("Quality", CInt(value)) + + Dim Height = ui.AddNum() + Height.Text = "Height of Each Shot:" + Height.Config = {150, 600} + Height.NumEdit.Value = s.Storage.GetInt("Height", 150) + Height.NumEdit.SaveAction = Sub(value) s.Storage.SetInt("Height", CInt(value)) + + Dim Width = ui.AddNum() + Width.Text = "Width of Each Shot:" + Width.Config = {480, 1080} + Width.NumEdit.Value = s.Storage.GetInt("Width", 1280) + Width.NumEdit.SaveAction = Sub(value) s.Storage.SetInt("Width", CInt(value)) + + Dim Depth = ui.AddNum() + Depth.Text = "Depth of Each Shot:" + Depth.Config = {4, 12} + Depth.NumEdit.Value = s.Storage.GetInt("Depth", 1280) + Depth.NumEdit.SaveAction = Sub(value) s.Storage.SetInt("Depth", CInt(value)) + + page.ResumeLayout() + + If f.ShowDialog() = DialogResult.OK Then + ui.Save() + + Dim Col = s.Storage.GetInt("Column") + Dim Rows = s.Storage.GetInt("Row") + Dim SizeWidth = s.Storage.GetInt("Width") + Dim SizeHeight = s.Storage.GetInt("Height") + Dim PictureQuality = s.Storage.GetInt("Quality") + Dim PictureDepth = s.Storage.GetInt("Depth") + p.SourceFile = fd.FileName + + For Each i In fd.FileNames + Try + g.DefaultCommands.ExecuteCommandLine(Package.Items("MTNWindows").Path.Escape + """" + fd.FileName + """" + " -c " & Col & " -r " & Rows & " -w " & SizeWidth & " -h " & SizeHeight & " -D " & PictureDepth & " -j " & PictureQuality, True, True, False) + Catch ex As Exception + g.ShowException(ex) + End Try + Next + + g.StartProcess(fd.FileName.Dir) End If End Using diff --git a/General/Misc.vb b/General/Misc.vb index 01b4268c..43c7530a 100644 --- a/General/Misc.vb +++ b/General/Misc.vb @@ -930,7 +930,7 @@ Public Class Macro ret.Add(New Macro("system_dir", "System Directory", GetType(String), "System directory.")) ret.Add(New Macro("target_dir", "Target Directory", GetType(String), "Directory of the target file.")) ret.Add(New Macro("target_file", "Target File Path", GetType(String), "File path of the target file.")) - ret.Add(New Macro("target_files", "Target Files Blank", GetType(String), "Target files in quotes separated by a blank.")) + 'ret.Add(New Macro("target_files", "Target Files Blank", GetType(String), "Target files in quotes separated by a blank.")) ret.Add(New Macro("target_framerate", "Target Framerate", GetType(Integer), "Frame rate of the target video.")) ret.Add(New Macro("target_frames", "Target Frames", GetType(Integer), "Length in frames of the target video.")) ret.Add(New Macro("target_height", "Target Image Height", GetType(Integer), "Image height of the target video.")) @@ -1128,8 +1128,12 @@ Public Class Macro If value.Contains("%target_file%") Then value = value.Replace("%target_file%", p.TargetFile) If Not value.Contains("%") Then Return value - If value.Contains("%target_files%") Then value = value.Replace("%target_files%", """" + String.Join(""" """, p.TargetFile.ToArray) + """") - If Not value.Contains("%") Then Return value + ' If value.Contains("%target_files%") Then + ' value = value.Replace("%target_files%", """" + String.Join(""" """, p.TargetFile.ToArray) + """") + 'If Not value.Contains("%") Then Return value + ' End If + '' Will Be Added Later Once Other source files have been updated. + If value.Contains("%script_files%") Then p.Script.Synchronize() diff --git a/General/Package.vb b/General/Package.vb index dc7a1d3f..18913051 100644 --- a/General/Package.vb +++ b/General/Package.vb @@ -155,21 +155,6 @@ Public Class Package .WebURL = "http://forum.doom9.org/showthread.php?p=1613303", .Description = "Converts Blu-ray subtitles to other formats like VobSub."}) - Shared Property VCSPython As Package = Add(New Package With { - .Name = "VCSPython", - .Filename = "VCS.py", - .StartActionValue = Sub() - Using fd As New OpenFileDialog - fd.Title = "Select files" - fd.Multiselect = True - If fd.ShowDialog = DialogResult.OK Then - g.DefaultCommands.ExecuteCommandLine("wsl python3 " + Package.Items("VCSPython").Path.Escape + " " + fd.FileName + " %app:VCS%", True, True, False) - End If - End Using - End Sub, - .DirPath = "VCS", - .Description = "Custom Launcher Script for VCS"}) - Shared Property MTN As Package = Add(New Package With { .Name = "MTNWindows", .Filename = "mtn.exe", @@ -211,10 +196,16 @@ Public Class Package .LaunchName = "Update.ps1", .DirPath = "Updates", .StartActionValue = Sub() - g.DefaultCommands.ExecutePowerShellScript(Package.Items("Update").Path.Escape + " ") + g.DefaultCommands.ExecutePowerShellScript("cd %app_dir:Update%" + Package.Items("Update").Path.Escape + " ") End Sub, .Description = "The PowerShell Script that Updates StaxRip."}) + Shared Property vsedit As Package = Add(New Package With { + .Name = "vsedit", + .Filename = "vsedit.exe", + .URL = "https://vapoursynth.com/", + .Description = "The New Editor for VapourSynth"}) + Shared Property modPlus As Package = Add(New PluginPackage With { .Name = "modPlus", .Filename = "modPlus.dll", diff --git a/StaxRip.vbproj b/StaxRip.vbproj index d5168b97..5d591f11 100644 --- a/StaxRip.vbproj +++ b/StaxRip.vbproj @@ -166,7 +166,6 @@ UserControl -