Fallbacks for audio
This commit is contained in:
@@ -164,8 +164,12 @@ def restore_audio(target_path : str, output_path : str, trim_frame_start : int,
|
|||||||
output_audio_volume = state_manager.get_item('output_audio_volume')
|
output_audio_volume = state_manager.get_item('output_audio_volume')
|
||||||
target_video_fps = detect_video_fps(target_path)
|
target_video_fps = detect_video_fps(target_path)
|
||||||
temp_video_path = get_temp_file_path(target_path)
|
temp_video_path = get_temp_file_path(target_path)
|
||||||
|
temp_video_format = get_file_format(temp_video_path)
|
||||||
temp_video_duration = detect_video_duration(temp_video_path)
|
temp_video_duration = detect_video_duration(temp_video_path)
|
||||||
|
|
||||||
|
if temp_video_format in [ 'avi', 'mov' ] and output_audio_encoder == 'flac':
|
||||||
|
output_audio_encoder = 'aac'
|
||||||
|
|
||||||
commands = ffmpeg_builder.chain(
|
commands = ffmpeg_builder.chain(
|
||||||
ffmpeg_builder.set_input(temp_video_path),
|
ffmpeg_builder.set_input(temp_video_path),
|
||||||
ffmpeg_builder.select_media_range(trim_frame_start, trim_frame_end, target_video_fps),
|
ffmpeg_builder.select_media_range(trim_frame_start, trim_frame_end, target_video_fps),
|
||||||
@@ -187,8 +191,12 @@ def replace_audio(target_path : str, audio_path : str, output_path : str) -> boo
|
|||||||
output_audio_quality = state_manager.get_item('output_audio_quality')
|
output_audio_quality = state_manager.get_item('output_audio_quality')
|
||||||
output_audio_volume = state_manager.get_item('output_audio_volume')
|
output_audio_volume = state_manager.get_item('output_audio_volume')
|
||||||
temp_video_path = get_temp_file_path(target_path)
|
temp_video_path = get_temp_file_path(target_path)
|
||||||
|
temp_video_format = get_file_format(temp_video_path)
|
||||||
temp_video_duration = detect_video_duration(temp_video_path)
|
temp_video_duration = detect_video_duration(temp_video_path)
|
||||||
|
|
||||||
|
if temp_video_format in [ 'avi', 'mov' ] and output_audio_encoder == 'flac':
|
||||||
|
output_audio_encoder = 'aac'
|
||||||
|
|
||||||
commands = ffmpeg_builder.chain(
|
commands = ffmpeg_builder.chain(
|
||||||
ffmpeg_builder.set_input(temp_video_path),
|
ffmpeg_builder.set_input(temp_video_path),
|
||||||
ffmpeg_builder.set_input(audio_path),
|
ffmpeg_builder.set_input(audio_path),
|
||||||
|
|||||||
Reference in New Issue
Block a user