Skip to content

Commit

Permalink
Update describealign.py
Browse files Browse the repository at this point in the history
Enable experimental support for flac audio in mp4 container
  • Loading branch information
julbean authored Mar 19, 2024
1 parent 569aa08 commit ff8035d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion describealign.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit ff8035d

Please sign in to comment.