From 7856f5760bda5c33e86ad48c78bcc473f9597f96 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 4 Jan 2015 19:51:59 +0000 Subject: WinGui: Further fixes to libhb json encoding. FPS and Anamorphic should now work. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6684 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../HandBrake.ApplicationServices/Services/Encode/LibEncode.cs | 8 +++++++- win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs | 4 +++- .../HandBrake.ApplicationServices/Services/Scan/Model/Title.cs | 10 ++++++++++ .../Utilities/InteropModelCreator.cs | 1 + 4 files changed, 21 insertions(+), 2 deletions(-) (limited to 'win/CS/HandBrake.ApplicationServices') diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs index 6ae5d1f60..0da939e19 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs @@ -217,7 +217,13 @@ namespace HandBrake.ApplicationServices.Services.Encode throw new Exception("Unable to get title for encoding. Encode Failed."); } - Interop.Model.Scan.Title scannedTitle = new Interop.Model.Scan.Title { Resolution = new Size(title.Resolution.Width, title.Resolution.Height), ParVal = new Size(title.ParVal.Width, title.ParVal.Height) }; + Interop.Model.Scan.Title scannedTitle = new Interop.Model.Scan.Title + { + Resolution = new Size(title.Resolution.Width, title.Resolution.Height), + ParVal = new Size(title.ParVal.Width, title.ParVal.Height), + FramerateDenominator = title.FramerateDenominator, + FramerateNumerator = title.FramerateNumerator, + }; // TODO fix this tempory hack to pass in the required title information into the factory. instance.StartEncode(encodeJob, scannedTitle, job.Configuration.PreviewScanCount); diff --git a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs index d857e75f5..d72b07cbd 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs @@ -486,7 +486,9 @@ namespace HandBrake.ApplicationServices.Services.Scan Fps = title.Framerate, SourceName = title.Path, MainTitle = title.TitleNumber == featureTitle, - Playlist = title.InputType == InputType.Bluray ? string.Format(" {0:d5}.MPLS", title.Playlist).Trim() : null + Playlist = title.InputType == InputType.Bluray ? string.Format(" {0:d5}.MPLS", title.Playlist).Trim() : null, + FramerateNumerator = title.FramerateNumerator, + FramerateDenominator = title.FramerateDenominator }; foreach (Interop.Model.Scan.Chapter chapter in title.Chapters) diff --git a/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Title.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Title.cs index 2757fe093..9dce3858a 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Title.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/Model/Title.cs @@ -99,6 +99,16 @@ namespace HandBrake.ApplicationServices.Services.Scan.Model /// public double Fps { get; set; } + /// + /// Gets or sets the video frame rate numerator. + /// + public int FramerateNumerator { get; set; } + + /// + /// Gets or sets the video frame rate denominator. + /// + public int FramerateDenominator { get; set; } + /// /// Gets or sets a value indicating whether this is a MainTitle. /// diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs index 970fb5c97..236cac712 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs @@ -175,6 +175,7 @@ namespace HandBrake.ApplicationServices.Utilities // Video Settings profile.Framerate = work.Framerate.HasValue ? work.Framerate.Value : 0; profile.ConstantFramerate = work.FramerateMode == FramerateMode.CFR; + profile.PeakFramerate = work.FramerateMode == FramerateMode.PFR; profile.Quality = work.Quality.HasValue ? work.Quality.Value : 0; profile.VideoBitrate = work.VideoBitrate.HasValue ? work.VideoBitrate.Value : 0; profile.VideoEncodeRateType = work.VideoEncodeRateType; -- cgit v1.2.3