Delete old vfr files whenever making a new one

This commit is contained in:
N00MKRAD
2021-02-08 21:11:25 +01:00
parent 4048d2f74c
commit 76886c6b6e
3 changed files with 7 additions and 3 deletions

View File

@@ -78,7 +78,6 @@ namespace Flowframes.Main
if (unencodedFrameLines.Count > 0 && (unencodedFrameLines.Count >= (chunkSize + safetyBufferFrames) || !aiRunning)) // Encode every n frames, or after process has exited if (unencodedFrameLines.Count > 0 && (unencodedFrameLines.Count >= (chunkSize + safetyBufferFrames) || !aiRunning)) // Encode every n frames, or after process has exited
{ {
List<int> frameLinesToEncode = aiRunning ? unencodedFrameLines.Take(chunkSize).ToList() : unencodedFrameLines; // Take all remaining frames if process is done List<int> frameLinesToEncode = aiRunning ? unencodedFrameLines.Take(chunkSize).ToList() : unencodedFrameLines; // Take all remaining frames if process is done
string lastOfChunk = Path.Combine(interpFramesPath, interpFramesLines[frameLinesToEncode.Last()]); string lastOfChunk = Path.Combine(interpFramesPath, interpFramesLines[frameLinesToEncode.Last()]);
if (!File.Exists(lastOfChunk)) if (!File.Exists(lastOfChunk))

View File

@@ -19,8 +19,12 @@ namespace Flowframes.Main
public static async Task CreateFrameOrderFile(string framesPath, bool loopEnabled, float times) public static async Task CreateFrameOrderFile(string framesPath, bool loopEnabled, float times)
{ {
Logger.Log("Generating frame order information..."); Logger.Log("Generating frame order information...");
try try
{ {
foreach (FileInfo file in IOUtils.GetFileInfosSorted(framesPath.GetParentDir(), false, $"{Paths.frameOrderPrefix}*.*"))
file.Delete();
benchmark.Restart(); benchmark.Restart();
await CreateEncFile(framesPath, loopEnabled, times, false); await CreateEncFile(framesPath, loopEnabled, times, false);
Logger.Log($"Generating frame order information... Done.", false, true); Logger.Log($"Generating frame order information... Done.", false, true);

View File

@@ -71,9 +71,10 @@ namespace Flowframes.Media
} }
if (subtitleTracks.Count > 0) if (subtitleTracks.Count > 0)
{
Logger.Log($"Extracted {subtitleTracks.Count} subtitle tracks from the input video.", false, Logger.GetLastLine().Contains(msg));
Utils.ContainerSupportsSubs(Utils.GetExt(outMode), true); Utils.ContainerSupportsSubs(Utils.GetExt(outMode), true);
}
Logger.Log($"Extracted {subtitleTracks.Count} subtitle tracks from the input video.".Replace(" 0 ", " no "), false, Logger.GetLastLine().Contains(msg));
} }
catch (Exception e) catch (Exception e)
{ {