From e299ebafa668dbfbf1d92bdb5cadca9c88302e8f Mon Sep 17 00:00:00 2001 From: N00MKRAD Date: Tue, 15 Dec 2020 19:53:56 +0100 Subject: [PATCH] workaround for fucked encode with 2x/4x --- Code/AudioVideo/FFmpegCommands.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/AudioVideo/FFmpegCommands.cs b/Code/AudioVideo/FFmpegCommands.cs index 647bbd4..5f2c366 100644 --- a/Code/AudioVideo/FFmpegCommands.cs +++ b/Code/AudioVideo/FFmpegCommands.cs @@ -103,7 +103,8 @@ namespace Flowframes string enc = useH265 ? "libx265" : "libx264"; string presetStr = $"-preset {Config.Get("ffEncPreset")}"; string vfrFilename = Path.GetFileName(framesFile); - string args = $"-vsync 1 -f concat -i {vfrFilename} -r {fps.ToString().Replace(",", ".")} -c:v {enc} -crf {crf} {presetStr} {videoEncArgs} -threads {Config.GetInt("ffEncThreads")} -c:a copy {outPath.Wrap()}"; + string vsync = (Interpolate.lastInterpFactor == 2) ? "-vsync 1" : "-vsync 2"; + string args = $"{vsync} -f concat -i {vfrFilename} -r {fps.ToString().Replace(",", ".")} -c:v {enc} -crf {crf} {presetStr} {videoEncArgs} -threads {Config.GetInt("ffEncThreads")} -c:a copy {outPath.Wrap()}"; await AvProcess.RunFfmpeg(args, framesFile.GetParentDir(), logMode); }