diff options
author | sr55 <[email protected]> | 2017-06-14 22:07:14 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2017-06-14 22:07:14 +0100 |
commit | e2aaa9f501ab10d6ca3b01dbd3306b73334c917e (patch) | |
tree | 1794ebd3d4eb442fa018a04aff3170a91f01618f /win/CS/HandBrakeWPF | |
parent | 0b65b3005312401d0f9aad7acb00aa412cea7376 (diff) |
WinGui: Add checkbox for Legacy A/V alignment behaviour for players that don't support MP4 Edit Lists. #778
Diffstat (limited to 'win/CS/HandBrakeWPF')
9 files changed, 61 insertions, 2 deletions
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs index 9da007c10..d629a2424 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs @@ -312,6 +312,15 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
+ /// Looks up a localized string similar to Aligns the initial timestamps of all audio and video streams by inserting blank frames or dropping frames. May improve audio/video sync for broken players that do not honor MP4 edit lists..
+ /// </summary>
+ public static string MainView_AlignAVStart {
+ get {
+ return ResourceManager.GetString("MainView_AlignAVStart", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Video angle to encode. Only applicable to multi-angle DVD and Blu-ray..
/// </summary>
public static string MainView_Angle {
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx b/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx index ed2d40c51..e5b35b1b8 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx +++ b/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx @@ -454,4 +454,7 @@ Lapsharp's Animation tune is useful for cel animation such as anime and cartoons Lapsharp's Sprite tune is useful for 1-/4-/8-/16-bit 2-dimensional games. Sprite uses a 4-neighbor Laplacian kernel that enhances vertical and horizontal edges more than diagonal edges.</value>
</data>
+ <data name="MainView_AlignAVStart" xml:space="preserve">
+ <value>Aligns the initial timestamps of all audio and video streams by inserting blank frames or dropping frames. May improve audio/video sync for broken players that do not honor MP4 edit lists.</value>
+ </data>
</root>
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs index 594420109..6ca2f276e 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs @@ -655,6 +655,15 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
+ /// Looks up a localized string similar to Align A/V Start.
+ /// </summary>
+ public static string MainView_AlignAVStart {
+ get {
+ return ResourceManager.GetString("MainView_AlignAVStart", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Angle.
/// </summary>
public static string MainView_Angle {
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx index 34edf84b0..6349d4978 100644 --- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx +++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx @@ -911,4 +911,7 @@ This will not affect your current settings in the Subtitle tab.</value> <data name="FiltersView_Sharpen" xml:space="preserve">
<value>Sharpen</value>
</data>
+ <data name="MainView_AlignAVStart" xml:space="preserve">
+ <value>Align A/V Start</value>
+ </data>
</root>
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs index 20e4eff14..18021c9bc 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs @@ -146,6 +146,7 @@ namespace HandBrakeWPF.Services.Encode.Factories Mp4Optimize = job.OptimizeMP4 }, ChapterMarkers = job.IncludeChapterMarkers, + AlignAVStart = job.AlignAVStart, Mux = HBFunctions.hb_container_get_from_name(job.OutputFormat == OutputFormat.Mp4 ? "av_mp4" : "av_mkv"), // TODO tidy up. ChapterList = new List<Chapter>() }; diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs index 84d1eb7eb..f65cf6891 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs @@ -87,6 +87,7 @@ namespace HandBrakeWPF.Services.Encode.Model this.ChapterNames.Add(new ChapterMarker(track)); } + this.AlignAVStart = task.AlignAVStart; this.ChapterMarkersFilePath = task.ChapterMarkersFilePath; this.Cropping = new Cropping(task.Cropping); this.CustomDecomb = task.CustomDecomb; @@ -218,6 +219,8 @@ namespace HandBrakeWPF.Services.Encode.Model /// </summary> public bool IPod5GSupport { get; set; } + public bool AlignAVStart { get; set; } + #endregion #region Picture diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs index 9b252e030..787e5ea46 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs @@ -72,6 +72,7 @@ namespace HandBrakeWPF.Services.Presets.Factories preset.Task.OptimizeMP4 = importedPreset.Mp4HttpOptimize;
preset.Task.IPod5GSupport = importedPreset.Mp4iPodCompatible;
preset.Task.OutputFormat = GetFileFormat(importedPreset.FileFormat.Replace("file", string.Empty).Trim()); // TOOD null check.
+ preset.Task.AlignAVStart = importedPreset.AlignAVStart;
/* Picture Settings */
preset.PictureSettingsMode = (PresetPictureSettingsMode)importedPreset.UsesPictureSettings;
@@ -604,6 +605,7 @@ namespace HandBrakeWPF.Services.Presets.Factories preset.FileFormat = EnumHelper<OutputFormat>.GetShortName(export.Task.OutputFormat);
preset.Mp4HttpOptimize = export.Task.OptimizeMP4;
preset.Mp4iPodCompatible = export.Task.IPod5GSupport;
+ preset.AlignAVStart = export.Task.AlignAVStart;
// Picture Settings
preset.PictureForceHeight = 0; // TODO
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 0a8d0b297..1502d4baa 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -393,6 +393,7 @@ namespace HandBrakeWPF.ViewModels this.OptimizeMP4 = selectedPreset.Task.OptimizeMP4;
this.IPod5GSupport = selectedPreset.Task.IPod5GSupport;
this.SelectedOutputFormat = selectedPreset.Task.OutputFormat;
+ this.AlignAVStart = selectedPreset.Task.AlignAVStart;
// Tab Settings
this.PictureSettingsViewModel.SetPreset(this.selectedPreset, this.CurrentTask);
@@ -458,6 +459,23 @@ namespace HandBrakeWPF.ViewModels }
}
+ public bool AlignAVStart
+ {
+ get
+ {
+ return this.CurrentTask.AlignAVStart;
+ }
+ set
+ {
+ if (value == this.CurrentTask.AlignAVStart)
+ {
+ return;
+ }
+ this.CurrentTask.AlignAVStart = value;
+ this.NotifyOfPropertyChange(() => this.AlignAVStart);
+ }
+ }
+
/// <summary>
/// Gets or sets The Current Encode Task that the user is building
/// </summary>
@@ -2218,9 +2236,11 @@ namespace HandBrakeWPF.ViewModels this.IsMkv = true;
this.CurrentTask.OptimizeMP4 = false;
this.CurrentTask.IPod5GSupport = false;
+ this.CurrentTask.AlignAVStart = false;
this.NotifyOfPropertyChange(() => this.OptimizeMP4);
this.NotifyOfPropertyChange(() => this.IPod5GSupport);
+ this.NotifyOfPropertyChange(() => this.AlignAVStart);
}
// Update The browse file extension display
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index 507ceb41d..b8da5c564 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -431,8 +431,17 @@ IsChecked="{Binding Path=IPod5GSupport}"
Visibility="{Binding IsMkv,
Converter={StaticResource boolToVisConverter},
- ConverterParameter=true}"
- />
+ ConverterParameter=true}" />
+
+ <CheckBox Name="AlignAVStart"
+ Margin="8,0,0,0"
+ VerticalAlignment="Center"
+ Content="{x:Static Properties:ResourcesUI.MainView_AlignAVStart}"
+ ToolTip="{x:Static Properties:ResourcesTooltips.MainView_AlignAVStart}"
+ IsChecked="{Binding Path=AlignAVStart}"
+ Visibility="{Binding IsMkv,
+ Converter={StaticResource boolToVisConverter},
+ ConverterParameter=true}" />
</StackPanel>
</StackPanel>
|