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))