Skip to content

Commit

Permalink
1.9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Revan654 committed Sep 2, 2018
1 parent dcd1468 commit 362e400
Show file tree
Hide file tree
Showing 43 changed files with 468 additions and 25,330 deletions.
310 changes: 0 additions & 310 deletions Encoding/AOMEnc.vb

This file was deleted.

35 changes: 29 additions & 6 deletions Encoding/VideoEncoder.vb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ Public MustInherit Class VideoEncoder
cl += " --transfer smpte2084"
Case "BT.709"
If height <= 576 Then cl += " --transfer bt709"
'' Case "HLG", "HLG / BT.2020"
'' cl += " --Transfer arib-std-b67"
End Select

Dim matrix_coefficients = MediaInfo.GetVideo(sourceFile, "matrix_coefficients")
Expand All @@ -87,13 +85,15 @@ Public MustInherit Class VideoEncoder
Dim MasteringDisplay_Luminance = MediaInfo.GetVideo(sourceFile, "MasteringDisplay_Luminance")

If MasteringDisplay_ColorPrimaries <> "" AndAlso MasteringDisplay_Luminance <> "" Then
Dim match1 = Regex.Match(MasteringDisplay_ColorPrimaries, "R: x=([0-9\.]+) y=([0-9\.]+), G: x=([0-9\.]+) y=([0-9\.]+), B: x=([0-9\.]+) y=([0-9\.]+), White point: x=([0-9\.]+) y=([0-9\.]+)")
Dim match1 = Regex.Match(MasteringDisplay_ColorPrimaries, "BT.2020")
''Dim match1 = Regex.Match(MasteringDisplay_ColorPrimaries, "R: x=([0-9\.]+) y=([0-9\.]+), G: x=([0-9\.]+) y=([0-9\.]+), B: x=([0-9\.]+) y=([0-9\.]+), White point: x=([0-9\.]+) y=([0-9\.]+)")
Dim match2 = Regex.Match(MasteringDisplay_Luminance, "min: ([0-9\.]+) cd/m2, max: ([0-9\.]+)")

If match1.Success AndAlso match2.Success Then
Dim strings1 = match1.Groups.OfType(Of Group).Skip(1).Select(Function(group) CInt(group.Value.ToDouble * 50000).ToString)
''Dim strings1 = match1.Groups.OfType(Of Group).Skip(1).Select(Function(group) CInt(group.Value.ToDouble * 50000).ToString)
Dim strings2 = match2.Groups.OfType(Of Group).Skip(1).Select(Function(group) CInt(group.Value.ToDouble * 10000).ToString)
cl += $" --master-display ""G({strings1(2)},{strings1(3)})B({strings1(4)},{strings1(5)})R({strings1(0)},{strings1(1)})WP({strings1(6)},{strings1(7)})L({strings2(1)},{strings2(0)})"""
cl += "--master-display ""G(8500,39850)B(6550,2300)R(35400,14600)WP(15635,16450)L(10000000,1)"""
''cl += $" --master-display ""G({strings1(2)},{strings1(3)})B({strings1(4)},{strings1(5)})R({strings1(0)},{strings1(1)})WP({strings1(6)},{strings1(7)})L({strings2(1)},{strings2(0)})"""
cl += " --range limited"
End If
End If
Expand Down Expand Up @@ -310,9 +310,17 @@ Public MustInherit Class VideoEncoder
Gif.Name = "Command Line | Gif Maker"
Gif.QualityMode = True
Gif.Muxer = New NullMuxer("No Muxing")
Gif.CommandLines = "x264 --pass 1 --bitrate %video_bitrate% --stats ""%target_temp_file%.stats"" --output NUL ""%script_file%"" || exit" + BR + "x264 --pass 2 --bitrate %video_bitrate% --stats ""%target_temp_file%.stats"" --output ""%encoder_out_file%"" ""%script_file%"""
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 Thumbs As New BatchEncoder()
Thumbs.OutputFileTypeValue = "jpg"
Thumbs.Name = "Command Line | jpg Maker"
Thumbs.QualityMode = True
Thumbs.Muxer = New NullMuxer("No Muxing")
Thumbs.CommandLines = "wsl python Thumbnailer.py /mnt/c/Users/Revan/Desktop/mtn/mtn ""/mnt/c/Users/Revan/Desktop/Lara.avi"" -c 4 -r 6 -w 1280 -h 150 -j 95 -D 12 -O /mnt/c/Users/Revan/Desktop -f /mnt/c/Users/Revan/Desktop/mtn/LiberationMono-Bold.ttf"
ret.Add(Thumbs)

