Fixing Sync Issues with nandub


I recently discussed using mencoder to transcode digital transport streams. However, I noticed a slight annoyance during playback. The video and audio weren't syncing, as seems to be the case sometimes when transcoding to Xvid or DivX. I'll give you a quick guide on how to use nandub on how to fix the problem.

RELATED:

Using MEncoder to Shrink High Def to xvid
ProjectX to Extract individual Digital TV Transport Streams

REFERENCES:

nandub (SourceForge.net)

It's actually quite simple. Start nandub and Open your video file. We've already done the hard work with transcoding, so anything else within nandub would probably be overkill. To save yourself a good deal of time, select Direct Stream Copy for both Video and Audio, as illustrated.

Once you're done with that, click on Interleaving in the Audio menu. You'll see the following dialog. I've found that setting the preload to zero and delaying the audio track by -250 milliseconds works pretty well for me (presumably the same as preloading 250 ms, I've just never done it this way).

Next, you'll simply save the new video. For an hour long recording, on a modern processor - this only takes about one or two minutes, as there isn't any hardcore transcoding going on.

I observed the delay wasn't present in MPlayer, as MEncoder seems to encode the file to a format that MPlayer seems to figure out automatically. Yet, when you play the file on Windows Media Player, or a set-top DVD player with DivX compatibility - you'll detect a slight delay from the video to the audio.

Note that nandub can do a lot more for you than correct audio and video sync issues. You may wish to play around with the program to see what else it can do for you.