diff --git a/facefusion/core.py b/facefusion/core.py index a5aedf76..4f4bc0cb 100755 --- a/facefusion/core.py +++ b/facefusion/core.py @@ -288,7 +288,7 @@ def process_video(start_time : float) -> None: return # merge video logger.info(wording.get('merging_video_fps').format(video_fps = facefusion.globals.output_video_fps), __name__.upper()) - if not merge_video(facefusion.globals.target_path, facefusion.globals.output_video_fps): + if not merge_video(facefusion.globals.target_path, facefusion.globals.output_video_resolution, facefusion.globals.output_video_fps): logger.error(wording.get('merging_video_failed'), __name__.upper()) return # handle audio diff --git a/facefusion/ffmpeg.py b/facefusion/ffmpeg.py index aee3239d..e585f9cd 100644 --- a/facefusion/ffmpeg.py +++ b/facefusion/ffmpeg.py @@ -48,10 +48,10 @@ def compress_image(output_path : str) -> bool: return run_ffmpeg(commands) -def merge_video(target_path : str, video_fps : Fps) -> bool: +def merge_video(target_path : str, video_resolution : str, video_fps : Fps) -> bool: temp_output_video_path = get_temp_output_video_path(target_path) temp_frames_pattern = get_temp_frames_pattern(target_path, '%04d') - commands = [ '-hwaccel', 'auto', '-r', str(video_fps), '-i', temp_frames_pattern, '-c:v', facefusion.globals.output_video_encoder ] + commands = [ '-hwaccel', 'auto', '-i', temp_frames_pattern, '-s', str(video_resolution), '-r', str(video_fps), '-c:v', facefusion.globals.output_video_encoder ] if facefusion.globals.output_video_encoder in [ 'libx264', 'libx265' ]: output_video_compression = round(51 - (facefusion.globals.output_video_quality * 0.51)) commands.extend([ '-crf', str(output_video_compression), '-preset', facefusion.globals.output_video_preset ])