Dim x264cli As New BatchEncoder()
x264cli.OutputFileTypeValue = "h264"
x264cli.Name = "Command Line | x264"
Expand Down Expand Up @@ -526,7 +534,22 @@ Public Class BatchEncoder
Return {" [ETA ", ", eta ", "frames: ", "frame= "}
End If
End Function
Function GetLinuxShell(value As String) As String
Dim ret = ""

For Each pack In Package.Items.Values
If TypeOf pack Is PluginPackage Then Continue For
Dim dir = pack.GetDir
If Not Directory.Exists(dir) Then Continue For
If Not dir.Contains(Folder.Startup) Then Continue For

If value.ToLower.Contains(pack.Name.ToLower) Then
ret += "PATH=""""" + dir + """" + BR
End If
Next

Return ret + BR + value
End Function
Function GetBatchCode(value As String) As String
Dim ret = ""

Expand Down
4 changes: 2 additions & 2 deletions Encoding/ffmpegEnc.vb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Public Class ffmpegEnc
.Switch = "-c:v",
.Text = "Codec",
.AlwaysOn = True,
.Options = {"x264", "x265", "VP8", "VP9", "Xvid", "ASP", "Theora", "ProRes", "UT Video", "Intel | Intel H.264", "Intel | Intel H.265", "Nvidia | Nvidia H.264", "Nvidia | Nvidia H.265"},
.Options = {"x264", "x265", "VP8", "VP9", "XviD", "ASP", "Theora", "ProRes", "UT Video", "Intel | Intel H.264", "Intel | Intel H.265", "Nvidia | Nvidia H.264", "Nvidia | Nvidia H.265"},
.Values = {"libx264", "libx265", "libvpx", "libvpx-vp9", "libxvid", "mpeg4", "libtheora", "prores", "utvideo", "h264_qsv", "hevc_qsv", "h264_nvenc", "hevc_nvenc"}}

Property Mode As New OptionParam With {
Expand Down Expand Up @@ -224,7 +224,7 @@ Public Class ffmpegEnc
ret += $" -b:v {p.VideoBitrate}k"
End Select

If Codec.OptionText = "Xvid" Then ret += " -tag:v xvid"
If Codec.OptionText = "XviD" Then ret += " -tag:v xvid"
Dim targetPath As String

If Mode.OptionText = "Two Pass" AndAlso pass = 1 Then
Expand Down
4 changes: 2 additions & 2 deletions Encoding/x265Enc.vb
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ Public Class x265Params
.Switch = "--profile",
.Text = "Profile",
.Value = 2,
.Options = {"Unrestricted", "Main", "Main 10", "Main - Intra", "Main Still Picture", "Main 422 - 8", "Main 444 - Intra", "Main 444 - Still Picture", "Main 444 - 8", "Main 10 - Intra", "Main 422 - 10", "Main 422 - 10 - Intra", "Main 444 - 10", "Main 444 - 10 - Intra", "main12", "main12-intra", "main422-12", "main422-12-intra", "main444-12", "main444-12-intra"}}
.Options = {"Unrestricted", "Main", "Main 10", "Main - Intra", "Main Still Picture", "Main 422 - 8", "Main 444 - Intra", "Main 444 - Still Picture", "Main 444 - 8", "Main 10 - Intra", "Main 422 - 10", "Main 422 - 10 - Intra", "Main 444 - 10", "Main 444 - 10 - Intra", "Main12", "Main12-intra", "Main422-12", "Main422-12-intra", "Main444-12", "Main444-12-intra"}}

