[FFmpeg-user] Combining 24fps Video with 23.976fps Audio

Sam Logan shapableline at gmail.com
Fri Sep 20 08:54:22 CEST 2013

I've got two video files, Video1.mp4 and Video2.mp4, which are
basically the same except that the audio for the two files are in
different languages. I want to produce an output file that has
Video1's video stream and dual audio consisting of Video2 and Video1's
audio streams (in that order). So I do:

ffmpeg -i "Video1.mp4" -i "Video2.mp4" -acodec copy -vcodec copy -map
0:0 -map 1:1 -map 0:1 "Output.mkv"

Which works fine until I play the resulting video, whereupon I
realized that I overlooked that Video1 had a framerate of 24 fps,
whereas Video2 has a framerate of 23.976 fps, meaning that on the
resulting video, the first audio stream (the stream copied from
Video2) is accurate at the beginning of the video but out-of-sync by
around 5 seconds about 1 hour into the video.

What parameters do I need to use to fix this with FFmpeg? Thanks.

More information about the ffmpeg-user mailing list