More edge case testing
This commit is contained in:
@@ -211,7 +211,7 @@ def merge_video(target_path : str, temp_video_fps : Fps, output_video_resolution
|
|||||||
temp_file_path = get_temp_file_path(target_path)
|
temp_file_path = get_temp_file_path(target_path)
|
||||||
temp_frames_pattern = get_temp_frames_pattern(target_path, '%08d')
|
temp_frames_pattern = get_temp_frames_pattern(target_path, '%08d')
|
||||||
|
|
||||||
if output_file_format == 'mp4' and output_video_encoder == 'rawvideo':
|
if output_file_format in [ 'm4v', 'mkv', 'mp4' ] and output_video_encoder == 'rawvideo':
|
||||||
output_video_encoder = 'libx264'
|
output_video_encoder = 'libx264'
|
||||||
|
|
||||||
if output_file_format == 'webm':
|
if output_file_format == 'webm':
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ def before_all() -> None:
|
|||||||
])
|
])
|
||||||
subprocess.run([ 'ffmpeg', '-i', get_test_example_file('source.mp3'), get_test_example_file('source.wav') ])
|
subprocess.run([ 'ffmpeg', '-i', get_test_example_file('source.mp3'), get_test_example_file('source.wav') ])
|
||||||
subprocess.run([ 'ffmpeg', '-i', get_test_example_file('target-240p.mp4'), get_test_example_file('target-240p.avi') ])
|
subprocess.run([ 'ffmpeg', '-i', get_test_example_file('target-240p.mp4'), get_test_example_file('target-240p.avi') ])
|
||||||
|
subprocess.run([ 'ffmpeg', '-i', get_test_example_file('target-240p.mp4'), get_test_example_file('target-240p.m4v') ])
|
||||||
|
subprocess.run([ 'ffmpeg', '-i', get_test_example_file('target-240p.mp4'), get_test_example_file('target-240p.mkv') ])
|
||||||
subprocess.run([ 'ffmpeg', '-i', get_test_example_file('target-240p.mp4'), get_test_example_file('target-240p.mov') ])
|
subprocess.run([ 'ffmpeg', '-i', get_test_example_file('target-240p.mp4'), get_test_example_file('target-240p.mov') ])
|
||||||
subprocess.run([ 'ffmpeg', '-i', get_test_example_file('target-240p.mp4'), get_test_example_file('target-240p.webm') ])
|
subprocess.run([ 'ffmpeg', '-i', get_test_example_file('target-240p.mp4'), get_test_example_file('target-240p.webm') ])
|
||||||
subprocess.run([ 'ffmpeg', '-i', get_test_example_file('target-240p.mp4'), '-vf', 'fps=25', get_test_example_file('target-240p-25fps.mp4') ])
|
subprocess.run([ 'ffmpeg', '-i', get_test_example_file('target-240p.mp4'), '-vf', 'fps=25', get_test_example_file('target-240p-25fps.mp4') ])
|
||||||
@@ -81,18 +83,19 @@ def test_extract_frames() -> None:
|
|||||||
def test_merge_video() -> None:
|
def test_merge_video() -> None:
|
||||||
merge_set =\
|
merge_set =\
|
||||||
[
|
[
|
||||||
(get_test_example_file('target-240p.avi'), 'libx264'),
|
get_test_example_file('target-240p.avi'),
|
||||||
(get_test_example_file('target-240p.mov'), 'libx264'),
|
get_test_example_file('target-240p.m4v'),
|
||||||
(get_test_example_file('target-240p.mp4'), 'libx264'),
|
get_test_example_file('target-240p.mkv'),
|
||||||
(get_test_example_file('target-240p.mp4'), 'rawvideo'),
|
get_test_example_file('target-240p.mp4'),
|
||||||
(get_test_example_file('target-240p.webm'), 'libx264'),
|
get_test_example_file('target-240p.mov'),
|
||||||
(get_test_example_file('target-240p.webm'), 'rawvideo')
|
get_test_example_file('target-240p.webm')
|
||||||
]
|
]
|
||||||
|
|
||||||
for target_path, output_video_encoder in merge_set:
|
for target_path in merge_set:
|
||||||
state_manager.init_item('output_video_encoder', output_video_encoder)
|
for output_video_encoder in get_available_encoder_set().get('video'):
|
||||||
create_temp_directory(target_path)
|
state_manager.init_item('output_video_encoder', output_video_encoder)
|
||||||
extract_frames(target_path, '452x240', 25.0, 0, 1)
|
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user