From b91ed611d0f26b5e317abe6458edbe8bc2a7af9f Mon Sep 17 00:00:00 2001 From: Mercurio <47455213+NotLugozzi@users.noreply.github.com> Date: Sat, 7 Sep 2024 13:50:34 +0200 Subject: [PATCH] Force DDAgrab framerate, add `-shortest` to combined output to reduce dropped frames at the end of the final clip --- 2dxAutoClip/iidxAutoClip.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2dxAutoClip/iidxAutoClip.cs b/2dxAutoClip/iidxAutoClip.cs index af5da94..2698386 100644 --- a/2dxAutoClip/iidxAutoClip.cs +++ b/2dxAutoClip/iidxAutoClip.cs @@ -233,7 +233,7 @@ class Program var date = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"); _videoFilePath = $"{_ffmpegFolderPath}\\{songName}_{date}.mkv"; var ffmpegArguments = $"-framerate {_framerate} " + - $"-filter_complex \"ddagrab=0,hwdownload,format=bgra\" " + + $"-filter_complex \"ddagrab=framerate={_framerate},hwdownload,format=bgra\" " + $"-c:v libx264 -tune zerolatency -crf {_crf} -video_size {_resolution} -movflags +faststart -y \"{_videoFilePath}\""; _ffmpegProcess = new Process { @@ -280,7 +280,7 @@ class Program { var combinedOutputFilePath = $"{_ffmpegFolderPath}\\{songName}_combined_{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.mp4"; var ffmpegArgs = - $"-y -i \"{videoFilePath}\" -i \"{audioFilePath}\" -c:v copy -c:a aac -strict experimental \"{combinedOutputFilePath}\""; + $"-y -i \"{videoFilePath}\" -i \"{audioFilePath}\" -c:v copy -c:a aac -strict experimental -shortest \"{combinedOutputFilePath}\""; var processInfo = new ProcessStartInfo {