From e1d7f00d48779fa356ea657b6baca1eb0e34b6f6 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Sun, 16 Jul 2023 15:09:04 +0200 Subject: [PATCH] Fix fps mismatch --- roop/utilities.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roop/utilities.py b/roop/utilities.py index 875e9ca8b..330bc5e81 100644 --- a/roop/utilities.py +++ b/roop/utilities.py @@ -44,7 +44,11 @@ def detect_fps(target_path: str) -> float: def extract_frames(target_path: str) -> None: temp_directory_path = get_temp_directory_path(target_path) - run_ffmpeg(['-i', target_path, '-pix_fmt', 'rgb24', os.path.join(temp_directory_path, '%04d.png')]) + command = ['-i', target_path, '-pix_fmt', 'rgb24'] + if not roop.globals.keep_fps: + command.extend(['-vf', 'fps=30']) + command.extend([os.path.join(temp_directory_path, '%04d.png')]) + run_ffmpeg(command) def create_video(target_path: str, fps: float = 30.0) -> None: