0

I'm trying to add an audio track to a .mkv file but the duration don't match.

Video duration of the .mkv I want to keep is 01:29:06.625 (24fps video) and desired audio track I want to add is 01:25:35.05 (extracted from a 25fps video, same movie but different source).

If I just add this audio with ffmpeg with ffmpeg -i input_video -i input_audio -map 0 -map 1 -c copy output.mkv the audio plays ahead of video preogressively.

It's not a constant delay.

I don't know how to fix it.

1

1 Answer 1

0

Try using the atempo audio filter. If the framerates are really exactly 24 fps and 25 fps, you should use -af atempo=24/25 If, however, your 24 fps is in fact 23.976 (24000 / 1001), you should use -af atempo=23.976/25

More: https://ffmpeg.org/ffmpeg-all.html#atempo

EDIT: You must re-encode to change the audio this way. Copy won't do.

You must log in to answer this question.