Fixed end of video getting trimmed when it shouldn't

This commit is contained in:
N00MKRAD
2021-02-28 16:26:46 +01:00
parent 01f080a472
commit 8826d45397
3 changed files with 10 additions and 2 deletions

View File

@@ -525,4 +525,4 @@ namespace Flowframes
#endregion
}
}
}

View File

@@ -79,7 +79,12 @@ namespace Flowframes.Media
if (!QuickSettingsTab.trimEnabled)
return "";
return $"-ss {QuickSettingsTab.trimStart} -to {QuickSettingsTab.trimEnd}";
string arg = $"-ss {QuickSettingsTab.trimStart}";
if(QuickSettingsTab.doTrimEnd)
arg += $" -to {QuickSettingsTab.trimEnd}";
return arg;
}
public static async Task ImportSingleImage(string inputFile, string outPath, Size size)

View File

@@ -16,6 +16,7 @@ namespace Flowframes.UI
class QuickSettingsTab
{
public static bool trimEnabled;
public static bool doTrimEnd;
public static string trimStart;
public static string trimEnd;
@@ -32,6 +33,8 @@ namespace Flowframes.UI
long dur = FormatUtils.TimestampToMs(trimEnd, false) - FormatUtils.TimestampToMs(trimStart, false);
Program.mainForm.currInDurationCut = dur;
doTrimEnd = FormatUtils.TimestampToMs(trimEnd, false) != FormatUtils.TimestampToMs(FormatUtils.MsToTimestamp(Program.mainForm.currInDuration), false);
}
public static string GetTrimEndMinusOne ()