From ff8035da4abe5ab585340e9ad28302b0cfe0b106 Mon Sep 17 00:00:00 2001 From: julbean <138324323+julbean@users.noreply.github.com> Date: Tue, 19 Mar 2024 11:58:51 -0700 Subject: [PATCH] Update describealign.py Enable experimental support for flac audio in mp4 container --- describealign.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/describealign.py b/describealign.py index 582c28d..e3ead0b 100644 --- a/describealign.py +++ b/describealign.py @@ -784,9 +784,11 @@ def write_replaced_media_to_disk(output_filename, media_arr, video_file=None, au if os.path.splitext(output_filename)[1] == os.path.splitext(video_file)[1]: # wav files don't have codecs compatible with most video containers, so we convert to aac audio_codec = 'copy' if os.path.splitext(audio_desc_file)[1] != '.wav' else 'aac' + # flac audio may only have experimental support in some video containers (e.g. mp4) + standards = 'normal' if os.path.splitext(audio_desc_file)[1] != '.flac' else 'experimental' write_command = ffmpeg.output(media_input, original_video, output_filename, acodec=audio_codec, vcodec='copy', scodec='copy', - max_interleave_delta='0', loglevel='fatal', + max_interleave_delta='0', loglevel='fatal', strict=standards, **{'bsf:v': f'setts=ts=\'{setts_cmd}\'', 'bsf:s': f'setts=ts=\'{setts_cmd}\''}).overwrite_output() write_command.run(cmd=get_ffmpeg())