Property OutputDepth As New OptionParam With {
.Switch = "--output-depth",
Expand Down Expand Up @@ -850,7 +850,7 @@ Public Class x265Params
New OptionParam With {.Switch = "--transfer", .Text = "Transfer", .Options = {"Undefined", "ARIB-STD-B67", "BT 1361 E", "BT 2020-10", "BT 2020-12", "BT 470 BG", "BT 470 M", "BT 709", "IEC 61966-2-1", "IEC 61966-2-4", "Linear", "Log 100", "Log 316", "SMPTE 170 M", "SMPTE 2084", "SMPTE 240 M", "SMPTE 428"}},
New OptionParam With {.Switch = "--overscan", .Text = "Overscan", .Options = {"Undefined", "Show", "Crop"}},
New OptionParam With {.Switch = "--range", .Text = "Range", .Options = {"Undefined", "Limited", "Full"}},
minLuma, maxLuma, MaxCLL, MaxFALL,
Chromaloc, minLuma, maxLuma, MaxCLL, MaxFALL,
New BoolParam With {.Switch = "--hdr", .Text = "Force signalling of HDR parameters in SEI packets"},
New BoolParam With {.Switch = "--hdr-opt", .Text = "Add luma and chroma offsets for HDR/WCG content"},
New BoolParam With {.Switch = "--dhdr10-opt", .Text = "Limit frames for which tone mapping information is inserted as SEI message"})
Expand Down
File renamed without changes.
56 changes: 53 additions & 3 deletions Forms/MainForm.vb
Original file line number Diff line number Diff line change
Expand Up @@ -4296,8 +4296,9 @@ Public Class MainForm
ret.Add("Tools|Folders|Working", NameOf(g.DefaultCommands.ExecuteCommandLine), {"""%working_dir%"""})

ret.Add("Tools|Advanced", Symbol.More)
If Application.StartupPath = "D:\Projekte\VS\VB\StaxRip\bin" Then ret.Add("Tools|Advanced|Test...", NameOf(g.DefaultCommands.Test), Keys.F12)
If Application.StartupPath = "C:\Users\Revan\Desktop\staxrip-1.8.2.0\bin" Then ret.Add("Tools|Advanced|Test...", NameOf(g.DefaultCommands.Test), Keys.F12)
ret.Add("Tools|Advanced|Video Comparison...", NameOf(ShowVideoComparison))
ret.Add("Tools|Advanced|Bash Prompt", NameOf(g.DefaultCommands.BashCommandPrompt), Symbol.fa_terminal)
ret.Add("Tools|Advanced|Command Prompt", NameOf(g.DefaultCommands.ShowCommandPrompt), Symbol.fa_terminal)
ret.Add("Tools|Advanced|PowerShell", NameOf(g.DefaultCommands.ShowPowerShell), Keys.Control Or Keys.P, Symbol.fa_terminal)
ret.Add("Tools|Advanced|Event Commands...", NameOf(ShowEventCommandsDialog), Symbol.LightningBolt)
Expand All @@ -4306,13 +4307,17 @@ Public Class MainForm
ret.Add("Tools|Advanced|LAV Filters video decoder configuration...", NameOf(ShowLAVFiltersConfigDialog), Symbol.Filter)
ret.Add("Tools|Advanced|MediaInfo Folder View...", NameOf(ShowMediaInfoFolderViewDialog), Symbol.Info)
ret.Add("Tools|Advanced|Reset Setting...", NameOf(ResetSettings))
ret.Add("Tools|Advanced|Thumbnails Generator...", NameOf(ShowBatchGenerateThumbnailsDialog))
ret.Add("Tools|Advanced|Thumbnails|StaxRip Thumbnail Generator", NameOf(ShowBatchGenerateThumbnailsDialog))
ret.Add("Tools|Advanced|Thumbnails|MTN Thumbnail Generator", NameOf(g.DefaultCommands.MTNCommand))
ret.Add("Tools|Advanced|Thumbnails|VCS Thumbnail Generator", NameOf(g.DefaultCommands.VCSPythonPrompt))

