using HandBrake.ApplicationServices.Services.Interfaces;\r
using HandBrake.ApplicationServices.Model.Encoding;\r
using HandBrake.ApplicationServices.Utilities;\r
+ using HandBrake.Interop.Model.Encoding;\r
\r
/// <summary>\r
/// The preset service manages HandBrake's presets\r
this.presets.Add(preset);\r
}\r
}\r
+\r
+ this.presets.Add(this.QsvDemoPreset()); // TODO remove later.\r
} \r
}\r
catch (Exception exc)\r
}\r
\r
#endregion\r
+\r
+ #region Tempory Hack\r
+\r
+ /// <summary>\r
+ /// The qsv preset temp.\r
+ /// </summary>\r
+ /// <returns>\r
+ /// The <see cref="Preset"/>.\r
+ /// </returns>\r
+ private Preset QsvDemoPreset()\r
+ {\r
+ Preset preset = new Preset();\r
+ preset.Name = "QuickSync Demo";\r
+ preset.Category = "Regular";\r
+ preset.Description = "An example preset for QSV";\r
+ preset.IsBuildIn = true;\r
+ preset.PictureSettingsMode = PresetPictureSettingsMode.None;\r
+ preset.Task = new EncodeTask();\r
+\r
+ preset.Task.VideoEncoder = VideoEncoder.QuickSync;\r
+ preset.Task.Quality = 20;\r
+ preset.Task.AdvancedEncoderOptions =\r
+ "qsv-num-ref-frame=3:qsv-gop-ref-dist=5:qsv-gop-pic-size=5:qsv-async-depth=4";\r
+ preset.Task.AudioTracks = new ObservableCollection<AudioTrack>();\r
+ preset.Task.AudioTracks.Add(new AudioTrack { Bitrate = 160, Encoder = AudioEncoder.Faac, MixDown = Mixdown.DolbyProLogicII});\r
+ preset.Task.Anamorphic = Anamorphic.Loose;\r
+ preset.Task.QsvPreset = QsvPreset.Balanced;\r
+ preset.Task.FramerateMode = FramerateMode.VFR;\r
+ preset.Task.OutputFormat = OutputFormat.Mp4;\r
+ preset.Task.VideoEncodeRateType = VideoEncodeRateType.ConstantQuality;\r
+ \r
+ return preset;\r
+ }\r
+\r
+ #endregion\r
}\r
}\r
case VideoEncoder.FFMpeg2:\r
query += " -e ffmpeg2";\r
break;\r
-\r
case VideoEncoder.QuickSync:\r
query += " -e qsv";\r
break;\r
case VideoEncoder.FFMpeg2:\r
query += string.Format(" -q {0}", task.Quality.Value.ToString(CultureInfo.InvariantCulture));\r
break;\r
+ case VideoEncoder.QuickSync:\r
case VideoEncoder.X264:\r
query += string.Format(" -q {0}", task.Quality.Value.ToString(CultureInfo.InvariantCulture));\r
break;\r
[Display(Name = "H.264 (x264)")]\r
X264 = 0,\r
\r
+ [Display(Name = "QuickSync (H.264)")]\r
+ QuickSync,\r
+\r
[Display(Name = "MPEG-4 (FFmpeg)")]\r
FFMpeg,\r
\r
\r
[Display(Name = "VP3 (Theora)")]\r
Theora,\r
-\r
- [Display(Name = "QuickSync (H.264)")]\r
- QuickSync\r
}\r
}\r
{\r
get\r
{\r
- return 51.Equals(this.RF);\r
+ return 51.Equals(this.RF) && this.SelectedVideoEncoder == VideoEncoder.X264;\r
}\r
}\r
\r
case VideoEncoder.FFMpeg2:\r
this.Task.Quality = (32 - value);\r
break;\r
+ case VideoEncoder.QuickSync:\r
case VideoEncoder.X264:\r
double rfValue = 51.0 - value * cqStep;\r
rfValue = Math.Round(rfValue, 2);\r
this.RF = 32 - cq;\r
}\r
break;\r
+ case VideoEncoder.QuickSync:\r
case VideoEncoder.X264:\r
\r
double multiplier = 1.0 / cqStep;\r
this.NotifyOfPropertyChange(() => this.H264Profile);\r
this.NotifyOfPropertyChange(() => this.FastDecode);\r
this.NotifyOfPropertyChange(() => this.ExtraArguments);\r
+ this.NotifyOfPropertyChange(() => this.QsvPreset);\r
}\r
\r
/// <summary>\r
{\r
this.canClear = false;\r
this.X264PresetValue = 5;\r
- this.qsvPresetValue = 2;\r
this.X264Tune = x264Tune.None;\r
this.H264Profile = x264Profile.None;\r
this.FastDecode = false;\r
this.QualityMax = 31;\r
break;\r
case VideoEncoder.X264:\r
+ case VideoEncoder.QuickSync:\r
this.QualityMin = 0;\r
this.QualityMax = (int)(51 / userSettingService.GetUserSetting<double>(UserSettingConstants.X264Step));\r
break;\r