Howto – fix lip sync on DivX videos

10Aug10

I’ve been a keen fan of DivX for many years now (though I must confess that I still mostly use the long deprecated Dr Divx in favour of the newer DivX Converter).

One recurring annoyance is that transcoded files can sometimes have issues with lip sync. Having never found anything useful online about fixing this I thought I’d put together a quick guide.

Finding the error

The first thing is to figure out how much the audio track is out by versus the video, which can be done with a bit of trial and error using Media Player Classic [download], which has an option in the play menu to add a delay to the audio (which can be a negative number). I usually take a look at the video without any compensation and firstly try to figure out whether the audio is late or early, then make a guess at what the delay is to within a hundred ms. I’ll then add/subtract 100ms increments until it looks/sounds right (remember at 25 frames per second each frame takes 40ms, so there’s no point in fiddling around with increments less than that).

Correcting the error

For this I use VirtualDub [download], following these steps:

  1. Open the file with the lip sync issue. If you’ve used variable bit rate audio encoding you might see this warning, which can be safely ignored:
  2. We’re not going to actually change the audio, just its timing, so first set audio to Direct Stream Copy:
  3. Now we need to configure the Interleaving to match the delay found using Media Player Classic:
  4. Video isn’t going to be changed either, so set that to Direct Stream Copy too:
  5. And that’s pretty much it. All that’s needed now is to File->Save As with a different file name to the original (I append an underscore to keep things simple). The file should process really fast as VirtualDub isn’t doing any hard CODEC work – it’s just unzipping the audio from the video and rezipping it back together in a new file:

and that’s it – you should now have a file with fixed lip sync. Try it in a regular player like Windows Media Player to double check. If it’s worked to plan you can now delete the original and rename the new version.

This same process probably works for other CODEC’s besides DivX (after all it doesn’t actually do any CODEC stuff), but since I use DivX for pretty much anything I can’t say that I’ve tried.



One Response to “Howto – fix lip sync on DivX videos”

  1. 1 Gary Jones

    At Last!
    I’ve been looking for a way to fix this issue for years!
    Great post. Thanks for the info. Works a treat!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

Join 97 other followers

%d bloggers like this: