Celeb Glow
general | March 07, 2026

Audio and video out of sync when using mkvmerge

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.

3 Answers

Here is a simple workflow:

  • Find out how much out of sync it is with VLC player by using j and k buttons.
  • Download mkvtoolnix and click on add file.
  • Add your video file. When added, click on the audio file and now you can add your delay. Simply put, use - or + and which ever you delay worked out with vlc.
  • Press mux now. Done :)

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.

2

In commandline mkvmerge it's like this:

mkvmerge --verbose -o output.mkv -y 1:1000 input.mkv

where

  • 1 is the track number, you can find it out using mkvinfo or mediainfo (the latter adds 1 to the track number, ie. uses natural counting starting with 1). Most of the times it will be 1 for the first audio track.
  • 1000 is the delay in MS (milliseconds), so 1000 is 1 second.

BTW, --verbose might help you in finding out what exactly is happening and why it's out of sync.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy