Skip to content

Commit

Permalink
[playlists] fix concat playlist build with Non-monotonic DTS
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBldy committed Nov 20, 2024
1 parent e5c3495 commit 25ab5c8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions zou/utils/movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit 25ab5c8

Please sign in to comment.