mirror of
https://github.com/facefusion/facefusion.git
synced 2026-04-29 21:07:50 +02:00
Enforce output resolution on merge video
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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 ])
|
||||
|
||||
Reference in New Issue
Block a user