[FFmpeg-user] Audio out of sync after video concatenation

Rob Hallam ffmpeg at roberthallam.com
Tue Jun 22 13:31:02 EEST 2021

On Tue, 22 Jun 2021 at 11:15, <iburman at compuscience.com> wrote:
> Video 1 - 13 seconds with audio
> Video 2 -  4 seconds without audio (I generated this video using xfade transition
> Video 3 - 4 seconds with audio
> If I concatenate video 1 and 3 everything works fine; audio synchronization
> is correct from start to end. However, when I concatenate all 3 of them, the
> audio from video 3 starts playing a little bit before the end of video 2. As
> video 3 is a person talking, you clearly see that the audio doesn't match
> the mouth movements.
> Why is this happening and how can I fix it?

Have you tried adding (silent) audio to video 2 and trying your join
operation again? You could use `anullsrc':


or make silent audio elsewhere and add to video 2 separately.

You may also want to look up the `-shortest' option if you don't know
of it already.


More information about the ffmpeg-user mailing list