Fix Audio Delays Permanently Using VLC & MKVToolNix

Multimedia files with ‘lip-sync’ issues are not uncommon, but they rarely happen in professional environments as they take extra precautions to avoid them. Let me show you how to fix mkvtoolnix audio delay (or VLC audio delay) on a Windows computer.

In a previous post I wrote about how to fix some of these synchronization issues permanently using ‘Avidemux’, but since then I have received a few complaints of ‘Avidemux’ not being able to fix those issues in some cases. Even though I came across some of these problems, fortunately, I have been able to fix them (so far).

‘Avidemux’ can do very little if the input file itself has some issues (corrupted video frames etc.), but ‘Avidemux’ is also a bit buggy, so some of the blame goes toward it also. In any case, there are a few other tools that you can try while trying to fix a sync ‘malfunction’, and ‘MKVToolNix’ is one among them.

Illustration …

‘MKVToolNix’ is not an encoder as you can only use it to ‘extract’ audio/video/subtitle tracks from other containers (MP4, AVI, FLV etc) and put them into the powerful and open-source MKV container. While doing so, this tool also lets you pass certain settings (sync, fps, aspect ratio …), and it is through that we can attempt to fix sync problems.

But please be aware that the only output format it supports is MKV (and a few of its variations such as ‘MKA’ for audio’, ‘MKS’ for subtitles etc.), and unlike MP4 or AVI, MKV is not supported by a lot of commercial and strictly hardware-based multimedia players. Computer users, however, do not have to worry about it as popular players (VLC, MPC, PotPlayer, SMPlayer, KMPlayer …) support it. Enough talking, let’s do it!

Note: Make sure you have downloaded and installed the latest builds of ‘MKVToolNix’ from here. I also recommend that you use VLC because both these utilities are available for multiple operating system platforms, so you can use this ‘guide’ in any of them.

What we are going to do is …

*. First, we are going to play the ‘troublesome’ file in VLC (or any other player that lets you change the sync temporarily), and we will try to identify the proper sync value.

*. Then we will simply enter that sync value into ‘MKVToolNix’ and save it as a new MKV file so that it is saved permanently. That is it!

Step 1:

So open your ‘troublesome’ file in VLC, and let it play for a few seconds. Then simply press the ‘j’ key on your keyboard. This will make VLC play the audio track a bit ahead of the video. A single click only increases the value by 50 milliseconds, so unless the ‘gap’ is very small, you will have to press it a few times to see its effect.


Anyhow, if after pressing the ‘j’ key a few times it worsens the ‘gap’, then it is an indication that you actually have to make VLC play the audio track a bit behind (delay) the video. The shortcut key for that is ‘k’. Again, to feel its effect, you might have to press it a few times. If, after doing that, it seems to shorten the ‘gap’, then it is an indication that you are on the right track. So keep doing that until you come up with the perfect sync value.

VLC-with-a-plus-delay-audio-sync-value  So as a general rule, play with the ‘j’ and ‘k’ keys until you find the perfect sync value for that multimedia file. Once you have found it, simply take a note of it (note that depending on the file, the value could be positive or a negative one. If it is a negative/minus one, then you should enter a minus sign before entering the value in ‘MKVToolNix’, more below) and close VLC.

Step 2:

Now open ‘MKVToolNix’ and load the ‘troublesome’ file into it. Then under the ‘Tracks, chapters and tags’ field, select the audio stream/track (shown below is an example).


Step 3:

Then from under it, click on the ‘Format specific options’ tab, and you will see an empty field that says ‘Delay (in ms)’. Now simply enter the sync value you found above into that field.

Make sure to enter a minus sign (-) when needed (-200 for instance) …

Step 4:

Now click on the ‘Browse’ button under the ‘Output filename’ field. Select a location and a file name for the output MKV file. Once done, simply click on the ‘Start muxing’ button. If everything goes without any errors, try playing the newly saved MKV file, and now you should be able to enjoy it without any ‘lip-sync’ issues!

An RHCE, 'Linux' user with 14+ years of experience. Extreme lover of Linux and FOSS. He is passionate to test every Linux distribution & compare with the previous release to write in-depth articles to help the FOSS community.

93 thoughts on “Fix Audio Delays Permanently Using VLC & MKVToolNix”

  1. You may try Avdshare VideoGo to add audio track to mp4,
    Working as an Audio Volume Booster, Avdshare VideoGo
    can easily Add auido to MP4 like add MP3 to MP4, WAV to MP4, M4A to MP4, AAC to MP4, FLAC to MP4, AC3 to MP4, etc.

    • Thank you. I’m actually aware of this application, but I didn’t mention it because it’s not free and it only supports the Windows platform (although one might be able to run it using Wine in GNU/Linux).

  2. this works, but it does not work for correcting specific parts only.

    if you adjust audio delays forwards or backwards, the entire track shifts.

    this method only works for movies that are out of sync for entire track

    gayan if you know partial edits, update your post

    • Hi Johnson,

      I understand your problem and yes I’ve come across such issues too. But unfortunately, you can’t fix those issues using this method as far as I know. Sorry about that.

  3. hi what if certain parts of the video are out of sync with different delays??
    for example at maybe 30mins the sound is delayed 1200ms but after i saved the file and went back to watching the video it suddenly has another delay at another later part of the video?
    or in the entire video only the audio in a certain time is delayed and the rest of the video is ok?

    • I don’t think it’s possible to fix that type of errors using this method. You may need the help of a video editor (something that’s a bit more powerful as well) to fix these errors.

  4. does this trick work on dual audio movies.I am having delayed audio not just in milliseconds but it comes after some minutes.Please help me out.

    • Hi,

      I think you’ll have to use some sort of a video editor to fix such issues. First you’ll have to ‘cut’ the portion where the sync issue starts, and then fix it and then re-merge the whole track.

  5. This guide was helpful and does work, but a heads up, unless I’m missing something it doesn’t work with the newest version of mkvtoolnix 9.9 and only works with versions 8.3 or older, as they’ve changed the UI and moved things around in newer versions.

  6. hi

    i didnt try this method and i dont know if i should. i used mkvmerge gui and then mkv2vob to convert my mkv, put it on my usb but when i try to play it on my ps3 it starts running fast and then it freezes. i can skip forward with the left stick but the same thing happens. any idea? i wanna copy it on my ps3 hard drive and watch it properly. i dont wanna stream it, convert it or lose the quality. can u help.thx

  7. Gayan, I used Any Video Converter software to convert the .mkv file into .mov Is there any freeware other than MKVToolNix I can use to correct the file and sync the audio/video? I want to burn to a disc.

  8. i was recording some videos say (2 cvbs camera) and one hd camera and its alll working fine., but after recording completed,(very soon)i am trying to zip all the 3 files., while doing the same i am missing some frames in recorded mp4 flies., any suggestion will be appreciated.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.