I extracted audio and video from an mkv using mkvextract. Then I used mkvmerge to merge them back into an mkv. When I played the mkv the audio and video were out of sync.

How can I combine them so that they are in sync? I tried to find some helpful information using mkvmerge on the original file to see if there was any useful information, but didn't find any.

link|improve this question

74% accept rate
feedback

1 Answer

It's possible that the original file specified an audio delay. If you're using the mkvmerge GUI, you can change the audio track's delay in the Format specific options tab. Positive values delay the audio track, negative values advance it (all in milliseconds). If you're using the command line, you need to use the -y or --sync arguments. See the mkvmerge documentation for details. The documentation also shows you how to scale the audio delay evenly though out the video (instead of a set constant delay).

To determine the audio delay you need, you can use Media Player Classic along with the +/- keys to determine the delay. Alternatively, you can try to use a media information tool to see what the delay was on the original file.

link|improve this answer
If there's a delay specified in the original file, shouldn't mkvinfo be able to display that? – OSX NINJA Jul 30 '11 at 19:37
@OSX Jedi Yes, but only if the delay was after the audio was encoded (and explicitly specified when the file was first mkvmerge'd). – Breakthrough Jul 30 '11 at 21:27
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.