ret.Add("Tools|Scripts", NameOf(DynamicMenuItem), Symbol.Code, {DynamicMenuItemID.Scripts})
ret.Add("Tools|Edit Menu...", NameOf(ShowMainMenuEditor))
ret.Add("Tools|Settings...", NameOf(ShowSettingsDialog), Symbol.Settings, {""})

ret.Add("Apps|AVSMeter", NameOf(g.DefaultCommands.StartTool), {"AVSMeter"})
ret.Add("Apps|MKVInfo", NameOf(g.DefaultCommands.StartTool), {"MKVInfo"})
ret.Add("Apps|MKVHDR", NameOf(g.DefaultCommands.StartTool), {"MKVHDR"})
ret.Add("Apps|BDSup2Sub++", NameOf(g.DefaultCommands.StartTool), {"BDSup2Sub++"})
ret.Add("Apps|DGIndex", NameOf(g.DefaultCommands.StartTool), {"DGIndex"})
ret.Add("Apps|DGIndexNV", NameOf(g.DefaultCommands.StartTool), {"DGIndexNV"})
Expand Down Expand Up @@ -5483,6 +5488,52 @@ Public Class MainForm
SourceFileMenu.Add("Paste", Sub() tbSourceFile.Paste(), "Copies the full source file path to the clipboard.", Clipboard.GetText.Trim <> "").SetImage(Symbol.Paste)
End Sub

<Command("Shows a dialog to generate thumbnails.")>
Sub ShowBatchGenerateThumbnailsDialog()
Using fd As New OpenFileDialog
fd.Title = "Select files"
fd.SetFilter(FileTypes.Video)
fd.Multiselect = False

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 row As SimpleUI.NumBlock
Dim interval As SimpleUI.NumBlock

Dim mode = ui.AddMenu(Of Integer)
Dim m = ui.AddMenu(Of Integer)

Dim nb = ui.AddNum()
nb.Text = "Thumbnail Width:"
nb.Config = {200, 4000, 10}
nb.NumEdit.Value = s.Storage.GetInt("Thumbnail Width", 500)
nb.NumEdit.SaveAction = Sub(value) s.Storage.SetInt("Thumbnail Width", CInt(value))

nb = ui.AddNum()
nb.Text = "Column Count:"
nb.Config = {1, 1000}
nb.NumEdit.Value = s.Storage.GetInt("Thumbnail Columns", 3)
nb.NumEdit.SaveAction = Sub(value) s.Storage.SetInt("Thumbnail Columns", CInt(value))

row = ui.AddNum()
row.Text = "Row Count:"
row.Config = {1, 1000}
row.NumEdit.Value = s.Storage.GetInt("Thumbnail Rows", 12)
row.NumEdit.SaveAction = Sub(value) s.Storage.SetInt("Thumbnail Rows", CInt(value))

interval = ui.AddNum()
interval.Text = "Interval (seconds):"
interval.NumEdit.Value = s.Storage.GetInt("Thumbnail Interval")
interval.NumEdit.SaveAction = Sub(value) s.Storage.SetInt("Thumbnail Interval", CInt(value))


<Command("Shows a dialog to generate thumbnails.")>
Sub ShowBatchGenerateThumbnailsDialog()
Using fd As New OpenFileDialog
Expand Down Expand Up @@ -5577,7 +5628,6 @@ Public Class MainForm
End If
End Using
End Sub

<Command("Presents MediaInfo of all files in a folder in a list view.")>
Sub ShowMediaInfoFolderViewDialog()
Using d As New FolderBrowserDialog
Expand Down
2 changes: 1 addition & 1 deletion Forms/MediaInfoFolderViewForm.vb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Public Class MediaInfoFolderViewForm
MyBase.New()
InitializeComponent()

Icon = My.Resources.RipIcon
Icon = My.Resources.MainIcon

lv.View = View.Details
lv.FullRowSelect = True
Expand Down
Loading

0 comments on commit 362e400

Please sign in to comment.