From 6cd16c9f351007006cd974dc43b265be7e93b11a Mon Sep 17 00:00:00 2001 From: henryruhs Date: Fri, 9 Jun 2023 08:25:53 +0200 Subject: [PATCH] Fix fps detection --- roop/core.py | 2 +- roop/utilities.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roop/core.py b/roop/core.py index 1621210..c2db1cf 100755 --- a/roop/core.py +++ b/roop/core.py @@ -187,7 +187,7 @@ def start() -> None: torch.cuda.empty_cache() if roop.globals.keep_fps: update_status('Detecting fps...') - fps = detect_fps(roop.globals.source_path) + fps = detect_fps(roop.globals.target_path) update_status(f'Creating video with {fps} fps...') create_video(roop.globals.target_path, fps) else: diff --git a/roop/utilities.py b/roop/utilities.py index ce55969..68d508a 100644 --- a/roop/utilities.py +++ b/roop/utilities.py @@ -22,8 +22,8 @@ def run_ffmpeg(args: List) -> None: pass -def detect_fps(source_path: str) -> int: - command = ['ffprobe', '-v', 'error', '-select_streams', 'v:0', '-show_entries', 'stream=r_frame_rate', '-of', 'default=noprint_wrappers=1:nokey=1', source_path] +def detect_fps(target_path: str) -> int: + command = ['ffprobe', '-v', 'error', '-select_streams', 'v:0', '-show_entries', 'stream=r_frame_rate', '-of', 'default=noprint_wrappers=1:nokey=1', target_path] output = subprocess.check_output(command).decode().strip() try: return int(eval(output))