Skip to content

Commit

Permalink
Merge pull request #2201 from zyw241/fix-concatenate
Browse files Browse the repository at this point in the history
BugFix: Fix the alignment of audio duration and video duration after concatenate_videoflips
  • Loading branch information
OsaAjani authored Jan 30, 2025
2 parents 41ed88e + d7abde6 commit 71eb429
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion moviepy/video/compositing/CompositeVideoClip.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,9 @@ def get_mask(clip):
(clip.audio, t) for clip, t in zip(clips, timings) if clip.audio is not None
]
if audio_t:
result.audio = CompositeAudioClip([a.with_start(t) for a, t in audio_t])
result.audio = CompositeAudioClip(
[a.with_start(t) for a, t in audio_t]
).with_duration(result.duration)

fpss = [clip.fps for clip in clips if getattr(clip, "fps", None) is not None]
result.fps = max(fpss) if fpss else None
Expand Down

0 comments on commit 71eb429

Please sign in to comment.