WIP: VFR Dedupe - Added code to create timecode file

This commit is contained in:
N00MKRAD
2020-11-24 02:23:19 +01:00
parent c20c8f75ec
commit 4623aa149b
9 changed files with 74 additions and 38 deletions

View File

@@ -18,9 +18,8 @@ namespace Flowframes.UI
public static async Task ExtractVideo(string videoPath, bool withAudio)
{
string outPath = Path.ChangeExtension(videoPath, null) + "-extracted";
bool rgb8 = Formats.preprocess.Contains(Path.GetExtension(videoPath).ToLower());
Program.mainForm.SetWorking(true);
await FFmpegCommands.VideoToFrames(videoPath, Path.Combine(outPath, "frames"), false, rgb8, false, false);
await FFmpegCommands.VideoToFrames(videoPath, Path.Combine(outPath, "frames"), false, false);
File.WriteAllText(Path.Combine(outPath, "fps.ini"), Interpolate.currentInFps.ToString());
if (withAudio)
await FFmpegCommands.ExtractAudio(videoPath, Path.Combine(outPath, "audio"));
@@ -94,7 +93,8 @@ namespace Flowframes.UI
Program.mainForm.SetWorking(true);
await Task.Delay(10);
framesPath = Path.ChangeExtension(inPath, null) + "-frames";
await Interpolate.ExtractFrames(inPath, framesPath);
Directory.CreateDirectory(framesPath);
await Interpolate.ExtractFrames(inPath, framesPath, false);
}
else
{
@@ -103,7 +103,7 @@ namespace Flowframes.UI
Program.mainForm.SetWorking(true);
Logger.Log("Running frame de-duplication", true);
await Task.Delay(10);
await FrameDedup.Run(framesPath, testRun);
await MagickDedupe.Run(framesPath, testRun);
IOUtils.TryDeleteIfExists(framesPath);
Program.mainForm.SetProgress(0);
Program.mainForm.SetWorking(false);