summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <[email protected]>2014-02-23 15:43:16 +0000
committersr55 <[email protected]>2014-02-23 15:43:16 +0000
commit71c53a04fc0d43fee4ee024f854ebc6783234fd2 (patch)
tree38f3ed0d47fb7dc388999dfdb554334827d45337 /win/CS
parentb29ad15acd51f7fc869f7bac9d77d7540e143740 (diff)
WinGui: x265 UI patch by Zhang Zhigiang.
This enables support for the x265 encoder from the GUI when paired with a build of HandBrake that has x265 enabled. Thanks git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6062 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Factories/PlistPresetFactory.cs10
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs28
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/OutputFormat.cs3
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs97
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs7
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs4
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs37
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs36
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj3
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs162
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs6
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/x265/x265Preset.cs49
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/x265/x265Profile.cs31
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/x265/x265Tune.cs28
-rw-r--r--win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs5
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.Designer.cs108
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.resx12
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs3
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs181
-rw-r--r--win/CS/HandBrakeWPF/Views/VideoView.xaml86
20 files changed, 753 insertions, 143 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Factories/PlistPresetFactory.cs b/win/CS/HandBrake.ApplicationServices/Factories/PlistPresetFactory.cs
index fd10e22bd..e6b59c31d 100644
--- a/win/CS/HandBrake.ApplicationServices/Factories/PlistPresetFactory.cs
+++ b/win/CS/HandBrake.ApplicationServices/Factories/PlistPresetFactory.cs
@@ -20,6 +20,7 @@ namespace HandBrake.ApplicationServices.Factories
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
using HandBrake.Interop.Model.Encoding.x264;
+ using HandBrake.Interop.Model.Encoding.x265;
/// <summary>
/// A Factory to translate a Plist object into a Preset.
@@ -237,6 +238,15 @@ namespace HandBrake.ApplicationServices.Factories
case "QsvPreset":
preset.Task.QsvPreset = EnumHelper<QsvPreset>.GetValue(kvp.Value, true);
break;
+ case "h265Profile":
+ preset.Task.H265Profile = EnumHelper<x265Profile>.GetValue(kvp.Value, true);
+ break;
+ case "x265Tune":
+ preset.Task.X265Tune = EnumHelper<x265Profile>.GetValue(kvp.Value, true);
+ break;
+ case "x265Preset":
+ preset.Task.X265Preset = EnumHelper<x265Preset>.GetValue(kvp.Value, true);
+ break;
// Chapter Markers Tab
case "ChapterMarkers":
diff --git a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
index b521d3b9d..6a519a382 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
@@ -18,6 +18,7 @@ namespace HandBrake.ApplicationServices.Model
using HandBrake.Interop.Model;
using HandBrake.Interop.Model.Encoding;
using HandBrake.Interop.Model.Encoding.x264;
+ using HandBrake.Interop.Model.Encoding.x265;
using OutputFormat = HandBrake.ApplicationServices.Model.Encoding.OutputFormat;
@@ -55,6 +56,10 @@ namespace HandBrake.ApplicationServices.Model
this.H264Profile = x264Profile.None;
this.X264Tune = x264Tune.None;
this.Modulus = 16;
+
+ this.H265Profile = x265Profile.None;
+ this.X265Preset = x265Preset.VeryFast;
+ this.X265Tune = x265Tune.None;
}
/// <summary>
@@ -137,11 +142,15 @@ namespace HandBrake.ApplicationServices.Model
this.H264Level = task.H264Level;
this.FastDecode = task.FastDecode;
this.ExtraAdvancedArguments = task.ExtraAdvancedArguments;
-
+
this.PreviewStartAt = task.PreviewStartAt;
this.PreviewDuration = task.PreviewDuration;
this.ShowAdvancedTab = task.ShowAdvancedTab;
+
+ this.X265Preset = task.X265Preset;
+ this.X265Tune = task.X265Tune;
+ this.H265Profile = task.H265Profile;
}
#region Source
@@ -457,6 +466,21 @@ namespace HandBrake.ApplicationServices.Model
/// </summary>
public string ExtraAdvancedArguments { get; set; }
+ /// <summary>
+ /// Gets or sets x265Preset.
+ /// </summary>
+ public x265Preset X265Preset { get; set; }
+
+ /// <summary>
+ /// Gets or sets x265Profile.
+ /// </summary>
+ public x265Profile H265Profile { get; set; }
+
+ /// <summary>
+ /// Gets or sets X265Tune.
+ /// </summary>
+ public x265Tune X265Tune { get; set; }
+
#endregion
#region Preview
@@ -484,7 +508,7 @@ namespace HandBrake.ApplicationServices.Model
{
if (this.OutputFormat == OutputFormat.M4V || this.OutputFormat == OutputFormat.Mp4)
{
- bool audio = this.AudioTracks.Any(item => item.Encoder == AudioEncoder.Ac3Passthrough ||
+ bool audio = this.AudioTracks.Any(item => item.Encoder == AudioEncoder.Ac3Passthrough ||
item.Encoder == AudioEncoder.Ac3 || item.Encoder == AudioEncoder.DtsPassthrough || item.Encoder == AudioEncoder.Passthrough);
bool subtitles = this.SubtitleTracks.Any(track => track.SubtitleType != SubtitleType.VobSub);
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/OutputFormat.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/OutputFormat.cs
index 9323cc862..d9070de2f 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/OutputFormat.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/OutputFormat.cs
@@ -24,5 +24,8 @@ namespace HandBrake.ApplicationServices.Model.Encoding
[Description("MKV")]
Mkv,
+
+ [Description("X265")]
+ X265,
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs b/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs
index 9651c6e71..aa9842124 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs
@@ -15,6 +15,7 @@ namespace HandBrake.ApplicationServices.Utilities
using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.Interop.Model.Encoding;
using HandBrake.Interop.Model.Encoding.x264;
+ using HandBrake.Interop.Model.Encoding.x265;
/// <summary>
/// A class to convert various things to native C# objects
@@ -296,6 +297,8 @@ namespace HandBrake.ApplicationServices.Utilities
return VideoEncoder.QuickSync;
case "theora":
return VideoEncoder.Theora;
+ case "hevc":
+ return VideoEncoder.X265;
default:
return VideoEncoder.X264;
}
@@ -324,6 +327,8 @@ namespace HandBrake.ApplicationServices.Utilities
return "qsv_h264";
case VideoEncoder.Theora:
return "theora";
+ case VideoEncoder.X265:
+ return "hevc";
default:
return "x264";
}
@@ -429,6 +434,94 @@ namespace HandBrake.ApplicationServices.Utilities
#endregion
+ #region x265
+
+ /// <summary>
+ /// Get the x265Preset from a cli parameter
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ /// <returns>
+ /// The x265Preset enum value
+ /// </returns>
+ public static x265Preset Getx265PresetFromCli(string preset)
+ {
+ switch (preset)
+ {
+ case "ultrafast":
+ return x265Preset.Ultrafast;
+ case "superfast":
+ return x265Preset.Superfast;
+ case "veryfast":
+ return x265Preset.VeryFast;
+ case "faster":
+ return x265Preset.Faster;
+ case "fast":
+ return x265Preset.Fast;
+ case "medium":
+ return x265Preset.Medium;
+ case "slow":
+ return x265Preset.Slow;
+ case "slower":
+ return x265Preset.Slower;
+ case "veryslow":
+ return x265Preset.VerySlow;
+ case "placebo":
+ return x265Preset.Placebo;
+ default:
+ return x265Preset.Faster;
+ }
+ }
+
+ /// <summary>
+ /// Get the x265 Profile from the cli
+ /// </summary>
+ /// <param name="profile">
+ /// The preset.
+ /// </param>
+ /// <returns>
+ /// The x265Profile enum value
+ /// </returns>
+ public static x265Profile Getx265ProfileFromCli(string profile)
+ {
+ switch (profile)
+ {
+ case "mainstillpicture":
+ return x265Profile.Mainstillpicture;
+ case "main":
+ return x265Profile.Main;
+ case "main10":
+ return x265Profile.Main10;
+ default:
+ return x265Profile.Main;
+ }
+ }
+
+ /// <summary>
+ /// Get x265Tune enum from a cli string
+ /// </summary>
+ /// <param name="tune">
+ /// The tune.
+ /// </param>
+ /// <returns>
+ /// The x265Tune enum value
+ /// </returns>
+ public static x265Tune Getx265TuneFromCli(string tune)
+ {
+ switch (tune)
+ {
+ case "psnr":
+ return x265Tune.Psnr;
+ case "ssim":
+ return x265Tune.Ssim;
+ default:
+ return x265Tune.Psnr;
+ }
+ }
+
+ #endregion
+
#region File Format
/// <summary>
@@ -450,6 +543,8 @@ namespace HandBrake.ApplicationServices.Utilities
return OutputFormat.Mp4;
case "mkv":
return OutputFormat.Mkv;
+ case "x265":
+ return OutputFormat.X265;
}
}
@@ -472,6 +567,8 @@ namespace HandBrake.ApplicationServices.Utilities
return "m4v";
case OutputFormat.Mkv:
return "mkv";
+ case OutputFormat.X265:
+ return "x265";
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs
index 67f243432..a4aacac7f 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs
@@ -135,6 +135,9 @@ namespace HandBrake.ApplicationServices.Utilities
case OutputFormat.Mkv:
profile.ContainerName = "av_mkv"; // TODO make part of enum.
break;
+ case OutputFormat.X265:
+ profile.ContainerName = "x265"; // TODO make part of enum.
+ break;
}
// Picture Settings
@@ -196,6 +199,10 @@ namespace HandBrake.ApplicationServices.Utilities
profile.X264Tunes.Add("fastdecode");
}
+ profile.X265Preset = work.X265Preset.ToString().ToLower().Replace(" ", string.Empty);
+ profile.X265Profile = work.H265Profile.ToString().ToLower().Replace(" ", string.Empty);
+ profile.X265Tunes = new List<string>();
+
// Chapter Markers
profile.IncludeChapterMarkers = work.IncludeChapterMarkers;
job.CustomChapterNames = work.ChapterNames.Select(item => item.ChapterName).ToList();
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
index 25c3a1426..7448f4bc5 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
@@ -281,6 +281,10 @@ namespace HandBrake.ApplicationServices.Utilities
AddEncodeElement(xmlWriter, "x264UseAdvancedOptions", "integer", parsed.ShowAdvancedTab ? "1" : "0");
AddEncodeElement(xmlWriter, "qsvPreset", "string", parsed.QsvPreset.ToString().ToLower());
+ AddEncodeElement(xmlWriter, "h265Profile", "string", parsed.H265Profile.ToString().ToLower());
+ AddEncodeElement(xmlWriter, "x265Preset", "string", parsed.X265Preset.ToString().ToLower());
+ AddEncodeElement(xmlWriter, "x265Tune", "string", parsed.X265Tune.ToString().ToLower());
+
int videoQualityType = 0;
if (parsed.VideoBitrate != null) videoQualityType = 1;
else if (parsed.Quality != null) videoQualityType = 2;
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
index b1db2fcaa..8b246b58c 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
@@ -22,6 +22,7 @@ namespace HandBrake.ApplicationServices.Utilities
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.Interop.Model.Encoding;
using HandBrake.Interop.Model.Encoding.x264;
+ using HandBrake.Interop.Model.Encoding.x265;
/// <summary>
/// Generate a CLI Query for HandBrakeCLI
@@ -435,6 +436,9 @@ namespace HandBrake.ApplicationServices.Utilities
default:
query += " -e x264";
break;
+ case VideoEncoder.X265:
+ query += " -e x265";
+ break;
}
switch (task.VideoEncodeRateType)
@@ -457,6 +461,9 @@ namespace HandBrake.ApplicationServices.Utilities
case VideoEncoder.Theora:
query += string.Format(" -q {0}", task.Quality.Value.ToString(CultureInfo.InvariantCulture));
break;
+ case VideoEncoder.X265:
+ query += string.Format(" -q {0}", task.Quality.Value.ToString(CultureInfo.InvariantCulture));
+ break;
}
break;
}
@@ -937,6 +944,36 @@ namespace HandBrake.ApplicationServices.Utilities
}
}
+ // X265 Only
+ if (task.VideoEncoder == VideoEncoder.X265)
+ {
+ if (!task.ShowAdvancedTab)
+ {
+ if (task.X265Preset != x265Preset.VeryFast)
+ {
+ query += string.Format(
+ " --x265-preset={0} ", task.X265Preset.ToString().ToLower().Replace(" ", string.Empty));
+ }
+
+ if (task.X265Tune != x265Tune.None)
+ {
+ query += string.Format(
+ " --x265-tune=\"{0}\" ", task.X265Tune.ToString().ToLower().Replace(" ", string.Empty));
+ }
+
+ if (task.H265Profile != x265Profile.None)
+ {
+ query += string.Format(
+ " --h265-profile={0} ", task.H265Profile.ToString().ToLower().Replace(" ", string.Empty));
+ }
+
+ if (!string.IsNullOrEmpty(task.ExtraAdvancedArguments))
+ {
+ query += string.Format(" -x {0}", task.ExtraAdvancedArguments);
+ }
+ }
+ }
+
// QSV Only
if (task.VideoEncoder == VideoEncoder.QuickSync)
{
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
index 4872d6e7d..a3cfae6fe 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
@@ -115,6 +115,9 @@ namespace HandBrake.ApplicationServices.Utilities
Match x264Profile = Regex.Match(input, @"--x264-profile([=a-zA-Z0-9\s ]*)");
Match h264Level = Regex.Match(input, @"--h264-level([=a-zA-Z0-9.\s ]*)");
+ Match x265Profile = Regex.Match(input, @"--x265-profile([=a-zA-Z0-9\s ]*)");
+ Match x265Tune = Regex.Match(input, @"--x265-tune([=,a-zA-Z0-9\s ]*)");
+ Match x265Preset = Regex.Match(input, @"--x265-preset([=a-zA-Z0-9\s ]*)");
#endregion
#region Set Varibles
@@ -476,7 +479,38 @@ namespace HandBrake.ApplicationServices.Utilities
parsed.X264Tune = Converters.Getx264TuneFromCli(tuneOptions);
}
-
+
+
+
+
+
+
+ if (x265Preset.Success)
+ parsed.X265Preset =
+ Converters.Getx265PresetFromCli(x265Preset.ToString().Replace("--x265-preset", string.Empty).Replace("=", string.Empty).Trim());
+
+ if (h264Profile.Success)
+ parsed.H265Profile =
+ Converters.Getx265ProfileFromCli(h264Profile.ToString().Replace("--h265-profile", string.Empty).Replace("=", string.Empty).Trim());
+
+ if (x265Profile.Success)
+ parsed.H265Profile =
+ Converters.Getx265ProfileFromCli(x265Profile.ToString().Replace("--x265-profile", string.Empty).Replace("=", string.Empty).Trim());
+
+ if (x265Tune.Success)
+ {
+ string tuneOptions =
+ x265Tune.ToString().Replace("--x265-tune", string.Empty).Replace("=", string.Empty).Trim();
+
+ parsed.FastDecode = tuneOptions.Contains("fastdecode");
+
+ // Remove these options. They are not in the dropdown.
+ tuneOptions = tuneOptions.Replace("fastdecode", string.Empty).Replace(
+ ",", string.Empty);
+
+ parsed.X265Tune = Converters.Getx265TuneFromCli(tuneOptions);
+ }
+
#endregion
}
catch (Exception exc)
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj
index b6e60faad..bb4bd48cf 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInterop.csproj
@@ -151,6 +151,9 @@
<Compile Include="HbLib\NativeConstants.cs" />
<Compile Include="Interfaces\IHandBrakeInstance.cs" />
<Compile Include="Helpers\InteropUtilities.cs" />
+ <Compile Include="Model\Encoding\x265\x265Preset.cs" />
+ <Compile Include="Model\Encoding\x265\x265Profile.cs" />
+ <Compile Include="Model\Encoding\x265\x265Tune.cs" />
<Compile Include="Model\Language.cs" />
<Compile Include="Helpers\Languages.cs" />
<Compile Include="Helpers\MarshalingConstants.cs" />
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs
index f37766281..c1947745b 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/EncodingProfile.cs
@@ -11,20 +11,20 @@ namespace HandBrake.Interop.Model.Encoding
{
using System.Collections.Generic;
- using HandBrake.Interop.Model;
+ using HandBrake.Interop.Model;
/// <summary>
/// The encoding profile.
/// </summary>
public class EncodingProfile
- {
+ {
/// <summary>
/// Initializes a new instance of the <see cref="EncodingProfile"/> class.
/// </summary>
public EncodingProfile()
- {
- this.Cropping = new Cropping();
- }
+ {
+ this.Cropping = new Cropping();
+ }
#region Destination and Output Settings
@@ -213,6 +213,26 @@ namespace HandBrake.Interop.Model.Encoding
public List<string> X264Tunes { get; set; }
/// <summary>
+ /// Gets or sets the x 265 profile.
+ /// </summary>
+ public string X265Profile { get; set; }
+
+ /// <summary>
+ /// Gets or sets the x 265 preset.
+ /// </summary>
+ public string X265Preset { get; set; }
+
+ /// <summary>
+ /// Gets or sets the x 265 tunes.
+ /// </summary>
+ public List<string> X265Tunes { get; set; }
+
+ /// <summary>
+ /// Gets or sets the x 265 level.
+ /// </summary>
+ public List<string> X265Level { get; set; }
+
+ /// <summary>
/// Gets or sets the qsv preset.
/// </summary>
public string QsvPreset { get; set; }
@@ -282,70 +302,70 @@ namespace HandBrake.Interop.Model.Encoding
#endregion
/// <summary>
- /// The clone.
- /// </summary>
- /// <returns>
- /// The <see cref="EncodingProfile"/>.
- /// </returns>
- public EncodingProfile Clone()
- {
- var profile = new EncodingProfile
- {
- ContainerName = this.ContainerName,
- PreferredExtension = this.PreferredExtension,
- IncludeChapterMarkers = this.IncludeChapterMarkers,
- LargeFile = this.LargeFile,
- Optimize = this.Optimize,
- IPod5GSupport = this.IPod5GSupport,
-
- Width = this.Width,
- Height = this.Height,
- MaxWidth = this.MaxWidth,
- MaxHeight = this.MaxHeight,
- ScaleMethod = this.ScaleMethod,
- CroppingType = this.CroppingType,
- Cropping = this.Cropping.Clone(),
- Anamorphic = this.Anamorphic,
- UseDisplayWidth = this.UseDisplayWidth,
- DisplayWidth = this.DisplayWidth,
- KeepDisplayAspect = this.KeepDisplayAspect,
- PixelAspectX = this.PixelAspectX,
- PixelAspectY = this.PixelAspectY,
- Modulus = this.Modulus,
-
- Deinterlace = this.Deinterlace,
- CustomDeinterlace = this.CustomDeinterlace,
- Decomb = this.Decomb,
- CustomDecomb = this.CustomDecomb,
- Detelecine = this.Detelecine,
- CustomDetelecine = this.CustomDetelecine,
- Denoise = this.Denoise,
- CustomDenoise = this.CustomDenoise,
- Deblock = this.Deblock,
- Grayscale = this.Grayscale,
-
- VideoEncoder = this.VideoEncoder,
- X264Options = this.X264Options,
- X264Profile = this.X264Profile,
- X264Preset = this.X264Preset,
- X264Tunes = this.X264Tunes,
- QsvPreset = this.QsvPreset,
- QsvDecode = this.QsvDecode,
- H264Level = this.H264Level,
- VideoEncodeRateType = this.VideoEncodeRateType,
- Quality = this.Quality,
- TargetSize = this.TargetSize,
- VideoBitrate = this.VideoBitrate,
- TwoPass = this.TwoPass,
- TurboFirstPass = this.TurboFirstPass,
- Framerate = this.Framerate,
- ConstantFramerate = this.ConstantFramerate,
-
- AudioEncodings = new List<AudioEncoding>(this.AudioEncodings),
- AudioEncoderFallback = this.AudioEncoderFallback
- };
-
- return profile;
- }
- }
+ /// The clone.
+ /// </summary>
+ /// <returns>
+ /// The <see cref="EncodingProfile"/>.
+ /// </returns>
+ public EncodingProfile Clone()
+ {
+ var profile = new EncodingProfile
+ {
+ ContainerName = this.ContainerName,
+ PreferredExtension = this.PreferredExtension,
+ IncludeChapterMarkers = this.IncludeChapterMarkers,
+ LargeFile = this.LargeFile,
+ Optimize = this.Optimize,
+ IPod5GSupport = this.IPod5GSupport,
+
+ Width = this.Width,
+ Height = this.Height,
+ MaxWidth = this.MaxWidth,
+ MaxHeight = this.MaxHeight,
+ ScaleMethod = this.ScaleMethod,
+ CroppingType = this.CroppingType,
+ Cropping = this.Cropping.Clone(),
+ Anamorphic = this.Anamorphic,
+ UseDisplayWidth = this.UseDisplayWidth,
+ DisplayWidth = this.DisplayWidth,
+ KeepDisplayAspect = this.KeepDisplayAspect,
+ PixelAspectX = this.PixelAspectX,
+ PixelAspectY = this.PixelAspectY,
+ Modulus = this.Modulus,
+
+ Deinterlace = this.Deinterlace,
+ CustomDeinterlace = this.CustomDeinterlace,
+ Decomb = this.Decomb,
+ CustomDecomb = this.CustomDecomb,
+ Detelecine = this.Detelecine,
+ CustomDetelecine = this.CustomDetelecine,
+ Denoise = this.Denoise,
+ CustomDenoise = this.CustomDenoise,
+ Deblock = this.Deblock,
+ Grayscale = this.Grayscale,
+
+ VideoEncoder = this.VideoEncoder,
+ X264Options = this.X264Options,
+ X264Profile = this.X264Profile,
+ X264Preset = this.X264Preset,
+ X264Tunes = this.X264Tunes,
+ QsvPreset = this.QsvPreset,
+ QsvDecode = this.QsvDecode,
+ H264Level = this.H264Level,
+ VideoEncodeRateType = this.VideoEncodeRateType,
+ Quality = this.Quality,
+ TargetSize = this.TargetSize,
+ VideoBitrate = this.VideoBitrate,
+ TwoPass = this.TwoPass,
+ TurboFirstPass = this.TurboFirstPass,
+ Framerate = this.Framerate,
+ ConstantFramerate = this.ConstantFramerate,
+
+ AudioEncodings = new List<AudioEncoding>(this.AudioEncodings),
+ AudioEncoderFallback = this.AudioEncoderFallback
+ };
+
+ return profile;
+ }
+ }
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs
index b355d5038..7e30009b7 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/VideoEncoder.cs
@@ -35,6 +35,10 @@ namespace HandBrake.Interop.Model.Encoding
[Display(Name = "VP3 (Theora)")]
[ShortName("theora")]
- Theora
+ Theora,
+
+ [Display(Name = "H.265 (x265)")]
+ [ShortName("hvec")]
+ X265
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/x265/x265Preset.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/x265/x265Preset.cs
new file mode 100644
index 000000000..f8ec669d5
--- /dev/null
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/x265/x265Preset.cs
@@ -0,0 +1,49 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="x265Preset.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Defines the x265Preset type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.Interop.Model.Encoding.x265
+{
+ using System.ComponentModel.DataAnnotations;
+
+ /// <summary>
+ /// The X265 Preset
+ /// </summary>
+ public enum x265Preset
+ {
+ [Display(Name = "Ultrafast")]
+ Ultrafast,
+
+ [Display(Name = "Super Fast")]
+ Superfast,
+
+ [Display(Name = "Very Fast")]
+ VeryFast,
+
+ [Display(Name = "Faster")]
+ Faster,
+
+ [Display(Name = "Fast")]
+ Fast,
+
+ [Display(Name = "Medium")]
+ Medium,
+
+ [Display(Name = "Slow")]
+ Slow,
+
+ [Display(Name = "Slower")]
+ Slower,
+
+ [Display(Name = "Very Slow")]
+ VerySlow,
+
+ [Display(Name = "Placebo")]
+ Placebo,
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/x265/x265Profile.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/x265/x265Profile.cs
new file mode 100644
index 000000000..8d3aab3da
--- /dev/null
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/x265/x265Profile.cs
@@ -0,0 +1,31 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="x265Profile.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The X265 Profile
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.Interop.Model.Encoding.x265
+{
+ using System.ComponentModel.DataAnnotations;
+
+ /// <summary>
+ /// The X265 Profile
+ /// </summary>
+ public enum x265Profile
+ {
+ [Display(Name = "Auto")]
+ None = 0,
+
+ [Display(Name = "Main")]
+ Main,
+
+ [Display(Name = "Main10")]
+ Main10,
+
+ [Display(Name = "Mainstillpicture")]
+ Mainstillpicture,
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/x265/x265Tune.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/x265/x265Tune.cs
new file mode 100644
index 000000000..03d762359
--- /dev/null
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/x265/x265Tune.cs
@@ -0,0 +1,28 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="x265Tune.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Defines the x265Tune type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.Interop.Model.Encoding.x265
+{
+ using System.ComponentModel.DataAnnotations;
+
+ /// <summary>
+ /// The X265 Tune MOdel
+ /// </summary>
+ public enum x265Tune
+ {
+ [Display(Name = "None")]
+ None = 0,
+
+ [Display(Name = "PSNR")]
+ Psnr,
+
+ [Display(Name = "SSIM")]
+ Ssim,
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
index 8e2f1d379..6854656d4 100644
--- a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs
@@ -60,6 +60,11 @@ namespace HandBrakeWPF.Converters.Video
encoders.Remove(VideoEncoder.QuickSync);
}
+ if (task != null && task.OutputFormat != OutputFormat.X265)
+ {
+ encoders.Remove(VideoEncoder.X265);
+ }
+
return EnumHelper<VideoEncoder>.GetEnumDisplayValuesSubset(encoders);
}
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
index 45a63951a..2eca4f527 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
@@ -793,6 +793,60 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to The full list of encoder parameters:
+ ///{0}.
+ /// </summary>
+ public static string Video_EncoderExtraArgs {
+ get {
+ return ResourceManager.GetString("Video_EncoderExtraArgs", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Sets and ensures compliance with the specified H.264 Levels. This will override all other settings..
+ /// </summary>
+ public static string Video_EncoderLevel {
+ get {
+ return ResourceManager.GetString("Video_EncoderLevel", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Adjusts x264 settings to trade off compression efficiency against encoding speed.
+ ///
+ ///This establishes your default x264 settings. Tunes, profiles, levels and advanced options string will be applied to this.
+ ///
+ ///You should generally set this option to the slowest you can bear since slower settings will result in better quality or smaller files..
+ /// </summary>
+ public static string Video_EncoderPreset {
+ get {
+ return ResourceManager.GetString("Video_EncoderPreset", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Limit the H.264 profile of the output stream. This will override all other settings..
+ /// </summary>
+ public static string Video_EncoderProfile {
+ get {
+ return ResourceManager.GetString("Video_EncoderProfile", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Tune settings to optimise for common scenarios
+ ///
+ ///This can improve efficiency for particular source characteristics or set of characteristics of the output file.
+ ///
+ ///Changes will be applied after the preset but before all other parameters..
+ /// </summary>
+ public static string Video_EncoderTune {
+ get {
+ return ResourceManager.GetString("Video_EncoderTune", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Higher Quality |.
/// </summary>
public static string Video_HigherQuality {
@@ -885,16 +939,6 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
- /// Looks up a localized string similar to The full x264 list of parameters:
- ///{0}.
- /// </summary>
- public static string Video_x264ExtraArgs {
- get {
- return ResourceManager.GetString("Video_x264ExtraArgs", resourceCulture);
- }
- }
-
- /// <summary>
/// Looks up a localized string similar to Reduce decoder CPU usage.
///
///Set this if your device is struggling to play the output. (i.e. dropped frames).
@@ -906,50 +950,6 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
- /// Looks up a localized string similar to Sets and ensures compliance with the specified H.264 Levels. This will override all other settings..
- /// </summary>
- public static string Video_x264Level {
- get {
- return ResourceManager.GetString("Video_x264Level", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Adjusts x264 settings to trade off compression efficiency against encoding speed.
- ///
- ///This establishes your default x264 settings. Tunes, profiles, levels and advanced options string will be applied to this.
- ///
- ///You should generally set this option to the slowest you can bear since slower settings will result in better quality or smaller files..
- /// </summary>
- public static string Video_x264Preset {
- get {
- return ResourceManager.GetString("Video_x264Preset", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Limit the H.264 profile of the output stream. This will override all other settings..
- /// </summary>
- public static string Video_x264Profile {
- get {
- return ResourceManager.GetString("Video_x264Profile", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to Tune settings to optimise for common scenarios
- ///
- ///This can improve efficiency for particular source characteristics or set of characteristics of the output file.
- ///
- ///Changes will be applied after the preset but before all other parameters..
- /// </summary>
- public static string Video_x264Tune {
- get {
- return ResourceManager.GetString("Video_x264Tune", resourceCulture);
- }
- }
-
- /// <summary>
/// Looks up a localized string similar to Warning.
/// </summary>
public static string Warning {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx
index d86c6cc5b..2f323b50e 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.resx
+++ b/win/CS/HandBrakeWPF/Properties/Resources.resx
@@ -233,8 +233,8 @@ Baseline profile, as required for iPods and similar devices, requires weighted P
Note that some devices and players, even those that support Main Profile,
may have problems with Weighted P-frame prediction: the Apple TV is completely incompatible with it, for example.</value>
</data>
- <data name="Video_x264ExtraArgs" xml:space="preserve">
- <value>The full x264 list of parameters:
+ <data name="Video_EncoderExtraArgs" xml:space="preserve">
+ <value>The full list of encoder parameters:
{0}</value>
</data>
<data name="Video_x264FastDecode" xml:space="preserve">
@@ -242,20 +242,20 @@ may have problems with Weighted P-frame prediction: the Apple TV is completely i
Set this if your device is struggling to play the output. (i.e. dropped frames)</value>
</data>
- <data name="Video_x264Level" xml:space="preserve">
+ <data name="Video_EncoderLevel" xml:space="preserve">
<value>Sets and ensures compliance with the specified H.264 Levels. This will override all other settings.</value>
</data>
- <data name="Video_x264Preset" xml:space="preserve">
+ <data name="Video_EncoderPreset" xml:space="preserve">
<value>Adjusts x264 settings to trade off compression efficiency against encoding speed.
This establishes your default x264 settings. Tunes, profiles, levels and advanced options string will be applied to this.
You should generally set this option to the slowest you can bear since slower settings will result in better quality or smaller files.</value>
</data>
- <data name="Video_x264Profile" xml:space="preserve">
+ <data name="Video_EncoderProfile" xml:space="preserve">
<value>Limit the H.264 profile of the output stream. This will override all other settings.</value>
</data>
- <data name="Video_x264Tune" xml:space="preserve">
+ <data name="Video_EncoderTune" xml:space="preserve">
<value>Tune settings to optimise for common scenarios
This can improve efficiency for particular source characteristics or set of characteristics of the output file.
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index d9c2640f8..4306fc7f7 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1440,6 +1440,9 @@ namespace HandBrakeWPF.ViewModels
case ".m4v":
this.SelectedOutputFormat = OutputFormat.M4V;
break;
+ case ".x265":
+ this.SelectedOutputFormat = OutputFormat.X265;
+ break;
}
this.NotifyOfPropertyChange(() => this.CurrentTask);
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
index 5dd4b07aa..0d3dc5ce0 100644
--- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
@@ -25,6 +25,7 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.Interop;
using HandBrake.Interop.Model.Encoding;
using HandBrake.Interop.Model.Encoding.x264;
+ using HandBrake.Interop.Model.Encoding.x265;
using HandBrakeWPF.Commands.Interfaces;
using HandBrakeWPF.Properties;
@@ -45,7 +46,7 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// The possible h264 levels.
/// </summary>
- private static readonly List<string> Levels = new List<string> { "Auto", "1.0", "1b", "1.1", "1.2", "1.3", "2.0", "2.1", "2.2", "3.0", "3.1", "3.2", "4.0", "4.1", "4.2", "5.0", "5.1", "5.2"};
+ private static readonly List<string> Levels = new List<string> { "Auto", "1.0", "1b", "1.1", "1.2", "1.3", "2.0", "2.1", "2.2", "3.0", "3.1", "3.2", "4.0", "4.1", "4.2", "5.0", "5.1", "5.2" };
/// <summary>
/// Backing field for the user setting service.
@@ -63,6 +64,11 @@ namespace HandBrakeWPF.ViewModels
private bool displayX264Options;
/// <summary>
+ /// Backing field used to display / hide the x265 options
+ /// </summary>
+ private bool displayX265Options;
+
+ /// <summary>
/// The display qsv options.
/// </summary>
private bool displayQSVOptions;
@@ -122,6 +128,11 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private bool displayNonQSVControls;
+ /// <summary>
+ /// The x265 preset value.
+ /// </summary>
+ private int x265PresetValue;
+
#endregion
#region Constructors and Destructors
@@ -151,6 +162,10 @@ namespace HandBrakeWPF.ViewModels
X264Tunes = EnumHelper<x264Tune>.GetEnumList().Where(t => t != x264Tune.Fastdecode);
this.H264Levels = Levels;
+ X265Presets = new BindingList<x265Preset>(EnumHelper<x265Preset>.GetEnumList().ToList());
+ H265Profiles = EnumHelper<x265Profile>.GetEnumList();
+ X265Tunes = EnumHelper<x265Tune>.GetEnumList();
+
this.userSettingService.SettingChanged += this.UserSettingServiceSettingChanged;
}
@@ -400,6 +415,9 @@ namespace HandBrakeWPF.ViewModels
case VideoEncoder.Theora:
Task.Quality = value;
break;
+ case VideoEncoder.X265:
+ Task.Quality = value;
+ break;
}
this.NotifyOfPropertyChange(() => this.RF);
@@ -539,6 +557,10 @@ namespace HandBrakeWPF.ViewModels
// Hide the x264 controls when not needed.
this.DisplayX264Options = value == VideoEncoder.X264;
+
+ // Hide the x265 controls when not needed.
+ this.DisplayX265Options = value == VideoEncoder.X265;
+
this.DisplayQSVOptions = value == VideoEncoder.QuickSync;
this.DisplayH264Options = value == VideoEncoder.X264 || value == VideoEncoder.QuickSync;
this.UseAdvancedTab = value != VideoEncoder.QuickSync && this.UseAdvancedTab;
@@ -599,7 +621,7 @@ namespace HandBrakeWPF.ViewModels
}
}
}
-
+
/// <summary>
/// Gets or sets a value indicating whether to display H264
/// </summary>
@@ -634,6 +656,23 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
+ /// Gets or sets a value indicating whether display x 264 options.
+ /// </summary>
+ public bool DisplayX265Options
+ {
+ get
+ {
+ return this.displayX265Options;
+ }
+ set
+ {
+ this.displayX265Options = value;
+ this.NotifyOfPropertyChange(() => this.DisplayX265Options);
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ }
+ }
+
+ /// <summary>
/// Gets or sets a value indicating whether to display qsv options.
/// </summary>
public bool DisplayQSVOptions
@@ -707,7 +746,7 @@ namespace HandBrakeWPF.ViewModels
}
}
}
-
+
/// <summary>
/// Gets or sets X264Preset.
/// </summary>
@@ -864,7 +903,7 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return string.Format(Resources.Video_x264ExtraArgs, this.GetActualx264Query()); // "You can provide additional arguments using the standard x264 format";
+ return string.Format(Resources.Video_EncoderExtraArgs, this.GetActualx264Query()); // "You can provide additional arguments using the standard x264 format";
}
}
@@ -879,6 +918,106 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Gets or sets the x 265 preset value.
+ /// </summary>
+ public int X265PresetValue
+ {
+ get
+ {
+ return this.x265PresetValue;
+ }
+ set
+ {
+ if (!object.Equals(this.X265PresetValue, value))
+ {
+ this.x265PresetValue = value;
+ this.X265Preset = this.X265Presets[value];
+ this.NotifyOfPropertyChange(() => this.x265PresetValue);
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets X265Preset.
+ /// </summary>
+ public x265Preset X265Preset
+ {
+ get
+ {
+ return this.Task.X265Preset;
+ }
+ set
+ {
+ if (!object.Equals(this.X265Preset, value))
+ {
+ this.Task.X265Preset = value;
+ this.NotifyOfPropertyChange(() => this.X265Preset);
+ ResetAdvancedTab();
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Gets or sets H265Profile.
+ /// </summary>
+ public x265Profile H265Profile
+ {
+ get
+ {
+ return this.Task.H265Profile;
+ }
+
+ set
+ {
+ if (!object.Equals(this.H265Profile, value))
+ {
+ this.Task.H265Profile = value;
+ this.NotifyOfPropertyChange(() => this.H265Profile);
+ ResetAdvancedTab();
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets X265Tune.
+ /// </summary>
+ public x265Tune X265Tune
+ {
+ get
+ {
+ return this.Task.X265Tune;
+ }
+ set
+ {
+ if (!object.Equals(this.X265Tune, value))
+ {
+ this.Task.X265Tune = value;
+ this.NotifyOfPropertyChange(() => this.X265Tune);
+ ResetAdvancedTab();
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets X265Presets.
+ /// </summary>
+ public BindingList<x265Preset> X265Presets { get; set; }
+
+ /// <summary>
+ /// Gets or sets X265Profiles.
+ /// </summary>
+ public IEnumerable<x265Profile> H265Profiles { get; set; }
+
+ /// <summary>
+ /// Gets or sets X265Tunes.
+ /// </summary>
+ public IEnumerable<x265Tune> X265Tunes { get; set; }
#endregion
#region Public Methods
@@ -970,6 +1109,13 @@ namespace HandBrakeWPF.ViewModels
this.RF = (int)preset.Task.Quality.Value;
}
break;
+
+ case VideoEncoder.X265:
+ if (preset.Task.Quality.HasValue)
+ {
+ this.RF = (int)preset.Task.Quality.Value;
+ }
+ break;
}
this.Task.TwoPass = preset.Task.TwoPass;
@@ -1009,6 +1155,20 @@ namespace HandBrakeWPF.ViewModels
this.FastDecode = false;
}
+ // x265 Only
+ if (preset.Task.VideoEncoder == VideoEncoder.X265)
+ {
+ this.X265PresetValue = (int)preset.Task.X264Preset;
+ this.X265Tune = preset.Task.X265Tune;
+ this.H265Profile = preset.Task.H265Profile;
+ }
+ else
+ {
+ this.X265PresetValue = (int)x265Preset.VeryFast;
+ this.X265Tune = x265Tune.None;
+ this.H265Profile = x265Profile.None;
+ }
+
// QSV Only
if (preset.Task.VideoEncoder == VideoEncoder.QuickSync)
{
@@ -1054,6 +1214,10 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.FastDecode);
this.NotifyOfPropertyChange(() => this.ExtraArguments);
this.NotifyOfPropertyChange(() => this.QsvPreset);
+
+ this.NotifyOfPropertyChange(() => this.H265Profile);
+ this.NotifyOfPropertyChange(() => this.X265Preset);
+ this.NotifyOfPropertyChange(() => this.X265Tune);
}
/// <summary>
@@ -1067,6 +1231,7 @@ namespace HandBrakeWPF.ViewModels
this.DisplayH264Options = encoder == VideoEncoder.X264 || encoder == VideoEncoder.QuickSync;
this.DisplayX264Options = encoder == VideoEncoder.X264;
this.DisplayQSVOptions = encoder == VideoEncoder.QuickSync;
+ this.DisplayX265Options = encoder == VideoEncoder.X265;
if (encoder == VideoEncoder.QuickSync)
{
@@ -1100,6 +1265,10 @@ namespace HandBrakeWPF.ViewModels
this.H264Level = "Auto";
this.ExtraArguments = string.Empty;
this.canClear = true;
+
+ this.H265Profile = x265Profile.None;
+ this.x265PresetValue = 1;
+ this.X265Tune = x265Tune.None;
}
/// <summary>
@@ -1135,6 +1304,10 @@ namespace HandBrakeWPF.ViewModels
this.QualityMin = 0;
this.QualityMax = 63;
break;
+ case VideoEncoder.X265:
+ this.QualityMin = 0;
+ this.QualityMax = 50;
+ break;
}
}
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml
index 1f0b31764..a7b87a3a7 100644
--- a/win/CS/HandBrakeWPF/Views/VideoView.xaml
+++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml
@@ -170,7 +170,7 @@
<StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Orientation="Horizontal"
Visibility="{Binding DisplayX264Options, Converter={StaticResource boolToVisConverter}}" >
<Slider Minimum="0" Maximum="9" Width="150" Value="{Binding X264PresetValue, Mode=Default, UpdateSourceTrigger=PropertyChanged}"
- IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight" ToolTip="{x:Static Properties:Resources.Video_x264Preset}"
+ IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight" ToolTip="{x:Static Properties:Resources.Video_EncoderPreset}"
Style="{StaticResource LongToolTipHolder}" />
<TextBlock Text="{Binding X264Preset, Converter={StaticResource enumComboConverter}}" Margin="5,0,0,0" />
</StackPanel>
@@ -181,7 +181,7 @@
ItemsSource="{Binding X264Tunes, Converter={StaticResource enumComboConverter}}"
SelectedItem="{Binding X264Tune, Converter={StaticResource enumComboConverter}}"
Visibility="{Binding DisplayX264Options, Converter={StaticResource boolToVisConverter}}"
- ToolTip="{x:Static Properties:Resources.Video_x264Tune}"
+ ToolTip="{x:Static Properties:Resources.Video_EncoderTune}"
Style="{StaticResource LongToolTipHolder}" />
<CheckBox IsChecked="{Binding FastDecode}" Content="Fast Decode" Grid.Row="2" Grid.Column="2" Margin="10,10,10,0" VerticalAlignment="Center"
Visibility="{Binding DisplayX264Options, Converter={StaticResource boolToVisConverter}}"
@@ -203,14 +203,14 @@
ItemsSource="{Binding H264Profiles, Converter={StaticResource enumComboConverter}}"
SelectedItem="{Binding H264Profile, Converter={StaticResource enumComboConverter}}"
Style="{StaticResource LongToolTipHolder}"
- ToolTip="{x:Static Properties:Resources.Video_x264Profile}" />
+ ToolTip="{x:Static Properties:Resources.Video_EncoderProfile}" />
<TextBlock Text="H.264 Level:" Grid.Row="3" Grid.Column="2" Margin="10,10,0,0" VerticalAlignment="Center" />
<ComboBox Width="100" Grid.Row="3" Grid.Column="3" Margin="5,10,5,0" Height="22" VerticalAlignment="Center"
ItemsSource="{Binding H264Levels}"
SelectedItem="{Binding H264Level}"
Style="{StaticResource LongToolTipHolder}"
- ToolTip="{x:Static Properties:Resources.Video_x264Level}"/>
+ ToolTip="{x:Static Properties:Resources.Video_EncoderLevel}"/>
<!-- Row 3 -->
<TextBlock Text="Extra Options:" Grid.Row="4" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" HorizontalAlignment="Left"
@@ -231,6 +231,84 @@
</Grid>
+ <!-- H265 settings -->
+
+ <Grid Grid.Row="1" Grid.ColumnSpan="2" Margin="0,20,0,0" Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+
+ <TextBlock Text="Optimise Video:" Margin="0,0,0,8" Grid.Row="0" Grid.ColumnSpan="2" FontWeight="Bold" VerticalAlignment="Center" />
+
+ <CheckBox Content="Use Advanced Tab instead" Grid.Row="1" IsChecked="{Binding UseAdvancedTab}"
+ Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
+
+ <Grid Grid.Row="2" Margin="0,5,0,0" IsEnabled="{Binding UseAdvancedTab, Converter={StaticResource inverseConverter}}">
+
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+
+ <!-- Row 1 -->
+
+ <TextBlock Text="x265 Preset:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"
+ Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}" />
+ <StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Orientation="Horizontal"
+ Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}" >
+ <Slider Minimum="0" Maximum="9" Width="150" Value="{Binding X265PresetValue, Mode=Default, UpdateSourceTrigger=PropertyChanged}"
+ IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight" ToolTip="{x:Static Properties:Resources.Video_EncoderPreset}"
+ Style="{StaticResource LongToolTipHolder}" />
+ <TextBlock Text="{Binding X265Preset}" Margin="5,0,0,0" />
+ </StackPanel>
+
+ <TextBlock Text="x265 Tune:" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="0,10,0,0"
+ Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}" />
+ <ComboBox Width="100" Grid.Row="2" Grid.Column="1" Margin="5,10,5,0" Height="22"
+ ItemsSource="{Binding X265Tunes}"
+ SelectedItem="{Binding X265Tune}"
+ Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}"
+ ToolTip="{x:Static Properties:Resources.Video_EncoderTune}"
+ Style="{StaticResource LongToolTipHolder}" />
+
+ <TextBlock Text="H.265 Profile:" Grid.Row="2" Grid.Column="2" Margin="10,10,0,0" VerticalAlignment="Center"
+ Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}" />
+ <ComboBox Width="100" Grid.Row="2" Grid.Column="3" Margin="5,10,5,0" Height="22" VerticalAlignment="Center"
+ Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}"
+ ItemsSource="{Binding H265Profiles}"
+ SelectedItem="{Binding H265Profile}"
+ Style="{StaticResource LongToolTipHolder}"
+ ToolTip="{x:Static Properties:Resources.Video_EncoderProfile}" />
+
+ <!-- Row 3 -->
+ <TextBlock Text="Extra Options:" Grid.Row="4" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" HorizontalAlignment="Left"
+ Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}" />
+ <TextBox Text="{Binding ExtraArguments, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+ Height="30" MaxLines="2" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Margin="5,10,0,0" VerticalAlignment="Center"
+ ToolTip="{Binding FullOptionsTooltip}" Style="{StaticResource LongToolTipHolder}"
+ Visibility="{Binding DisplayX265Options, Converter={StaticResource boolToVisConverter}}" >
+ <TextBox.ContextMenu>
+ <ContextMenu>
+ <MenuItem Header="Copy Full Query" cal:Message.Attach="[Event Click] = [Action CopyQuery]" />
+ </ContextMenu>
+ </TextBox.ContextMenu>
+ </TextBox>
+ </Grid>
+ </Grid>
</Grid>
</Grid>