From 834c17340d72d01a14d7ea2f4ae81d6e8dc1d677 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Fri, 23 May 2025 18:53:03 +0200 Subject: [PATCH] More edge case testing --- facefusion/ffmpeg.py | 6 ++++++ tests/test_ffmpeg.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/facefusion/ffmpeg.py b/facefusion/ffmpeg.py index 07f950a..ff9ecce 100644 --- a/facefusion/ffmpeg.py +++ b/facefusion/ffmpeg.py @@ -214,6 +214,12 @@ def merge_video(target_path : str, temp_video_fps : Fps, output_video_resolution if output_file_format in [ 'm4v', 'mkv', 'mp4' ] and output_video_encoder == 'rawvideo': output_video_encoder = 'libx264' + if output_file_format == 'm4v': + output_video_encoder = 'libx264' + + if output_file_format == 'mov' and output_video_encoder == 'libvpx-vp9': + output_video_encoder = 'libx264' + if output_file_format == 'webm': output_video_encoder = 'libvpx-vp9' diff --git a/tests/test_ffmpeg.py b/tests/test_ffmpeg.py index 1256536..a751f0a 100644 --- a/tests/test_ffmpeg.py +++ b/tests/test_ffmpeg.py @@ -97,7 +97,7 @@ def test_merge_video() -> None: create_temp_directory(target_path) extract_frames(target_path, '452x240', 25.0, 0, 1) - assert merge_video(target_path, 25.0, '452x240', 25.0, 0, 1) is True + assert merge_video(target_path, 25.0, '452x240', 25.0, 0, 1) is True clear_temp_directory(target_path)