From 25ab5c8e136884465ece8d727284b379d646ff2b Mon Sep 17 00:00:00 2001 From: Evan Blaudy Date: Wed, 20 Nov 2024 18:45:56 +0100 Subject: [PATCH] [playlists] fix concat playlist build with Non-monotonic DTS --- zou/utils/movie.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zou/utils/movie.py b/zou/utils/movie.py index 1542f89e13..1770ea45d5 100644 --- a/zou/utils/movie.py +++ b/zou/utils/movie.py @@ -108,7 +108,9 @@ def generate_tile(movie_path): height = 100 width = math.ceil(height * ratio) if rows == 480: - select = f"select='not(mod(n\,{math.ceil(duration_in_frames/3840)}))'," + select = ( + rf"select='not(mod(n\,{math.ceil(duration_in_frames/3840)}))'," + ) else: select = "" try: @@ -493,7 +495,11 @@ def concat_demuxer(in_files, output_path, *args): stream = ffmpeg.input(temp.name, format="concat", safe=0) stream = ffmpeg.output( - stream.video, stream.audio, output_path, c="copy" + stream.video, + stream.audio, + output_path, + vf="select=concatdec_select", + af="aselect=concatdec_select,aresample=async=1", ) return run_ffmpeg(stream, "-xerror")