Skip to content

Industry leading face manipulation platform

More edge case testing

henryruhs068f6c86d1c0
diff --git a/facefusion/ffmpeg.py b/facefusion/ffmpeg.py
index ff9ecce2..b0b6af3d 100644
--- a/facefusion/ffmpeg.py
+++ b/facefusion/ffmpeg.py
@@ -211,10 +211,10 @@ def merge_video(target_path : str, temp_video_fps : Fps, output_video_resolution
temp_file_path = get_temp_file_path(target_path)
temp_frames_pattern = get_temp_frames_pattern(target_path, '%08d')
- if output_file_format in [ 'm4v', 'mkv', 'mp4' ] and output_video_encoder == 'rawvideo':
+ if output_file_format == 'm4v':
output_video_encoder = 'libx264'
- if output_file_format == 'm4v':
+ if output_file_format in [ 'mkv', 'mp4' ] and output_video_encoder == 'rawvideo':
output_video_encoder = 'libx264'
if output_file_format == 'mov' and output_video_encoder == 'libvpx-vp9':
diff --git a/tests/test_ffmpeg.py b/tests/test_ffmpeg.py
index 7c23c86f..00cda8cf 100644
--- a/tests/test_ffmpeg.py
+++ b/tests/test_ffmpeg.py
@@ -46,7 +46,6 @@ def before_each() -> None:
prepare_test_output_directory()
def test_get_available_encoder_set() -> None:
available_encoder_set = get_available_encoder_set()
@@ -93,14 +92,15 @@ def test_merge_video() -> None:
for target_path in merge_set:
for output_video_encoder in get_available_encoder_set().get('video'):
- state_manager.init_item('output_video_encoder', output_video_encoder)
- create_temp_directory(target_path)
- extract_frames(target_path, '452x240', 25.0, 0, 1)
+ if output_video_encoder not in [ 'h264_amf', 'hevc_amf', 'h264_qsv', 'hevc_qsv' ]:
+ state_manager.init_item('output_video_encoder', output_video_encoder)
+ 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
- if merge_video(target_path, 25.0, '452x240', 25.0, 0, 1) is False:
- assert 'this does not work' == output_video_encoder
+ if merge_video(target_path, 25.0, '452x240', 25.0, 0, 1) is False:
+ assert 'this does not work' == output_video_encoder
clear_temp_directory(target_path)