As a follow-up on Video concatenation puts sound out of sync, I have 6 video clips where the audio is 200 ms shorter than the video. The last clip has a chair banging on the floor and serves to measure the total misalignment in the concatenation.
I tried concatenating them simply with:
ffmpeg -safe 0 -f concat -i files_to_combine -vcodec copy -acodec copy temp.MOV
files_to_combine contains a list of the files in format
file ./DSC_0013.MOV for example. The result is 0.5 seconds of misalignment.
I also tried trimming each clip to the shortest stream with:
ffmpeg -i DSC_0013.MOV -map 0 -c copy \ -fflags +shortest -max_interleave_delta 0 DSC_0013_trimmed.MOV
before concatenating them as above. The results is 0.08 seconds of misalignment. I also tried increasing the value of
-max_interleave_delta, with similar results.
With iMovie, the concatenation of audio and video is perfectly aligned.
How can I trim and concatenate the clips with FFMPEG so they concatenate as cleanly as with iMovie?