summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2018-08-08 22:02:56 +0100
committersr55 <[email protected]>2018-08-08 22:02:56 +0100
commitcdd6a93023ecb514ce70aa76cf3856d2cf2c4c4d (patch)
tree13d9dff29cf8b1d925f09d6c052ecd6ae2ccf848 /win
parentd80a17590a1aa6c65de0ef0f2e6e0bd273f4753e (diff)
NVEnc: Add human names for encoder presets and remove currently invalid options.
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Factories/VideoPresetFactory.cs41
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs6
2 files changed, 47 insertions, 0 deletions
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
/// </returns>
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