From f0c13c2236dd0acacafc36a1b0b7e38c52c35ea4 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Sun, 2 Apr 2017 21:11:22 +0200 Subject: [PATCH] Fixes for export "FCP + image" export drop frame --- Changelog.txt | 3 ++- src/Forms/ExportPngXml.cs | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index af19c849b..3a8b951c0 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -29,9 +29,10 @@ * Fixed possible crash in "Batch convert" - thx FreezinG117 * Fixed issue with the German open quotation mark - thx Ninelpienel * Fixed bug in "Reverse RTL start/end" - thx darnn - * Fixed "FCP + image" export in frame rate 29.97 - thx chris + * Fixed "FCP + image" export for drop frame rates - thx chris * Fixed finding Tesseract traineddata files on Linux - thx mooop12 * Fixed loading of "mks" files from cmd line - thx Charles + * Fixed auto-backup for "EBU STL" format - thx Mirka 3.5.2 (3rd March 2017) diff --git a/src/Forms/ExportPngXml.cs b/src/Forms/ExportPngXml.cs index 176f06b8d..5a022768e 100644 --- a/src/Forms/ExportPngXml.cs +++ b/src/Forms/ExportPngXml.cs @@ -746,6 +746,19 @@ namespace Nikse.SubtitleEdit.Forms s = s.Replace("25", "30"); s = s.Replace("FALSE", "TRUE"); } + else if (comboBoxFrameRate.Text == "23.976") + { + s = s.Replace("NDF", "DF"); //Non Drop Frame or Drop Frame + s = s.Replace("25", "24"); + s = s.Replace("FALSE", "TRUE"); + } + else if (comboBoxFrameRate.Text == "59.94") + { + s = s.Replace("NDF", "DF"); //Non Drop Frame or Drop Frame + s = s.Replace("25", "60"); + s = s.Replace("FALSE", "TRUE"); + } + else { s = s.Replace("25", "" + comboBoxFrameRate.Text + ""); @@ -1367,8 +1380,16 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine + if (Math.Abs(param.FramesPerSeconds - 29.97) < 0.01) { - param.FramesPerSeconds = 30 / 1.001; + param.FramesPerSeconds = 30.0 / 1.0001; } + else if (Math.Abs(param.FramesPerSeconds - 23.976) < 0.01) + { + param.FramesPerSeconds = 24.0 / 1.0001; + } + else if (Math.Abs(param.FramesPerSeconds - 59.94) < 0.01) + { + param.FramesPerSeconds = 60.0 / 1.0001; + } int duration = (int)Math.Round(param.P.Duration.TotalSeconds * param.FramesPerSeconds); int start = (int)Math.Round(param.P.StartTime.TotalSeconds * param.FramesPerSeconds);