From cdd6a93023ecb514ce70aa76cf3856d2cf2c4c4d Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 8 Aug 2018 22:02:56 +0100 Subject: NVEnc: Add human names for encoder presets and remove currently invalid options. --- .../Encode/Factories/VideoPresetFactory.cs | 41 ++++++++++++++++++++++ win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs | 6 ++++ 2 files changed, 47 insertions(+) (limited to 'win') diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/VideoPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/VideoPresetFactory.cs index 491eb7c4e..e861b1f9c 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Factories/VideoPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/VideoPresetFactory.cs @@ -26,6 +26,12 @@ namespace HandBrakeWPF.Services.Encode.Factories /// public static string GetDisplayName(string shortName) { + string presetName = GetNvencPresetName(shortName); + if (presetName != shortName) + { + return presetName; + } + switch (shortName) { case "ultrafast": @@ -59,5 +65,40 @@ namespace HandBrakeWPF.Services.Encode.Factories return shortName; } + + public static string GetNvencPresetName(string shortName) + { + switch (shortName) + { + case "losslesshp": + return "High Performance Lossless"; + case "lossless": + return "Lossless"; + case "llhp": + return "High Performance Low Latency"; + case "llhq": + return "High Quality Low Latency"; + case "ll": + return "Low Latency"; + case "bd": + return "Bluray Disk"; + case "hq": + return "High Quality"; + case "hp": + return "High Performance"; + case "fast": + return "Fast"; + case "medium": + return "Medium"; + case "slow": + return "Slow"; + case "default": + return "Default"; + case null: + return "Automatic"; + } + + return shortName; + } } } diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index 7c14e1594..53f410356 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -1425,6 +1425,12 @@ namespace HandBrakeWPF.ViewModels this.VideoPresetMaxValue = encoder.Presets.Count - 1; int middlePreset = (int)Math.Round((decimal)(this.VideoPresetMaxValue / 2), 0); + + if (selectedEncoder == VideoEncoder.NvencH264 || selectedEncoder == VideoEncoder.NvencH265) + { + middlePreset = this.VideoPresets.IndexOf(this.VideoPresets.FirstOrDefault(s => s.ShortName == "default")); + } + this.VideoPresetValue = middlePreset; } else -- cgit v1.2.3